Skip to main content
added 384 characters in body
Source Link
Peteris
  • 1k
  • 7
  • 25

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)

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.

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)
Source Link
Peteris
  • 1k
  • 7
  • 25

Replaying Ethereum transactions, how could I extract the "from" account key from an existing transaction

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.