Open Lanjiejie opened 3 years ago
This should be RLP encoded and passed to Eth::send_raw_transaction
. Happy to accept a PR with example showing how to use it or some API change.
@Lanjiejie you should simply use the RLP encoded tx to make this work. I think you should be able to do that like this:
let signed = futures::executor::block_on(web3.accounts().sign_transaction(tx, &seckey));
web3.eth().send_raw_transaction(signed.raw_transaction).await
This post helped me make use of the Rust-web3. Thank you to everyone who initiated this discussion.
It is important that we learn how to spend with:
(1) Our own keys. Not your keys. Not your Ethereum.
(2) Our own node. Not your node. Not your rules.
This post quickly captures the essence--though not everything--on how to get both done. Thanks!
If you are trying to do this in a Windows environment, be sure to include the "signing" feature. Spent way too long on this haha.
web3 = { version = "0.19.0", default-features = false, features = ["http", "http-tls", "signing"] }
I want to send a transaction signed with privatekey. And I try to do like this :
It gives back a SignedTransaction struct, but I don't know how to send it. Could anybody help me? Please give me an example