web3.py 中 sendTransaction 和 sendRawTransaction 之间的区别
Difference between sendTransaction and sendRawTransaction in web3.py
这些 web3.py 发送交易的方法之间的实际区别是什么?
w3.eth.sendTransaction({})
w3.eth.sendRawTransaction(signed_txn.rawTransaction)
w3.eth.sendTransaction()
only supports sending unsigned transactions. In order to use it, your node must be managing your private key. Since the node must manage your key, you must not use it with a hosted node.
w3.eth.sendRawTransaction()
requires that the transaction be already signed and serialized. So it requires extra serialization steps to use, but enables you to broadcast transactions on hosted nodes. There are other reasons that you might want to use a local key,当然。所有这些都需要使用 sendRawTransaction()
.
这些 web3.py 发送交易的方法之间的实际区别是什么?
w3.eth.sendTransaction({})
w3.eth.sendRawTransaction(signed_txn.rawTransaction)
w3.eth.sendTransaction()
only supports sending unsigned transactions. In order to use it, your node must be managing your private key. Since the node must manage your key, you must not use it with a hosted node.
w3.eth.sendRawTransaction()
requires that the transaction be already signed and serialized. So it requires extra serialization steps to use, but enables you to broadcast transactions on hosted nodes. There are other reasons that you might want to use a local key,当然。所有这些都需要使用 sendRawTransaction()
.