Skip to content
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 support for polkadot-dev #1449

Closed
SBalaguer opened this issue Oct 24, 2023 · 8 comments
Closed

Add support for polkadot-dev #1449

SBalaguer opened this issue Oct 24, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@SBalaguer
Copy link

Is your feature request related to a problem? Please describe.

In the past when the runtime was part of the release, one could run a local version of Polkadot buy passing the flag --chain polkadot-dev. Now, however, the Polkadot Runtime is being released from the fellowship repositorty (https://github.com/polkadot-fellows/runtimes), and therefore the Substrate Node and the Polkadot Runtime are released from different places.

Describe the solution you'd like

Ideally I could run a local instance of Polkadot with Zombienet for testing purposes.

Describe alternatives you've considered

No response

Additional context

No response

@pepoviola
Copy link
Collaborator

related to paritytech/polkadot-sdk#1256, ping @michalkucharczyk there is a way to generate the spec currently in master? I saw that the pr add a new util to generate but I'm not sure if there is another way from the current master branch.

@pepoviola pepoviola self-assigned this Oct 24, 2023
@pepoviola pepoviola added the enhancement New feature or request label Oct 24, 2023
@michalkucharczyk
Copy link
Contributor

Bringing back chain-specs for kusama and polkadot is planned in: paritytech/polkadot-sdk#1984
As discussed, it can now partially be done with work provided in paritytech/polkadot-sdk#1256:

  • it is possible to get default config for the wasm blob,
  • it is possible to verify and build the raw chain spec from the plain chain spec,

Some internal structures of the chain spec (e.g. the layout of seession keys) needs to be temporarily hardcoded somewhere.

@SBalaguer
Copy link
Author

Thank you both for the answers!

I'm tagging @carlosala who works at @Zondax and needs this functionality to be able to test the new ledger app with the changes the new runtime will have.

With Referenda #297 being voted on Kusama, this is a bit time critical now.

For the moment, Carlo needs to be able to actually test the same runtime as Kusama locally with Zombienet. Two validator nodes would be more than enough in this case. Thanks! :))

@michalkucharczyk
Copy link
Contributor

there is also a tool, added by @bkchr , this may help:
polkadot-fellows/runtimes#78

@pepoviola
Copy link
Collaborator

pepoviola commented Oct 26, 2023

Hi @SBalaguer / @carlosala, as @michalkucharczyk shared you can use that branch to use the chain-spec-generator tool.
The steps to run a 2 validators (alice/bob) chain using kusama-local with zombienet are:

1 - Generate the raw chain spec, from this branch of the runtime repo with

./target/release/chain-spec-generator --raw kusama-local > kusama-local-raw.json

2- You can spawn the network using this network definition (in toml format)

[relaychain]
default_image = "docker.io/parity/polkadot:latest"
default_command = "/tmp/polkadot-sdk/target/release/polkadot"
default_args = [ "-lparachain=debug" ]

chain = "kusama-local"
chain_spec_path = "/tmp/kusama-local-raw.json"

  [[relaychain.nodes]]
  name = "alice"

  [[relaychain.nodes]]
  name = "bob"

Is you are using the native provider you need to modify the path to the polkadot binary and then you can run with

./zombienet -p native spawn <path to toml>

(Note: this command assume that you have downloaded the latest version of zombienet and you make it executable)

Ping me if you have questions.
Thx!

@pepoviola
Copy link
Collaborator

Closing here, this already landed in the latest version.
Thx!

@NachoPal NachoPal reopened this Nov 1, 2023
@NachoPal
Copy link

NachoPal commented Nov 1, 2023

I have to reopen this issue as it is not yet fully supported using runtimes from fellows/runtimes in Zombienet.

Right now it is only possible when using the chain_spec raw version, but that is limiting when used in a Zombienet config.toml file with Parachains. The problem is that only when a plain json chain_spec file is provided, Zombienet is able to edit the file to add the Parachains in the Relay Chain genesis. Otherwise it would be necessary to manually onboard them after startup. Similarly would happen when adding [[hrmp_channels]].

Something like a new default_chain_spec_raw_command attribute would be needed to tell what command to use to generate the raw version from the plain one provided in chain_spec_path.

@pepoviola
Copy link
Collaborator

As workaround until we get the new tool from paritytech/polkadot-sdk#1984, zombienet allow to use the chain-spec-generator from this branch as external tool to build the chain-spec (both plain/raw) only for the relaychain at the moment. To use this tool, you need to set the key chain_spec_command (at relaychain level) to something like this*:

chain_spec_command = "/tmp/chain-spec-generator {% raw %} {{chainName}} {% endraw %}"
  • assuming that you had compiled the chain-spec-generator and placed in /tmp

cc @SBalaguer / @NachoPal

Closing here, please re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants