1

I was following these tutorial: start a local relay chain and connect a local parachain. Everything went fine.

Then next I tried to run another collator ( let's call this custom-parachain) binary instead of parachain-collator ( both are based on polkadot v0.9.24)

I created a raw-spec file with correct paraId and tried to run custom-collator the same way I ran parachain-collator. But custom-collator is NOT acting as collator.

While I do all this: I left ./polkadot --alice --validator and ./polkadot --bob --validator running in seperate terminal

Only reason I could this why it is not working as expected is that there is some relation between chain spec used to run validator ( here ) and spec generated by parachain-collator.

But when I use custom-collator with it's generated raw spec, it's not acting as validator. When running parachain-collator I could see logs like:

2022-07-0720:46:18 [Relaychain] 🥩 New Rounds for validator set id: 2 with session_start 21    
2022-07-07 0:46:18 [Relaychain] 🥩 New Rounds for validator set id: 3 with session_start 31    
2022-07-07 20:46:18 [Relaychain] 🥩 New Rounds for validator set id: 4 with session_start 41

But running custom-parachain logs are:

2022-07-07 0:48:09 💤 Idle (1 peers), best: #174 (0x8601…c0ec), finalized #161 (0xf1c3…087f), ⬇ 35.2kiB/s ⬆ 2.4kiB/s    
2022-07-07 0:48:09 💤 Idle (0 peers), best: #0 (0x98d0…0f65), finalized #0 (0x98d0…0f65), ⬇ 1.3kiB/s ⬆ 1.1kiB/s    
2022-07-07 0:48:14 💤 Idle (1 peers), best: #174 (0x8601…c0ec), finalized #170 (0x68a7…d58a), ⬇ 1.3kiB/s ⬆ 0.7kiB/s    
2022-07-07 0:48:14 💤 Idle (0 peers), best: #0 (0x98d0…0f65), finalized #0 (0x98d0…0f65), ⬇ 0.1kiB/s ⬆ 0.1kiB/s    

2
  • can you share the command your are using to run the collators ? Commented Jul 19, 2022 at 15:13
  • Something like: ./collator --collator --alice --ws-port _ --port _ --chain _ -- --execution wasm --chain _ Commented Jul 20, 2022 at 3:23

1 Answer 1

2

I think first of all you have to understand the difference between collators and validators. Here is the Collator and Validators definitions on the Polkadot Wiki.

In a few words, the nodes which are configured to produce blocks in the relay chain are validators, and for parachains these are collators. Collators are similar to validators on any other blockchain but they do not need to provide security guarantees because Polkadot provides those. If a parachain block is invalid, it will get rejected by validators.

For more information read this interesting StackExchange question that explores it more in depth: What node types run in the relay chain vs. parachain?

Regards to the spec, every Substrate-based chain requires a chain specification. The chain specification for the relay chain network provides the same types of configuration settings that the chain specification does for other networks. In the tutorial you mention you can see How to prepare a local relay chain spec and How to prepare the spec for a parachain.

About your error of how to add a new Collator after running your environment take a look into How to add new collators on a running parachain?

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.