|
27 | 27 | - [Connect with the Polkadot-JS Apps Front-End](#connect-with-the-polkadot-js-apps-front-end) |
28 | 28 | - [Takeaways](#takeaways) |
29 | 29 |
|
| 30 | +- [Runtime development](#runtime-development) |
30 | 31 | - [Contributing](#contributing) |
31 | 32 | - [Getting Help](#getting-help) |
32 | 33 |
|
@@ -107,13 +108,11 @@ with the relay chain ID where this instantiation of parachain-template will conn |
107 | 108 |
|
108 | 109 | #### Run Omni Node |
109 | 110 |
|
110 | | -Start Omni Node with the generated chain spec. We'll start it development mode (without a relay chain config), |
111 | | -with a temporary directory for configuration (given `--tmp`), and block production set to create a block with |
112 | | -every second. |
| 111 | +Start Omni Node with the generated chain spec. We'll start it in development mode (without a relay chain config), producing |
| 112 | +and finalizing blocks based on manual seal, configured below to seal a block with each second. |
113 | 113 |
|
114 | 114 | ```bash |
115 | | -polkadot-omni-node --chain <path/to/chain_spec.json> --tmp --dev-block-time 1000 |
116 | | - |
| 115 | +polkadot-omni-node --chain <path/to/chain_spec.json> --dev --dev-block-time 1000 |
117 | 116 | ``` |
118 | 117 |
|
119 | 118 | However, such a setup is not close to what would run in production, and for that we need to setup a local |
@@ -197,6 +196,37 @@ Development parachains: |
197 | 196 | - 💰 Are preconfigured with a genesis state that includes several prefunded development accounts. |
198 | 197 | - 🧑⚖️ Development accounts are used as validators, collators, and `sudo` accounts. |
199 | 198 |
|
| 199 | +## Runtime development |
| 200 | + |
| 201 | +We recommend using [`chopsticks`](https://github.com/AcalaNetwork/chopsticks) when the focus is more on the runtime |
| 202 | +development and `OmniNode` is enough as is. |
| 203 | + |
| 204 | +### Install chopsticks |
| 205 | + |
| 206 | +To use `chopsticks`, please install the latest version according to the installation [guide](https://github.com/AcalaNetwork/chopsticks?tab=readme-ov-file#install). |
| 207 | + |
| 208 | +### Build a raw chain spec |
| 209 | + |
| 210 | +Build the `parachain-template-runtime` as mentioned before in this guide and use `chain-spec-builder` |
| 211 | +again but this time by passing `--raw-storage` flag: |
| 212 | + |
| 213 | +```sh |
| 214 | +chain-spec-builder create --raw-storage --relay-chain "rococo-local" --para-id 1000 --runtime \ |
| 215 | + target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development |
| 216 | +``` |
| 217 | + |
| 218 | +### Start `chopsticks` with the chain spec |
| 219 | + |
| 220 | +```sh |
| 221 | +npx @acala-network/chopsticks@latest --chain-spec <path/to/chain_spec.json> |
| 222 | +``` |
| 223 | + |
| 224 | +### Alternatives |
| 225 | + |
| 226 | +`OmniNode` can be still used for runtime development if using the `--dev` flag, while `parachain-template-node` doesn't |
| 227 | +support it at this moment. It can still be used to test a runtime in a full setup where it is started alongside a |
| 228 | +relay chain network (see [Parachain Template node](#parachain-template-node) setup). |
| 229 | + |
200 | 230 | ## Contributing |
201 | 231 |
|
202 | 232 | - 🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). |
|
0 commit comments