1
votes

I've implementen the treasury, session collective and staking pallets myself. why doesn't my node produce blocks? https://github.com/noahsalvadordenjo/unprod.git

1
Thanks for providing a link to your repo, Noah! Feel free to tag me on GitHub or ping me on Riot with links to such things. Here's an example of what a good Stack Overflow question looks like stackoverflow.com/questions/62601759/…. - Dan Forbes
You may want to look into how you've configured your chain spec, specifically, the values you've set for the staking module's validator count and minimum validator count values. I am not at all familiar with the staking module, really, but I think this may be your problem. github.com/noahsalvadordenjo/unprod/blob/new_branch/node/src/… - Dan Forbes

1 Answers

2
votes

It will not be enough to simply add Staking, Elections, Session, etc to the Node Template Runtime and have a NPoS system working.

Unfortunately the Substrate Node Template uses AURA, which is a Proof of Authority consensus algorithm, that is defined here:

https://github.com/noahsalvadordenjo/unprod/blob/new_branch/node/src/service.rs

And matching runtime components which are defined in the runtime.

If you want to start with a NPoS node, I recommend starting with the base substrate node here:

https://github.com/paritytech/substrate/tree/master/bin/node

And then remove from it any optional pallets you may not be using. Otherwise, maybe you can learn from it how to implement BABE consensus instead of AURA, but this is a little bit out of scope for a new Substrate developer.