You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
412 B
16 lines
412 B
#!/usr/bin/env python |
|
|
|
import sys, electrum |
|
|
|
i = electrum.Interface() |
|
i.register_callback('connected', lambda: sys.stderr.write("Connected to %s\n" % i.connection_msg)) |
|
i.start() |
|
i.send([('blockchain.numblocks.subscribe',[])]) |
|
|
|
while True: |
|
try: |
|
r = i.get_response() |
|
except KeyboardInterrupt: |
|
break |
|
if r.get('method') == 'blockchain.numblocks.subscribe': |
|
print r.get('result')
|
|
|