mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-01 13:10:04 +00:00
11 lines
247 B
Python
11 lines
247 B
Python
|
from bitcoin.rpc import RawProxy
|
||
|
|
||
|
# Create a connection to local Bitcoin Core node
|
||
|
p = RawProxy()
|
||
|
|
||
|
# Run the getinfo command, store the resulting data in info
|
||
|
info = p.getinfo()
|
||
|
|
||
|
# Retrieve the 'blocks' element from the info
|
||
|
print(info['blocks'])
|