2

When I build polkadot with cargo build --release it builds all the runtimes including Polkadot, Kusama, Rococo, Westend. This is a lot to compile and most of it is not needed.

In my case, I'm testing a parachain locally, so I only need the rococo runtime. I remember there is a way to compile only that runtime, and I even see the rococo-native feature in sc-cli but I can't remember how to build the node with only that runtime.

2 Answers 2

2

You can compile the rococo-runtime package and its dependencies with cargo build --release -p rococo-runtime. On master this compiles 638 packages instead of the full 1819, and is a flag that you can use for any individual package in the workspace to save time in the future.

From cargo build --help:

-p, --package [<SPEC>]  Package to build (see `cargo help pkgid`)

You can find the full list of the workspace members in Cargo.toml in the root of the repo, and their respective package names in the corresponding Cargo.toml in the directory of the package.

1

I don't think you can do that with the latest code.

It's a feautre of its dependency.

https://github.com/paritytech/polkadot-sdk/blob/76994356fcaeda77a5c21958ef4e2597e1c74b05/polkadot/Cargo.toml#L29

You can modify the code to remove the westend-native then cargo build --release -p polkadot.

Your Answer

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

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