Basic_ethereum example not working on Ethereum mainnet

I made some changes to the basic_ethereum example (examples/rust/basic_ethereum/README.md at master · dfinity/examples · GitHub) and deployed it to the Ethereum mainnet using the following command:

dfx deploy --ic basic_ethereum_mainnet --argument '(opt record {ethereum_network = opt variant {Mainnet}; ecdsa_key_name = opt variant {ProductionKey1}})'

The canister deployed successfully, but methods like send_eth and others are running on the Sepolia testnet instead of the mainnet as specified during deployment. I also tried redeploying it using the following command, but the issue persists:

dfx deploy --ic basic_ethereum_mainnet --mode upgrade --argument '(opt record {ethereum_network = opt variant {Mainnet}; ecdsa_key_name = opt variant {ProductionKey1}})'

What should I do to test it on mainnet?

I think this could be the problem. In the canister interface there is only #[init] but no #[post_upgrade], meaning it is not possible to change these canister settings. If you redeploy (--mode reinstall) then the switch to mainnet should work

1 Like

Thank you for the solution, it solved the issue.

2 Likes