create scripts directory
This commit is contained in:
16
scripts/blocks
Executable file
16
scripts/blocks
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from electrum import TcpStratumInterface
|
||||
|
||||
i = TcpStratumInterface('electrum.novit.ro', 50001)
|
||||
i.init_socket()
|
||||
i.start()
|
||||
i.send([('blockchain.numblocks.subscribe',[])])
|
||||
|
||||
while True:
|
||||
try:
|
||||
r = i.responses.get(True, 100000000000)
|
||||
except KeyboardInterrupt:
|
||||
break
|
||||
if r.get('method') == 'blockchain.numblocks.subscribe':
|
||||
print r.get('result')
|
||||
Reference in New Issue
Block a user