big refactoring: command line options and electrum.conf options override settings...
[electrum-nvc.git] / scripts / blocks
1 #!/usr/bin/env python
2
3 from electrum import Interface
4
5 i = Interface({'server':'electrum.novit.ro:50001:t'})
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')