一.Web3py的一些使用的例子:
1.查詢區(qū)塊:
···
通過number查找
web3.eth.getBlock(12345)
通過address查找
web3.eth.getBlock('0x767c2bfb3bdee3f78676c1285cd757bcd5d8c272cef2eb30d9733800a78c0b6d')
2.得到最近的區(qū)塊:
web3.eth.getBlock('latest')
獲得最近區(qū)塊的number
web3.eth.blockNumber
3.查詢交易信息:
···
web3.eth.getTransaction('0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060')
···
4.查詢收據(jù)
···
web3.eth.getTransactionReceipt('0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060')
二.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