问题
I would like to retrive all transactions within a block with a certain block height, without running a full node or downloading a few GB of data.
Not sticking to Python, tried to use the Block Height
section of this. Following the example given there,
https://blockchain.info/block-height/$100?format=json
returns:
Invalid Numerical Value
Is there an easy, Pythonic way to do this?
回答1:
You have to use without $
which was only information that $block_height
is not part of url but variable which you have to replace,
https://blockchain.info/block-height/100?format=json
import requests
r = requests.get('https://blockchain.info/block-height/100?format=json')
data = r.json()
#print(r.text)
#print(data)
print(data['blocks'][0]['hash'])
来源:https://stackoverflow.com/questions/61858764/is-there-an-easy-way-to-access-all-transactions-recorded-in-a-bitcoin-block-with