I'm trying to replay transactions that exist in one chain on another.
I can replicate all transaction arguments that are available through eth_getTransactionByHash, but now need to sign the transaction. How do I extract the signing information from the committed transaction so that I'm able to resubmit with eth_sendRawTransaction.
Also welcome responses in web3.py, web3.js, ethers.js or any other preferred json-rpc SDK.
Existing code using web3.py that doesn't work:
tx = fallback_web3.eth.getTransaction(individual_tx_hash)
transaction = {
"from": tx["from"],
"to": tx["to"],
"gas": tx["gas"],
"gasPrice": tx["gasPrice"],
"value": tx["value"],
"nonce": tx["nonce"],
}
if "data" in tx:
transaction["data"] = tx["data"]
w3.eth.sendTransaction(transaction)
eth_sendRawTransactiondoesn't require you to pass thefromvalue, as it is already embedded in the raw transaction itself (which you need to pass to this function). – goodvibration Sep 08 '20 at 10:55getTransactionByHashit's giving me: hash, nonce, v, r, s, etc. individually. – Peteris Sep 08 '20 at 11:02web3.pyso using something very similar. – Peteris Sep 08 '20 at 11:02fromfield value. – goodvibration Sep 08 '20 at 11:03fromfield value as long as all the other values but now I need to sign the transaction.Thanks @clement - yes I'm keeping the chain_id the same.
– Peteris Sep 08 '20 at 11:08signTransactionin web3.py also but it requires the private key. I don't think signing will work because there is no way to get the private keys for these users. – Peteris Sep 08 '20 at 11:12