Use para id in specs instead of flag#157
Conversation
|
@shawntabrizi ready for review |
bkchr
left a comment
There was a problem hiding this comment.
Imo we should entirely remove the paraid from here. Some projects may still support the cli argument or whatever. However, I'm also planing to remove the Para id by default from the chain spec.
@bkchr So how does one determine their parachain id? |
|
You hard code it in the runtime for example. |
| args.push("--parachain-id=" + id); | ||
| } | ||
| if (chain) { | ||
| args.push("--chain=" + chain); |
There was a problem hiding this comment.
Why do we need to remove chain selection from the parachain parameters? It will cause issues when you export the genesis state.
There was a problem hiding this comment.
According to a comment, it was't supported by cumulus anymore
There was a problem hiding this comment.
I think this was a misunderstanding. The only thing that got removed was the parachain-id paritytech/cumulus#739
No need to remove the option to select a chain. It is very needed, in polkadot-collator we have several chains, the same stands for the polkadot binary.
There was a problem hiding this comment.
Indeed. How was this resolved, perhaps I'm missing something @joelamouche ?
There was a problem hiding this comment.
@ghzlatarev I left the --chain command. So if you specify the chain in the chain field of the parachain in hte config, it should work
There was a problem hiding this comment.
@joelamouche I don't see it in startCollator or exportGenesisWasm , is it not needed there ?
Right now if I start a westmint-local network I get some default Local Testnet
There was a problem hiding this comment.
There was a problem hiding this comment.
You're right Im adding it back
@bkchr but what if I want to run the same runtime on 2 different ids? |
This is completely up to the parachain developer. Aka if you want to support two different parachain ids, I see no reason why that should not be doable. However, the official code doesn't need to provide this, because it only confuses people. |
|
OK that seems a pretty big refactor to let's leave it to a follow up PR @bkchr ? |
src/runner.ts
Outdated
| const { id, resolvedId, balance } = parachain; | ||
|
|
||
| if (resolvedId) { | ||
| await changeGenesisConfig(`${chain}.json`, {}); |
There was a problem hiding this comment.
why are you passing an empty object to changeGenesisConfig?
There was a problem hiding this comment.
Oh yeah I forgot to remove that :s
|
@joelamouche seems the code is just wrong in the case of a |
| bin: BINARY_PATH, | ||
| id: (1000 * (i + 1)).toString(), | ||
| balance: "1000000000000000000000", | ||
| // chain: options.chain, this is not supported by cumulus |
There was a problem hiding this comment.
@riusricardo this is the comment I was referring to. I'm going to put it back though, for collators that do need it
|
@shawntabrizi ready for review |
|
hmmm.. didn't aware you guys are working on this... I am working on #160 |
|
the config.json has a |
tackles #151 #156