Hello again! We just updated the EVM RPC canister to make it significantly easier to use custom EVM chains based directly on community feedback.
Here is an example command to get the latest block information on the Arbitrum L2 network:
dfx canister call evm_rpc eth_getBlockByNumber '(variant {Custom = record {chainId = 42161; services = vec {record {url = "https://1rpc.io/arb"}}}}, null, variant {Latest})' --with-cycles 10000000000 --wallet=$(dfx identity get-wallet)
Equivalent in Motoko:
let source = #Custom {
chainId = 42161;
services = [{ url = "https://1rpc.io/arb"; headers = null }];
};
Cycles.add(1000000000);
let result = await EvmRpc.eth_getBlockByNumber(source, null, #Latest);
A full list of chain ids and RPC services can be found on ChainList.org.
We appreciate your involvement during this beta testing phase and encourage you to reach out with any questions or requests here or on the GitHub repository.