Esempio n. 1
0
def get_peers():
    # 1. start interface and wait for connection
    interface = electrum.Interface("ecdsa.net:110:s")
    q = Queue.Queue()
    interface.start(q)
    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
Esempio n. 2
0
def get_peers():
    # 1. start interface and wait for connection
    interface = electrum.Interface('ecdsa.net:110:s')
    q = Queue.Queue()
    interface.start(q)
    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
Esempio n. 3
0
 def peers(self):
     print("got peers list:")
     l = filter_protocol(self.wallet.network.get_servers(), 's')
     for s in l:
         print(s)
Esempio n. 4
0
 def peers(self):
     print("got peers list:")
     l = filter_protocol(self.wallet.network.get_servers(), 's')
     for s in l:
         print (s)