2012-03-17 12:51:16 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
2012-05-10 14:38:49 +02:00
|
|
|
from electrum import TcpStratumInterface
|
2012-03-17 12:51:16 +01:00
|
|
|
|
2012-05-10 14:38:49 +02:00
|
|
|
i = TcpStratumInterface('ecdsa.org', 50001)
|
2012-05-17 20:26:37 +02:00
|
|
|
i.init_socket()
|
2012-03-25 08:53:23 +02:00
|
|
|
i.start()
|
2012-03-28 23:02:33 +02:00
|
|
|
i.send([('blockchain.numblocks.subscribe',[])])
|
2012-03-17 12:51:16 +01:00
|
|
|
|
|
|
|
|
while True:
|
2012-03-24 15:23:33 +01:00
|
|
|
r = i.responses.get(True, 100000000000)
|
2012-05-17 20:26:37 +02:00
|
|
|
if r.get('method') == 'blockchain.numblocks.subscribe':
|
|
|
|
|
print r.get('result')
|