01fbc706c24de786d40127c3666a8a37396750e7
[electrum-nvc.git] / scripts / blocks
1 #!/usr/bin/env python
2
3 from electrum import TcpStratumInterface
4
5 i = TcpStratumInterface('electrum.novit.ro', 50001)
6 i.init_socket()
7 i.start()
8 i.send([('blockchain.numblocks.subscribe',[])])
9
10 while True:
11     try:
12         r = i.responses.get(True, 100000000000)
13     except KeyboardInterrupt:
14         break
15     if r.get('method') == 'blockchain.numblocks.subscribe':
16         print r.get('result')