1

i try to import fc-rpc on fronter. but got some error message

Compiling fc-rpc v2.0.0-dev (https://github.com/paritytech/frontier.git#9d4ccba8)
error[E0432]: unresolved import `sc_rpc::Metadata`
  --> /home/kula/.cargo/git/checkouts/frontier-b4643f17507d3282/9d4ccba/client/rpc/src/eth_pubsub.rs:38:5
   |
38 | use sc_rpc::Metadata;
   |     ^^^^^^^^^^^^^^^^ no `Metadata` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `fc-rpc` due to previous error
warning: build failed, waiting for other jobs to finish...

what's wrong with this?

my rust toolcain

[toolchain]
channel = "nightly"
components = [ "rustfmt", "clippy" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"
1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Jun 3, 2022 at 14:57

1 Answer 1

3

In a newer release of the sc-rpc, the Metadata struct was removed. Unfortunately, fc-rpc (Frontier's rpc pallet) is not yet compatible with this change.

The simplest fix right now is to run cargo update -p <the-imported-pallet> --precise 1e0807fb477b21edd373eb88778336d5ff23d3a7

This will set the pallet you are importing to use the commit 1e0807fb477b21edd373eb88778336d5ff23d3a7. This commit uses a compatible version of sc-rpc.

Unfortunately, adding rev = 1e0807fb477b21edd373eb88778336d5ff23d3a7 into your Cargo.toml will not work. Cargo has a bug right now that duplicates dependencies (with the exact same code, Cargo just does not recognize it).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.