0

I've upgraded the frontier-node-template to substrate polkadot-v0.9.38, I've fixed all issues in runtime, migrated my code as well. But since last few days, I'm stuck in converting service.rs file in node folder from aura to Babe. I'm new to Rust and substrate therefore, having problems in trait implementations, get lot's of trait bound errors using BabeLink.

I've referred to the substrate branches' available which implement Babe but those some how are not compatible with my frontier code.

Any help will be appreciated, I will share my service.rs file if required please?

1
  • during branch migration to polkadot-v0.9.38 which type of migration is required? Please summarize some points. Dec 27, 2023 at 7:16

1 Answer 1

0

This is not an easy question to answer for multiple reasons. My suggestion is to first go through the other multiple answers on here on how the aura -> babe transition goes. You're correct that this requires you to make changes to the import_queue and the block_import, in the service.rs file, make changes to the rpc.rs file to include BabeDeps and BabeRpcHandler like so :

    io.extend_with(sc_consensus_babe_rpc::BabeApi::to_delegate(BabeRpcHandler::new(
        client.clone(),
        shared_epoch_changes.clone(),
        keystore,
        babe_config,
        select_chain,
        deny_unsafe,
    )));
    io.extend_with(sc_finality_grandpa_rpc::GrandpaApi::to_delegate(GrandpaRpcHandler::new(
        shared_authority_set.clone(),
        shared_voter_state,
        justification_stream,
        subscription_executor,
        finality_provider,
    )));

besides having the necessary pallets in the runtime. Also you need to make the adjustments in the GenesisConfig struct in your chain_spec.rs.

To get a better feel for this, I would suggest migrating a vanilla substrate-node-template to use babe. This would give you enough experience to know what exact changes are needed to be made. Then you may do the same with the frontier template as it's almost exactly like the substrate-node-template except it has frontier integrated into it, and not such a straightforward directory structure as one you'd find on the node-template.

If you're still stuck after doing all this which is unlikely, then I just editing your question to include a repository link where someone might be able to take a look at what you're doing wrong. But I highly recommend trying to troubleshoot it yourself first.

3
  • Thank you for taking time to help me. You are right that it's a complete process not just amending one file. I've followed this link of substrate-node-template: github.com/paritytech/substrate/blob/master/bin/node/cli/src/… which has already implemented Babe. I've also managed to convert all, in service.rs also, there is tiny change, I think if an experienced rust developer sees the code, can fix it in minutes. I will follow your suggestion though. Thanks May 30, 2023 at 6:56
  • This is an update on my earlier issue, I was using the wrong trait bounds, after correction the Babe migration was successful. :) Jun 1, 2023 at 4:45
  • Great!!!!!!!!!!! Jun 1, 2023 at 7:58

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.