因为我使用的是web3 = Web3(HTTPProvider('https://mainnet.infura.io/root@123'))
这就是为什么我必须使用sendrawtransaction来处理乙醚事务。现在用PYTHON编写sendrawtransaction
的过程是什么?
如果有任何其他的交易过程使用这个Httpprovider
在比特洪,那么请提到。
发布于 2017-10-21 20:50:09
如果我对您的理解是正确的,那么您只是想弄清楚如何使用web3.py发送事务。如果是这样的话,这样的事情应该能起作用:
web3.eth.sendTransaction({
'from': '0x...',
'to': '0x...',
'value': web3.toWei(1, 'ether'),
})
发布于 2017-09-21 04:22:47
你可以用聚醚签一笔交易。见此处的空洞回答:创建并签署脱机原始事务?
发布于 2017-09-21 07:15:27
您可以参考官方的这里文档。
它给出了一个例子如下
从nonce=web3.eth.getTransactionCount(web3.eth.coinbase),to='0xd3cda913deb6f67967b99d67acdfa1712c293601',Transaction >>> tx = Transaction( ethereum.transactions gasprice=web3.eth.gasPrice,startgas=100000,to=‘0xd3cda913deb6f67967b99d67acdfa1712c293601’,value=12345,data=b‘,) >>> tx.sign(the_private_key_for_the_from_account) >>> raw_tx = rlp.encode(tx) >>> raw_tx_hex = web3.toHex(raw_tx) raw_tx_hex()
https://ethereum.stackexchange.com/questions/26812
复制相似问题