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