Skip to main content

Submitting transactions

Advanced
Ethereum
Tutorial

Overview

To submit transactions to the Ethereum network, first the transaction must be signed and formatted as an ETH transaction. Learn more about signing transactions.

Once you have your raw signed transaction, you can use the EVM RPC canister's RPC method eth_sendRawTransaction:

# Configuration
NETWORK=local
IDENTITY=default
CYCLES=1000000000
WALLET=$(dfx identity get-wallet)
RPC_SOURCE=EthMainnet
JSON_RPC_SOURCE=Chain=1
RPC_CONFIG=null

# Send a raw transaction
dfx canister call evm_rpc eth_sendRawTransaction "(variant {$SOURCE}, $RPC_CONFIG, \"0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83\")" --with-cycles=$CYCLES --wallet=$WALLET

Learn more about the EVM RPC canister.

Resources