1

Regarding this tutorial "Connect a local parachain": https://docs.substrate.io/tutorials/connect-other-chains/local-parachain/, it requires

  • using GUI in a browser to do Parachain Registration...

How can I do all that in command line(CLI) only?

It will be much easier and quicker for me to write a bash script to run through the whole process.

Also I need to run this whole process in a Github CICD. Please advise.

2 Answers 2

2

Basically, I keep in mind that everything I do from frontend is just some calls to chain. Even the actual command might get complicated depending on abstraction of what we trying to do but you just have to figure our right method.

Being specific to your use case, please see

polkadot-launch's registerParachain method: https://github.com/paritytech/polkadot-launch/blob/951af7055e2c9abfa7a03ee7848548c1a3efdc16/src/rpc.ts#L38

This will help you to bring the process atleast to nodejs which can be then accessed from Ci/Cd. To convert it to actual raw bash/sh script, you might monitor the calls made while you do the process and replicate it. But I guess this will not gonna be worth to write in bash if you can have it on nodejs.

3
  • Thank you. How about reserving a ParaID? I serched on that Polkadot-launch repo and found nothing about that.
    – Russo
    Jul 22, 2022 at 4:11
  • 1
    reserving paraId should be done in relay chain side and not parachain. Procedure should be similar only you have to figure out which call to make from which section and which origin. Perhaps ask a new question, someone else might have actual answer? Jul 22, 2022 at 4:41
  • Hi Sudip, could you please have a look substrate.stackexchange.com/questions/3869/…
    – Russo
    Jul 22, 2022 at 5:00
0

Zombienet uses an RPC endpoint internally to issue a transaction to register the parachain using sudo iirc

Then use Zombienet to run custom Js script: https://github.com/paritytech/zombienet/blob/main/docs/src/test-dsl-definition-spec.md :

Custom js scripts: Allow to run a defined script and assert on the completeness or return value.

    node-name: js-script script_relative_path [ return is comparator target_value] [within x seconds]
        alice: js-script ./0008-custom.js return is greater than 1 within 200 seconds

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.