mirror of
https://github.com/tappollo/bitcoinbook.git
synced 2026-01-12 17:03:00 +08:00
Rework ch03 for most recent version of Bitcoin Core
This commit is contained in:
@@ -3,8 +3,8 @@ 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()
|
||||
# Run the getblockchaininfo command, store the resulting data in info
|
||||
info = p.getblockchaininfo()
|
||||
|
||||
# Retrieve the 'blocks' element from the info
|
||||
print(info['blocks'])
|
||||
|
||||
Reference in New Issue
Block a user