Closed Aideepakchaudhary closed 2 months ago
Hey hey,
You can't use the PolkadotConfig because frontier/ethereum is using a different AccountId.
Have a look at this example: https://gist.github.com/jsdw/13240f9341e433ea639b89d0d4235c8b#file-main-rs and replace your PolkadotConfig with EthConfig then it should work
You can use the AccountId20 from the ethereum signer in subxt IIRC.
@niklasad1 thank you for the help. But If i change the PolkadotConfig with EthConfig in the current code, then it is showing this error:
no EthConfig in the root
But I'm following the provided code: https://gist.github.com/jsdw/13240f9341e433ea639b89d0d4235c8b#file-main-rs. then I'm getting this issue:
balthasar pub: 043bc19e36ff1673910575b6727a974a9abd80c9a875d41ab3e2648dbfb9e4b518b483f1a67e492be9c1aa4d524d30888f79ec72ebcfc953c55c4b43ff82c9659d
balthasar addr: 3cd0a705a2dc65e5b1e1205896baa2be8a07c6e0
Error: Rpc error: RPC error: ErrorObject { code: ServerError(-32000), message: "Client error: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\nerror while executing at wasm backtrace:\n 0: 0x706c6b - <unknown>!rust_begin_unwind\n 1: 0x975c - <unknown>!core::panicking::panic_fmt::h578d45979beca5ff\n 2: 0x29e104 - <unknown>!AccountNonceApi_account_nonce", data: None }
Caused by:
RPC error: ErrorObject { code: ServerError(-32000), message: "Client error: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\nerror while executing at wasm backtrace:\n 0: 0x706c6b - <unknown>!rust_begin_unwind\n 1: 0x975c - <unknown>!core::panicking::panic_fmt::h578d45979beca5ff\n 2: 0x29e104 - <unknown>!AccountNonceApi_account_nonce", data: None }
Hey @Aideepakchaudhary again
I have created an example for this and I have tested it against https://github.com/polkadot-evm/frontier/commit/f7dc0ace3706ced905e1c754c5bd4ad8267b6c9b
It works for me and my hunch is that you are using an old frontier node without the proper runtime APIs available.
We have added an example to our repo for ethereum/frontier and closing this.
Feel free to re-open if you still have issues with it.
I'm trying to transfer some balance on frontier-node-template through subxt. but getting this issue:
This is my main.rs:
How to fix this?