Web3py简单使用方法(三)

2025-04-14 17:28:26
推荐回答(1个)
回答1:

一.Web3py的一些使用的例子:
1.查询区块:
···

web3.eth.getBlock(12345)

web3.eth.getBlock('0x767c2bfb3bdee3f78676c1285cd757bcd5d8c272cef2eb30d9733800a78c0b6d')

web3.eth.getBlock('latest')

web3.eth.blockNumber

二.web3py还提供几个详细模块的api,具体可上文档查询。
1.Web3.eth : http://web3py.readthedocs.io/en/latest/web3.eth.html
2.Web3.shh : http://web3py.readthedocs.io/en/latest/web3.shh.html
3.Web3.personal : http://web3py.readthedocs.io/en/latest/web3.personal.html
4.Web3.version : http://web3py.readthedocs.io/en/latest/web3.version.html
5.Web3.txpool : http://web3py.readthedocs.io/en/latest/web3.txpool.html
6.Web3.miner : http://web3py.readthedocs.io/en/latest/web3.miner.html
7.Web3.admin : http://web3py.readthedocs.io/en/latest/web3.admin.html