示例#1
0
def get_peers():
    # 1. start interface and wait for connection
    q = Queue.Queue()
    interface = electrum.Interface('vxjs5njolvlvr36xndqadaz23qb7venhzjhqs6w6274d2bh6cqca.b32.i2p:50001:s', q)
    interface.start()
    i, r = q.get()
    if not interface.is_connected():
        raise BaseException("not connected")
    # 2. get list of peers
    interface.send_request({'id':0, 'method':'server.peers.subscribe','params':[]})
    i, r = q.get(timeout=10000)
    peers = parse_servers(r.get('result'))
    peers = filter_protocol(peers,'s')
    i.stop()
    return peers
示例#2
0
def get_peers():
    # 1. start interface and wait for connection
    q = Queue.Queue()
    interface = electrum.Interface('electrum-verge.xyz:50001:s', q)
    interface.start()
    i, r = q.get()
    if not interface.is_connected():
        raise BaseException("not connected")
    # 2. get list of peers
    interface.send_request({
        'id': 0,
        'method': 'server.peers.subscribe',
        'params': []
    })
    i, r = q.get(timeout=10000)
    peers = parse_servers(r.get('result'))
    peers = filter_protocol(peers, 's')
    i.stop()
    return peers
def get_peers():
    # 1. start interface and wait for connection
    q = Queue.Queue()
    interface = electrum.Interface(
        'yqxqkaxyoihopaekaewf4pghrfql2lzeqbedbd2o4i2b7kxfgkpa.b32.i2p:50001:s',
        q)
    interface.start()
    i, r = q.get()
    if not interface.is_connected():
        raise BaseException("not connected")
    # 2. get list of peers
    interface.send_request({
        'id': 0,
        'method': 'server.peers.subscribe',
        'params': []
    })
    i, r = q.get(timeout=10000)
    peers = parse_servers(r.get('result'))
    peers = filter_protocol(peers, 's')
    i.stop()
    return peers