36
36
- ⏫ This template provides a starting point to build a [ parachain] ( https://wiki.polkadot.network/docs/learn-parachains ) .
37
37
38
38
- ☁️ It is based on the
39
- [ Cumulus] ( https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/cumulus/index.html ) framework.
39
+ [ Cumulus] ( https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/cumulus/index.html ) framework.
40
40
41
41
- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
42
- such as a [ Balances pallet] ( https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html ) .
42
+ such as a [ Balances pallet] ( https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html ) .
43
43
44
44
- 👉 Learn more about parachains [ here] ( https://wiki.polkadot.network/docs/learn-parachains )
45
45
@@ -50,18 +50,18 @@ A Polkadot SDK based project such as this one consists of:
50
50
- 🧮 the [ Runtime] ( ./runtime/README.md ) - the core logic of the parachain.
51
51
- 🎨 the [ Pallets] ( ./pallets/README.md ) - from which the runtime is constructed.
52
52
- 💿 a [ Node] ( ./node/README.md ) - the binary application, not part of the project default-members list and not compiled unless
53
- building the project with ` --workspace ` flag, which builds all workspace members, and is an alternative to
54
- [ Omni Node] ( https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html ) .
53
+ building the project with ` --workspace ` flag, which builds all workspace members, and is an alternative to
54
+ [ Omni Node] ( https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html ) .
55
55
56
56
## Getting Started
57
57
58
58
- 🦀 The template is using the Rust language.
59
59
60
60
- 👉 Check the
61
- [ Rust installation instructions] ( https://www.rust-lang.org/tools/install ) for your system.
61
+ [ Rust installation instructions] ( https://www.rust-lang.org/tools/install ) for your system.
62
62
63
63
- 🛠️ Depending on your operating system and Rust version, there might be additional
64
- packages required to compile this template - please take note of the Rust compiler output.
64
+ packages required to compile this template - please take note of the Rust compiler output.
65
65
66
66
Fetch parachain template code:
67
67
@@ -73,6 +73,14 @@ cd parachain-template
73
73
74
74
## Starting a Development Chain
75
75
76
+ The parachain template relies on a hardcoded parachain id which is defined in the runtime code
77
+ and referenced throughout the contents of this file as ` {{PARACHAIN_ID}} ` . Please replace
78
+ any command or file referencing this placeholder with the value of the ` PARACHAIN_ID ` constant:
79
+
80
+ ``` rust,ignore
81
+ pub const PARACHAIN_ID: u32 = 1000;
82
+ ```
83
+
76
84
### Omni Node Prerequisites
77
85
78
86
[ Omni Node] ( https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html ) can
@@ -86,7 +94,7 @@ Please see the installation section at [`crates.io/omni-node`](https://crates.io
86
94
#### Build ` parachain-template-runtime `
87
95
88
96
``` sh
89
- cargo build --release
97
+ cargo build --profile production
90
98
```
91
99
92
100
#### Install ` staging-chain-spec-builder `
@@ -96,12 +104,12 @@ Please see the installation section at [`crates.io/staging-chain-spec-builder`](
96
104
#### Use ` chain-spec-builder ` to generate the ` chain_spec.json ` file
97
105
98
106
``` sh
99
- chain-spec-builder create --relay-chain " rococo-local" --para-id 1000 --runtime \
107
+ chain-spec-builder create --relay-chain " rococo-local" --para-id {{PARACHAIN_ID}} --runtime \
100
108
target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development
101
109
```
102
110
103
111
** Note** : the ` relay-chain ` and ` para-id ` flags are mandatory information required by
104
- Omni Node, and for parachain template case the value for ` para-id ` must be set to ` 1000 ` , since this
112
+ Omni Node, and for parachain template case the value for ` para-id ` must be set to ` {{PARACHAIN_ID}} ` , since this
105
113
is also the value injected through [ ParachainInfo] ( https://docs.rs/staging-parachain-info/0.17.0/staging_parachain_info/ )
106
114
pallet into the ` parachain-template-runtime ` 's storage. The ` relay-chain ` value is set in accordance
107
115
with the relay chain ID where this instantiation of parachain-template will connect to.
@@ -138,10 +146,17 @@ export PATH="$PATH:<path/to/binaries>"
138
146
139
147
#### Update ` zombienet-omni-node.toml ` with a valid chain spec path
140
148
149
+ To simplify the process of using the parachain-template with zombienet and Omni Node, we've added a pre-configured
150
+ development chain spec (dev_chain_spec.json) to the parachain template. The zombienet-omni-node.toml file of this
151
+ template points to it, but you can update it to an updated chain spec generated on your machine. To generate a
152
+ chain spec refer to [ staging-chain-spec-builder] ( https://crates.io/crates/staging-chain-spec-builder )
153
+
154
+ Then make the changes in the network specification like so:
155
+
141
156
``` toml
142
157
# ...
143
158
[[parachains ]]
144
- id = 1000
159
+ id = " <PARACHAIN_ID> "
145
160
chain_spec_path = " <TO BE UPDATED WITH A VALID PATH>"
146
161
# ...
147
162
```
@@ -177,15 +192,15 @@ zombienet --provider native spawn zombienet.toml
177
192
### Connect with the Polkadot-JS Apps Front-End
178
193
179
194
- 🌐 You can interact with your local node using the
180
- hosted version of the Polkadot/Substrate Portal:
181
- [ relay chain] ( https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944 )
182
- and [ parachain] ( https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9988 ) .
195
+ hosted version of the Polkadot/Substrate Portal:
196
+ [ relay chain] ( https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944 )
197
+ and [ parachain] ( https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9988 ) .
183
198
184
199
- 🪐 A hosted version is also
185
- available on [ IPFS] ( https://dotapps.io/ ) .
200
+ available on [ IPFS] ( https://dotapps.io/ ) .
186
201
187
202
- 🧑🔧 You can also find the source code and instructions for hosting your own instance in the
188
- [ ` polkadot-js/apps ` ] ( https://github.com/polkadot-js/apps ) repository.
203
+ [ ` polkadot-js/apps ` ] ( https://github.com/polkadot-js/apps ) repository.
189
204
190
205
### Takeaways
191
206
@@ -211,7 +226,7 @@ Build the `parachain-template-runtime` as mentioned before in this guide and use
211
226
again but this time by passing ` --raw-storage ` flag:
212
227
213
228
``` sh
214
- chain-spec-builder create --raw-storage --relay-chain " rococo-local" --para-id 1000 --runtime \
229
+ chain-spec-builder create --raw-storage --relay-chain " rococo-local" --para-id {{PARACHAIN_ID}} --runtime \
215
230
target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development
216
231
```
217
232
@@ -234,15 +249,17 @@ relay chain network (see [Parachain Template node](#parachain-template-node) set
234
249
- ➡️ Any pull requests should be directed to this [ source] ( https://github.com/paritytech/polkadot-sdk/tree/master/templates/parachain ) .
235
250
236
251
- 😇 Please refer to the monorepo's
237
- [ contribution guidelines] ( https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md ) and
238
- [ Code of Conduct] ( https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md ) .
252
+ [ contribution guidelines] ( https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md ) and
253
+ [ Code of Conduct] ( https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md ) .
239
254
240
255
## Getting Help
241
256
242
- - 🧑🏫 To learn about Polkadot in general, [ Polkadot.network ] ( https://polkadot.network / ) website is a good starting point.
257
+ - 🧑🏫 To learn about Polkadot in general, [ docs. Polkadot.com ] ( https://docs. polkadot.com / ) website is a good starting point.
243
258
244
259
- 🧑🔧 For technical introduction, [ here] ( https://github.com/paritytech/polkadot-sdk#-documentation ) are
245
- the Polkadot SDK documentation resources.
260
+ the Polkadot SDK documentation resources.
246
261
247
262
- 👥 Additionally, there are [ GitHub issues] ( https://github.com/paritytech/polkadot-sdk/issues ) and
248
- [ Substrate StackExchange] ( https://substrate.stackexchange.com/ ) .
263
+ [ Substrate StackExchange] ( https://substrate.stackexchange.com/ ) .
264
+ - 👥You can also reach out on the [ Official Polkdot discord server] ( https://polkadot-discord.w3f.tools/ )
265
+ - 🧑Reach out on [ Telegram] ( https://t.me/substratedevs ) for more questions and discussions
0 commit comments