-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parachain related parameters to chain-spec-builder
#4889
Add parachain related parameters to chain-spec-builder
#4889
Conversation
Generally we should start with this: #4873 Maybe having like a separate command to add this could be useful. I mean I'm not a 100% fan of it, but it will make it easier for the users. |
Yeah that makes sense. I can either include a fix for that issue in this PR (left a comment on how to potentially fix it here), or push another PR to address it |
If you like, you can push it directly here. |
@CrackTheCode016 tests are failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be keen to see this complete, so that we can proceed with w3f/polkadot-wiki#5928, but conversations needs resolving @CrackTheCode016.
If in doubt, I suggest doing sth backwards compatible for now.
Also, as for w3f/polkadot-wiki#5928, we can always edit the chain-spec files manually, and it is not super hard to add two fields two it, fwiw, so I'd say tutorials can proceed, and we make small updates to them later.
@kianenigma Yes, looking to do that tomorrow / early next week, had a few hiccups with being sick and some other tasks that needed prioritization, but will be on it asap. Most likely will just do this way, anything currently using |
For now, this is what I have done. Let me know if it is OK:
This tool could probably benefit from some more refactor for expansion later. Something that would be nice to see is a field-by-field edit feature, so you can edit some parameters from the CLI, which I imagine is not very difficult to do. Solo chain spec generation: chain-spec-builder create \
-v \
-r runtime.wasm \
patch patch.json Parachain spec generation: chain-spec-builder create \
-v \
--relay-chain polkadot \
--para-id 1000 \
-r runtime.wasm \
patch patch.json |
Your formatter seems to be at a different version than ours, which made the recent commits a bit hard to review. @alvicsam similar to the convo around the stable version used in CI tests, how should one find the exact nightly we use for FMT? I with that these values are stored somewhere that is intuitive to find :) (ref) |
@kianenigma Ah yes, apologies for this, I had been messing with some stuff in later versions. Please do let me know the version to use for nightly and I'll reformat for ease of readability |
Thank you @michalkucharczyk! From my side, I'd mainly like to see the discussed guideline of "it should feel like omni-bencher" fulfilled. AFAIK this is already done, so will be ready for a final review here :) |
I'd say this is ready for next round of reviews. I also fixed swallowing unknown fields, applied all the comments from previous reviews (hope I did not miss anything), and also added some testsuite for basic scenarios. |
chain-spec-builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good, only some nits.
Co-authored-by: Sebastian Kunert <[email protected]>
Co-authored-by: Sebastian Kunert <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
89b41c5
When using with
polkadot-parachain
, you usually need to specify therelay_chain
andpara_id
fields in the chain spec.With this PR it can be achieved by specifying newly added
--para-id
and--relay-chain
command line args, e.g:This was implemented by simple json blobs merging.
Additionally unit tests covering basic functionality were added.
Also adds a fix for not overwriting the chain spec with the default config each time, swallowing not standard fields is also fixed.
Fixes: #4873