diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/localParachainTx.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/localParachainTx.ts
index a2a6453b6..efe7976cf 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/localParachainTx.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/localParachainTx.ts
@@ -1,25 +1,25 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://wss.api.moonbeam.network"
+ 'wss://wss.api.moonbeam.network',
);
const assetApi = new AssetTransferApi(api, specName, safeXcmVersion);
let callInfo;
try {
callInfo = await assetApi.createTransferTransaction(
- "2004",
- "0xF977814e90dA44bFA03b6295A0616a897441aceC",
+ '2004',
+ '0xF977814e90dA44bFA03b6295A0616a897441aceC',
[],
- ["1000000000000000000"],
+ ['1000000000000000000'],
{
- format: "call",
+ format: 'call',
keepAlive: true,
- }
+ },
);
console.log(`Call data:\n${JSON.stringify(callInfo, null, 4)}`);
@@ -28,7 +28,7 @@ async function main() {
throw Error(e as string);
}
- const decoded = assetApi.decodeExtrinsic(callInfo.tx, "call");
+ const decoded = assetApi.decodeExtrinsic(callInfo.tx, 'call');
console.log(`\nDecoded tx:\n${JSON.stringify(JSON.parse(decoded), null, 4)}`);
}
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/paraToPara.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/paraToPara.ts
index c5dbd7809..6e1919650 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/paraToPara.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/paraToPara.ts
@@ -1,24 +1,24 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://moonriver.public.blastapi.io"
+ 'wss://moonriver.public.blastapi.io',
);
const assetApi = new AssetTransferApi(api, specName, safeXcmVersion);
let callInfo;
try {
callInfo = await assetApi.createTransferTransaction(
- "2001",
- "0xc4db7bcb733e117c0b34ac96354b10d47e84a006b9e7e66a229d174e8ff2a063",
- ["vMOVR", "72145018963825376852137222787619937732"],
- ["1000000", "10000000000"],
+ '2001',
+ '0xc4db7bcb733e117c0b34ac96354b10d47e84a006b9e7e66a229d174e8ff2a063',
+ ['vMOVR', '72145018963825376852137222787619937732'],
+ ['1000000', '10000000000'],
{
- format: "call",
+ format: 'call',
xcmVersion: safeXcmVersion,
- }
+ },
);
console.log(`Call data:\n${JSON.stringify(callInfo, null, 4)}`);
@@ -27,7 +27,7 @@ async function main() {
throw Error(e as string);
}
- const decoded = assetApi.decodeExtrinsic(callInfo.tx, "call");
+ const decoded = assetApi.decodeExtrinsic(callInfo.tx, 'call');
console.log(`\nDecoded tx:\n${JSON.stringify(JSON.parse(decoded), null, 4)}`);
}
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/relayToSystem.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/relayToSystem.ts
index ead3c4be5..75ae4b5a7 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/relayToSystem.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/relayToSystem.ts
@@ -1,24 +1,24 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://westend-rpc.polkadot.io"
+ 'wss://westend-rpc.polkadot.io',
);
const assetApi = new AssetTransferApi(api, specName, safeXcmVersion);
let callInfo;
try {
callInfo = await assetApi.createTransferTransaction(
- "1000",
- "5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX",
- ["WND"],
- ["1000000000000"],
+ '1000',
+ '5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX',
+ ['WND'],
+ ['1000000000000'],
{
- format: "call",
+ format: 'call',
xcmVersion: safeXcmVersion,
- }
+ },
);
console.log(`Call data:\n${JSON.stringify(callInfo, null, 4)}`);
@@ -27,7 +27,7 @@ async function main() {
throw Error(e as string);
}
- const decoded = assetApi.decodeExtrinsic(callInfo.tx, "call");
+ const decoded = assetApi.decodeExtrinsic(callInfo.tx, 'call');
console.log(`\nDecoded tx:\n${JSON.stringify(JSON.parse(decoded), null, 4)}`);
}
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/setup.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/setup.ts
index 24f32ef24..7a95e5b07 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/setup.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/overview/setup.ts
@@ -1,11 +1,11 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "INSERT_WEBSOCKET_URL"
+ 'INSERT_WEBSOCKET_URL',
);
const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ca-example-request.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ca-example-request.ts
index d35427a2d..bb9bf4695 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ca-example-request.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ca-example-request.ts
@@ -1,11 +1,11 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://westend-rpc.polkadot.io"
+ 'wss://westend-rpc.polkadot.io',
);
const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);
@@ -15,12 +15,12 @@ async function main() {
[
`{"parents":"0","interior":{"X2":[{"PalletInstance":"50"},{"GeneralIndex":"1984"}]}}`,
],
- ["1000000000000"],
- "0xf5d5714c084c112843aca74f8c498da06cc5a2d63153b825189baa51043b1f0b",
+ ['1000000000000'],
+ '0xf5d5714c084c112843aca74f8c498da06cc5a2d63153b825189baa51043b1f0b',
{
- format: "call",
+ format: 'call',
xcmVersion: 2,
- }
+ },
);
console.log(`Call data:\n${JSON.stringify(callInfo, null, 4)}`);
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ctt-example-request.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ctt-example-request.ts
index 4cfca7993..93c6bbb4c 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ctt-example-request.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ctt-example-request.ts
@@ -1,25 +1,25 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://wss.api.moonbeam.network"
+ 'wss://wss.api.moonbeam.network',
);
const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);
let callInfo;
try {
callInfo = await assetsApi.createTransferTransaction(
- "2004",
- "0xF977814e90dA44bFA03b6295A0616a897441aceC",
+ '2004',
+ '0xF977814e90dA44bFA03b6295A0616a897441aceC',
[],
- ["1000000000000000000"],
+ ['1000000000000000000'],
{
- format: "call",
+ format: 'call',
keepAlive: true,
- }
+ },
);
console.log(`Call data:\n${JSON.stringify(callInfo, null, 4)}`);
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/de-example-request.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/de-example-request.ts
index 903714021..f9c7a679b 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/de-example-request.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/de-example-request.ts
@@ -1,20 +1,20 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://wss.api.moonbeam.network"
+ 'wss://wss.api.moonbeam.network',
);
const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);
- const encodedExt = "0x0a03f977814e90da44bfa03b6295a0616a897441acec821a0600";
+ const encodedExt = '0x0a03f977814e90da44bfa03b6295a0616a897441acec821a0600';
try {
- const decodedExt = assetsApi.decodeExtrinsic(encodedExt, "call");
+ const decodedExt = assetsApi.decodeExtrinsic(encodedExt, 'call');
console.log(
- `Decoded tx:\n ${JSON.stringify(JSON.parse(decodedExt), null, 4)}`
+ `Decoded tx:\n ${JSON.stringify(JSON.parse(decodedExt), null, 4)}`,
);
} catch (e) {
console.error(e);
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ffi-example-request.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ffi-example-request.ts
index 6fc39c42e..3067907eb 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ffi-example-request.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/ffi-example-request.ts
@@ -1,18 +1,18 @@
import {
AssetTransferApi,
constructApiPromise,
-} from "@substrate/asset-transfer-api";
+} from '@substrate/asset-transfer-api';
async function main() {
const { api, specName, safeXcmVersion } = await constructApiPromise(
- "wss://wss.api.moonbeam.network"
+ 'wss://wss.api.moonbeam.network',
);
const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);
- const encodedExt = "0x0a03f977814e90da44bfa03b6295a0616a897441acec821a0600";
+ const encodedExt = '0x0a03f977814e90da44bfa03b6295a0616a897441acec821a0600';
try {
- const decodedExt = await assetsApi.fetchFeeInfo(encodedExt, "call");
+ const decodedExt = await assetsApi.fetchFeeInfo(encodedExt, 'call');
console.log(`Fee info:\n${JSON.stringify(decodedExt, null, 4)}`);
} catch (e) {
console.error(e);
@@ -22,4 +22,4 @@ async function main() {
main()
.catch((err) => console.error(err))
- .finally(() => process.exit());
\ No newline at end of file
+ .finally(() => process.exit());
diff --git a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/format.ts b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/format.ts
index 7e20a0012..9fe23a678 100644
--- a/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/format.ts
+++ b/.snippets/code/develop/application-devs/tooling/asset-transfer-api/reference/format.ts
@@ -1 +1 @@
-export type Format = "payload" | "call" | "submittable";
+export type Format = 'payload' | 'call' | 'submittable';
diff --git a/.snippets/code/develop/parachain-devs/interoperability/hrmp-channels/hrmp-query-output.json b/.snippets/code/develop/parachain-devs/interoperability/hrmp-channels/hrmp-query-output.json
index 8165c394f..3c8189e6f 100644
--- a/.snippets/code/develop/parachain-devs/interoperability/hrmp-channels/hrmp-query-output.json
+++ b/.snippets/code/develop/parachain-devs/interoperability/hrmp-channels/hrmp-query-output.json
@@ -1,38 +1,38 @@
[
- [
[
- {
- "sender": 1000,
- "recipient": 2500
- }
+ [
+ {
+ "sender": 1000,
+ "recipient": 2500
+ }
+ ],
+ {
+ "maxCapacity": 8,
+ "maxTotalSize": 8192,
+ "maxMessageSize": 1048576,
+ "msgCount": 0,
+ "totalSize": 0,
+ "mqcHead": null,
+ "senderDeposit": 0,
+ "recipientDeposit": 0
+ }
],
- {
- "maxCapacity": 8,
- "maxTotalSize": 8192,
- "maxMessageSize": 1048576,
- "msgCount": 0,
- "totalSize": 0,
- "mqcHead": null,
- "senderDeposit": 0,
- "recipientDeposit": 0
- }
- ],
- [
[
- {
- "sender": 2500,
- "recipient": 1000
- }
- ],
- {
- "maxCapacity": 8,
- "maxTotalSize": 8192,
- "maxMessageSize": 1048576,
- "msgCount": 0,
- "totalSize": 0,
- "mqcHead": null,
- "senderDeposit": 0,
- "recipientDeposit": 0
- }
- ]
+ [
+ {
+ "sender": 2500,
+ "recipient": 1000
+ }
+ ],
+ {
+ "maxCapacity": 8,
+ "maxTotalSize": 8192,
+ "maxMessageSize": 1048576,
+ "msgCount": 0,
+ "totalSize": 0,
+ "mqcHead": null,
+ "senderDeposit": 0,
+ "recipientDeposit": 0
+ }
+ ]
]
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json
new file mode 100644
index 000000000..b6ff2c407
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json
@@ -0,0 +1,25 @@
+{
+ "...": "...",
+ "relay_chain": "paseo",
+ "para_id": 4508,
+ "genesis": {
+ "runtime": {
+ "...": {},
+ "parachainInfo": {
+ "parachainId": 4508
+ },
+ "session": {
+ "keys": [
+ [
+ "5HErbKmL5JmUKDVsH1aGyXTGZb4i9iaNsFhSgkNDr8qp2Dvj",
+ "5HErbKmL5JmUKDVsH1aGyXTGZb4i9iaNsFhSgkNDr8qp2Dvj",
+ {
+ "aura": "5HErbKmL5JmUKDVsH1aGyXTGZb4i9iaNsFhSgkNDr8qp2Dvj"
+ }
+ ]
+ ]
+ }
+ },
+ "...": {}
+ }
+}
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/raw-chain-spec-terminal.md b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-2.html
similarity index 56%
rename from .snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/raw-chain-spec-terminal.md
rename to .snippets/code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-2.html
index d5aecbdec..19e9bba40 100644
--- a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/raw-chain-spec-terminal.md
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-2.html
@@ -1,7 +1,7 @@
./target/release/parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json
- 2024-09-10 14:34:58 Building chain spec
- 2024-09-10 14:34:59 assembling new collators for new session 0 at #0
- 2024-09-10 14:34:59 assembling new collators for new session 1 at #0
-
-
\ No newline at end of file
+
+ 2024-09-11 09:48:15 Building chain spec
+ 2024-09-11 09:48:15 assembling new collators for new session 0 at #0
+ 2024-09-11 09:48:15 assembling new collators for new session 1 at #0
+
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-1.rs b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-1.rs
new file mode 100644
index 000000000..6c0468616
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-1.rs
@@ -0,0 +1,13 @@
+parameter_types! {
+ pub const ParaDeposit: Balance = 40 * UNITS;
+}
+
+impl paras_registrar::Config for Runtime {
+ type RuntimeOrigin = RuntimeOrigin;
+ type RuntimeEvent = RuntimeEvent;
+ type Currency = Balances;
+ type OnSwap = (Crowdloan, Slots);
+ type ParaDeposit = ParaDeposit;
+ type DataDepositPerByte = DataDepositPerByte;
+ type WeightInfo = weights::runtime_common_paras_registrar::WeightInfo;
+}
\ No newline at end of file
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json
new file mode 100644
index 000000000..b0ac0211a
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json
@@ -0,0 +1,15 @@
+{
+ "...": "...",
+ "relay_chain": "rococo-local",
+ "para_id": 2000,
+ "protocolId": "template-local",
+ "genesis": {
+ "runtime": {
+ "...": {},
+ "parachainInfo": {
+ "parachainId": 2000
+ }
+ },
+ "...": {}
+ }
+}
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-3.html b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-3.html
new file mode 100644
index 000000000..f58a0792a
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-3.html
@@ -0,0 +1,5 @@
+
+ 2024-09-10 14:34:58 Building chain spec
+ 2024-09-10 14:34:59 assembling new collators for new session 0 at #0
+ 2024-09-10 14:34:59 assembling new collators for new session 1 at #0
+
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-4.html b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-4.html
new file mode 100644
index 000000000..3f882595b
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-4.html
@@ -0,0 +1,3 @@
+
+ 2024-09-10 14:41:13 🔨 Initializing Genesis block/state (state: 0xb089…1830, header-hash: 0x6b0b…bd69)
+
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-5.html b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-5.html
new file mode 100644
index 000000000..64e01e649
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-5.html
@@ -0,0 +1,11 @@
+
+ ...
+
+ 2024-09-10 16:26:30 [Parachain] PoV size { header: 0.21875kb, extrinsics: 3.6103515625kb, storage_proof: 3.150390625kb }
+
+ 2024-09-10 16:26:30 [Parachain] Compressed PoV size: 6.150390625kb
+
+ 2024-09-10 16:26:33 [Relaychain] 💤 Idle (2 peers), best: #1729 (0x3aa4…cb6b), finalized #1726 (0xff7a…4352), ⬇ 9.1kiB/s ⬆ 3.8kiB/s
+
+ ...
+
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-6.html b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-6.html
new file mode 100644
index 000000000..9ed121a02
--- /dev/null
+++ b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-6.html
@@ -0,0 +1,25 @@
+
+ ...
+
+ [Relaychain] 💤 Idle (2 peers), best: #90 (0x5f73…1ccf), finalized #87 (0xeb50…68ea), ⬇ 1.4kiB/s ⬆ 1.1kiB/s
+
+ [Parachain] 💤 Idle (0 peers), best: #0 (0x3626…fef3), finalized #0 (0x3626…fef3), ⬇ 1.2kiB/s ⬆ 0.7kiB/s
+
+ [Relaychain] 💤 Idle (2 peers), best: #90 (0x5f73…1ccf), finalized #88 (0xd43c…c3e6), ⬇ 0.7kiB/s ⬆ 0.5kiB/s
+
+ [Parachain] 💤 Idle (0 peers), best: #0 (0x3626…fef3), finalized #0 (0x3626…fef3), ⬇ 1.0kiB/s ⬆ 0.6kiB/s
+
+ [Relaychain] 👶 New epoch 9 launching at block 0x1c93…4aa9 (block slot 281848325 >= start slot 281848325)
+
+ [Relaychain] 👶 Next epoch starts at slot 281848335
+
+ [Relaychain] ✨ Imported #91 (0x1c93…4aa9)
+
+ [Parachain] Starting collation. relay_parent=0x1c936289cfe15fabaa369f7ae5d73050581cb12b75209c11976afcf07f6a4aa9 at=0x36261113c31019d4b2a1e27d062e186f46da0e8f6786177dc7b35959688ffef3
+
+ [Relaychain] 💤 Idle (2 peers), best: #91 (0x1c93…4aa9), finalized #88 (0xd43c…c3e6), ⬇ 1.2kiB/s ⬆ 0.7kiB/s
+
+ [Parachain] 💤 Idle (0 peers), best: #0 (0x3626…fef3), finalized #0 (0x3626…fef3), ⬇ 0.2kiB/s ⬆ 37 B/s
+
+ ...
+
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/genesis-state.md b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/genesis-state.md
deleted file mode 100644
index e1feb2742..000000000
--- a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/genesis-state.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
- ./target/release/parachain-template-node export-genesis-state --chain raw-parachain-chainspec.json para-2000-genesis-state
- 2024-09-10 14:41:13 🔨 Initializing Genesis block/state (state: 0xb089…1830, header-hash: 0x6b0b…bd69)
-
-
\ No newline at end of file
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/parachain-running.md b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/parachain-running.md
deleted file mode 100644
index b6011ab9a..000000000
--- a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/parachain-running.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
- ...
- [Relaychain] 💤 Idle (2 peers), best: #90 (0x5f73…1ccf), finalized #87 (0xeb50…68ea), ⬇ 1.4kiB/s ⬆ 1.1kiB/s
- [Parachain] 💤 Idle (0 peers), best: #0 (0x3626…fef3), finalized #0 (0x3626…fef3), ⬇ 1.2kiB/s ⬆ 0.7kiB/s
- [Relaychain] 💤 Idle (2 peers), best: #90 (0x5f73…1ccf), finalized #88 (0xd43c…c3e6), ⬇ 0.7kiB/s ⬆ 0.5kiB/s
- [Parachain] 💤 Idle (0 peers), best: #0 (0x3626…fef3), finalized #0 (0x3626…fef3), ⬇ 1.0kiB/s ⬆ 0.6kiB/s
- [Relaychain] 👶 New epoch 9 launching at block 0x1c93…4aa9 (block slot 281848325 >= start slot 281848325)
- [Relaychain] 👶 Next epoch starts at slot 281848335
- [Relaychain] ✨ Imported #91 (0x1c93…4aa9)
- [Parachain] Starting collation. relay_parent=0x1c936289cfe15fabaa369f7ae5d73050581cb12b75209c11976afcf07f6a4aa9 at=0x36261113c31019d4b2a1e27d062e186f46da0e8f6786177dc7b35959688ffef3
- [Relaychain] 💤 Idle (2 peers), best: #91 (0x1c93…4aa9), finalized #88 (0xd43c…c3e6), ⬇ 1.2kiB/s ⬆ 0.7kiB/s
- [Parachain] 💤 Idle (0 peers), best: #0 (0x3626…fef3), finalized #0 (0x3626…fef3), ⬇ 0.2kiB/s ⬆ 37 B/s
-
-
\ No newline at end of file
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/start-collator-node.md b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/start-collator-node.md
deleted file mode 100644
index 09ed9e063..000000000
--- a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/start-collator-node.md
+++ /dev/null
@@ -1,19 +0,0 @@
-
- ./target/release/parachain-template-node \
- --charlie \
- --collator \
- --force-authoring \
- --chain raw-parachain-chainspec.json \
- --base-path /tmp/charlie-parachain/ \
- --unsafe-force-node-key-generation \
- --port 40333 \
- --rpc-port 8844 \
- -- \
- --chain INSERT_RELAY_CHAIN_PATH/local-raw-spec.json \
- --port 30333 \
- --rpc-port 9946
- 2024-09-10 16:26:30 [Parachain] PoV size { header: 0.21875kb, extrinsics: 3.6103515625kb, storage_proof: 3.150390625kb }
- 2024-09-10 16:26:30 [Parachain] Compressed PoV size: 6.150390625kb
- 2024-09-10 16:26:33 [Relaychain] 💤 Idle (2 peers), best: #1729 (0x3aa4…cb6b), finalized #1726 (0xff7a…4352), ⬇ 9.1kiB/s ⬆ 3.8kiB/s
-
-
\ No newline at end of file
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-bootstraping-logs.html b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-1.html
similarity index 100%
rename from .snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-bootstraping-logs.html
rename to .snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-1.html
diff --git a/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-running-logs.html b/.snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-2.html
similarity index 100%
rename from .snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-running-logs.html
rename to .snippets/code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-2.html
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-1.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-1.webp
new file mode 100644
index 000000000..c4e158833
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-1.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-10.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-10.webp
new file mode 100644
index 000000000..d59781df6
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-10.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-11.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-11.webp
new file mode 100644
index 000000000..a6e57f3fc
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-11.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-2.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-2.webp
new file mode 100644
index 000000000..a16157b75
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-2.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-3.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-3.webp
new file mode 100644
index 000000000..364236c89
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-3.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-4.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-4.webp
new file mode 100644
index 000000000..0b24f9b85
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-4.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-5.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-5.webp
new file mode 100644
index 000000000..72ab3736e
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-5.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-6.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-6.webp
new file mode 100644
index 000000000..1bcdce67e
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-6.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-7.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-7.webp
new file mode 100644
index 000000000..c78531c07
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-7.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-8.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-8.webp
new file mode 100644
index 000000000..d637e391e
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-8.webp differ
diff --git a/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-9.webp b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-9.webp
new file mode 100644
index 000000000..805c9a18d
Binary files /dev/null and b/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-9.webp differ
diff --git a/tutorials/polkadot-sdk/build-a-parachain/.pages b/tutorials/polkadot-sdk/build-a-parachain/.pages
index cb44087a8..0edb0f229 100644
--- a/tutorials/polkadot-sdk/build-a-parachain/.pages
+++ b/tutorials/polkadot-sdk/build-a-parachain/.pages
@@ -1,5 +1,6 @@
title: Build a Parachain Tutorials
nav:
- index.md
- - 'Prepare Relay Chain': 'prepare-relay-chain.md'
- - 'Connect a Parachain': 'connect-a-parachain.md'
+ - 'Prepare a Relay Chain': prepare-relay-chain.md
+ - 'Connect a Parachain': connect-a-parachain.md
+ - 'Acquire a TestNet Slot': acquire-a-testnet-slot.md
diff --git a/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot.md b/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot.md
new file mode 100644
index 000000000..26079c010
--- /dev/null
+++ b/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot.md
@@ -0,0 +1,173 @@
+---
+title: Acquire a TestNet Slot
+description: This guide walks you through the journey of securing a TestNet slot on Paseo for your parachain, detailing each step to a successful registration.
+---
+
+# Acquire a TestNet Slot
+
+## Introduction
+
+This tutorial demonstrates deploying a parachain on a public test network like the Paseo network. Public TestNets have a higher bar to entry than a private network but represent an essential step in preparing a parachain project to move into a production network.
+
+## Prerequisites
+
+Before you start, you need to have the following prerequisites:
+
+- You know how to generate and modify chain specification files as described in the [Add Trusted Nodes](TODO:update-path){target=\_blank} tutorial
+- You know how to generate and store keys as described in the [Add Trusted Nodes](TODO:update-path){target=\_blank} tutorial
+- You have completed the [Prepare a Local Relay Chain](/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/){target=\_blank} and the [Connect a Local Parachain](/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain.md){target=\_blank} tutorials on your local computer
+
+## Get Started with an Account and Tokens
+
+To perform any action on Paseo, you need PAS tokens, which can be requested from the [Polkadot Faucet](https://faucet.polkadot.io/){target=\_blank}. Also, to store the tokens, you must have access to a Substrate-compatible digital currency wallet. You can't use [development keys and accounts](TODO:update-path){target=\_blank} for operations in any public setting. Many options are available for holding digital currency—including hardware wallets and browser-based applications—and some are more reputable than others. You should do your own research before selecting one.
+
+However, you can use the [Polkadot.js Apps](https://polkadot.js.org/apps/){target=\_blank} interface to get you started for testing purposes.
+
+To prepare an account, follow these steps:
+
+1. Open the [Polkadot.js Apps](https://polkadot.js.org/apps/){target=\_blank} interface and connect to the Paseo network
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-1.webp)
+
+2. Navigate to the **Accounts** section
+ 1. Click on the **Accounts** tab in the top menu
+ 2. Select the **Accounts** option from the dropdown menu
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-2.webp)
+
+3. Copy the address of the account you want to use for the parachain deployment
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-3.webp)
+
+4. Visit the [Polkadot Faucet](https://faucet.polkadot.io){target=\_blank} and paste the copied address in the input field. Ensure that the network is set to Paseo and click on the **Get some PASs** button
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-4.webp)
+
+ After a few seconds, you will receive 100 PAS tokens in your account.
+
+## Reserve a Parachain Identifier
+
+You must reserve a parachain identifier before registering a parathread on Paseo. The steps are similar to the ones you followed in [Connect a Local Parachain](/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/){target=_\blank} to reserve an identifier on the local relay chain. However, for the public TestNet, you'll be assigned the next available identifier.
+
+To reserve a parachain identifier, follow these steps:
+
+1. Navigate to the **Parachains** section
+ 1. Click on the **Network** tab in the top menu
+ 2. Select the **Parachains** option from the dropdown menu
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-5.webp)
+
+2. Register a parathread
+ 1. Select the **Parathreads** tab
+ 2. Click on the **+ ParaId** button
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-6.webp)
+
+3. Review the transaction and click on the **+ Submit** button
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-7.webp)
+
+ For this case, the next available parachain identifier is `4508`.
+
+4. After submitting the transaction, you can navigate to the **Explorer** tab and check the list of recent events for successful `registrar.Reserved`
+
+ ![](/images/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/acquire-a-testnet-slot-8.webp)
+
+## Modify the Chain Specification File
+
+The files required to register a parachain must specify the correct relay chain to connect to and the parachain identifier you have been assigned. To make these changes, you must build and modify the chain specification file for your parachain. In this tutorial, the relay chain is `paseo`, and the parachain identifier is `4508`.
+
+To modify the chain specification:
+
+1. Generate the plain text chain specification for the parachain template node by running the following command:
+
+ ```bash
+ ./target/release/parachain-template-node build-spec \
+ --disable-default-bootnode > plain-parachain-chainspec.json
+ ```
+
+2. Open the plain text chain specification for the parachain template node in a text editor
+
+3. Set `relay_chain` to `paseo` and `para_id` to the identifier you've been assigned. For example, if your reserved identifier is 4508, set the `para_id` field to `4508`:
+
+ ```json
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json:1:4'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json:23:25'
+ ```
+
+4. Set the `parachainId` to the parachain identifier that you previously reserved:
+
+ ```json
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json::2'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json:5:10'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json:22:25'
+ ```
+
+5. Add the public key for your account to the session keys section. Each configured session key will require a running collator:
+
+ ```json
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json::2'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json:5:7'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-1.json:11:25'
+ ```
+
+6. Save your changes and close the plain text chain specification file
+
+7. Generate a raw chain specification file from the modified chain specification file:
+
+ ```bash
+ ./target/release/parachain-template-node build-spec \
+ --chain plain-parachain-chainspec.json \
+ --disable-default-bootnode \
+ --raw > raw-parachain-chainspec.json
+ ```
+
+ After running the command, you will see the following output:
+
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slot/testnet-slot-2.html'
+
+## Export Required Files
+
+To prepare the parachain collator to be registered on Paseo, follow these steps:
+
+1. Export the Wasm runtime for the parachain by running a command similar to the following:
+
+ ```bash
+ ./target/release/parachain-template-node export-genesis-wasm \
+ --chain raw-parachain-chainspec.json para-4508-wasm
+ ```
+
+2. Export the genesis state for the parachain by running a command similar to the following:
+
+ ```bash
+ ./target/release/parachain-template-node export-genesis-state \
+ --chain raw-parachain-chainspec.json para-4508-state
+ ```
+
+## Start the Collator Node
+
+You must have the ports for the collator publicly accessible and discoverable to enable parachain nodes to peer with Paseo validator nodes to produce blocks. You can specify the ports with the `--port` command-line option. For example, you can start the collator with a command similar to the following:
+
+```bash
+./target/release/parachain-template-node --collator \
+ --chain raw-parachain-chainspec.json \
+ --base-path /tmp/parachain/pubs-demo \
+ --port 50333 \
+ --rpc-port 8855 \
+ -- \
+ --execution wasm \
+ --chain paseo \
+ --port 50343 \
+ --rpc-port 9988
+```
+
+In this example, the first `--port` setting specifies the port for the collator node and the second `--port` specifies the embedded relay chain node port. The first `--rpc-port` setting specifies the port you can connect to the collator. The second `--rpc-port` specifies the port for connecting to the embedded relay chain.
+
+## Obtain Coretime
+
+With your parachain collator operational, the next step is acquiring coretime. This is essential for ensuring your parachain's security through the relay chain. [Agile Coretime](https://wiki.polkadot.network/docs/learn-agile-coretime){target=\_blank} enhances Polkadot's resource management, offering developers greater economic adaptability. Once you have configured your parachain, you can follow two paths:
+
+- Bulk coretime is purchased via the Broker pallet on the respective coretime system parachain. You can purchase bulk coretime on the [coretime chain](TODO:update-path){target=\_blank} and assign the purchased core to the registered `ParaID`
+- On-demand coretime is ordered via the `OnDemandAssignment` pallet, which is located on the respective relay chain
+
+For more information on coretime, refer to the [Coretime](TODO:update-path){target=\_blank} documentation.
diff --git a/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain.md b/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain.md
index a64c3ad61..fc36aba48 100644
--- a/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain.md
+++ b/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain.md
@@ -24,7 +24,7 @@ Before you begin, ensure that you have the following prerequisites:
## Build the Parachain Template
-This tutorial uses the [Polkadot SDK Parachain Template](https://github.com/paritytech/polkadot-sdk-parachain-template){target=\_blank} to illustrate how to launch a parachain that connects to a local relay chain. The parachain template is similar to the [Solochain Template](https://github.com/paritytech/polkadot-sdk-solochain-template){target=\_blank} used in development. You can also use the parachain template as the starting point for developing a custom parachain project.
+This tutorial uses the [Polkadot SDK Parachain Template](https://github.com/paritytech/polkadot-sdk-parachain-template){target=\_blank} to illustrate launching a parachain that connects to a local relay chain. The parachain template is similar to the [Solochain Template](https://github.com/paritytech/polkadot-sdk-solochain-template){target=\_blank} used in development. You can also use the parachain template as the starting point for developing a custom parachain project.
To build the parachain template, follow these steps:
@@ -43,7 +43,7 @@ To build the parachain template, follow these steps:
cd polkadot-sdk-solochain-template
```
-3. Build the parachain template collator by running the following command
+3. Build the parachain template collator
```bash
cargo build --release
@@ -52,27 +52,14 @@ To build the parachain template, follow these steps:
!!! note
Depending on your system’s performance, compiling the node can take a few minutes.
-
## Reserve a Parachain Identifier
-Every parachain must reserve a unique identifier the - `ParaID` - that enables it to connect to its specific relay chain. Each relay chain manages its own set of unique identifiers for the parachains that connect to it. The identifier is referred to as a `ParaID` because the same identifier can be used to identify a slot occupied by a [Parachain](https://wiki.polkadot.network/docs/learn-parachains){target=\_blank} or to identify a slot occupied by a [Parathread](https://wiki.polkadot.network/docs/glossary#parathread){target=\_blank}.
+Every parachain must reserve a unique `ParaID` identifier to connect to its specific relay chain. Each relay chain manages its own set of unique identifiers for the parachains that connect to it. The identifier is called a `ParaID` because the same identifier can be used to identify a slot occupied by a [parachain](https://wiki.polkadot.network/docs/learn-parachains){target=\_blank} or a [parathread](https://wiki.polkadot.network/docs/glossary#parathread){target=\_blank}.
-You should note that you must have an account with sufficient funds to reserve a slot on a relay chain. You can determine the number of tokens a specific relay chain requires by checking the `ParaDeposit` configuration in the `paras_registrar` pallet for that relay chain. For example, [Rococo](https://github.com/paritytech/polkadot/blob/master/runtime/rococo/src/lib.rs#L1155){target=\_blank} requires 40 ROC to reserve an identifier:
+Note that you must have an account with sufficient funds to reserve a slot on a relay chain. You can determine the number of tokens a specific relay chain requires by checking the `ParaDeposit` configuration in the `paras_registrar` pallet for that relay chain. For example, [Rococo](https://github.com/paritytech/polkadot/blob/master/runtime/rococo/src/lib.rs#L1155){target=\_blank} requires 40 ROC to reserve an identifier:
```rust
-parameter_types! {
- pub const ParaDeposit: Balance = 40 * UNITS;
-}
-
-impl paras_registrar::Config for Runtime {
- type RuntimeOrigin = RuntimeOrigin;
- type RuntimeEvent = RuntimeEvent;
- type Currency = Balances;
- type OnSwap = (Crowdloan, Slots);
- type ParaDeposit = ParaDeposit;
- type DataDepositPerByte = DataDepositPerByte;
- type WeightInfo = weights::runtime_common_paras_registrar::WeightInfo;
-}
+--8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-1.rs'
```
Each relay chain allows its identifiers by incrementing the identifier starting at `2000` for all chains that aren't [common good parachains](https://wiki.polkadot.network/docs/learn-system-chains){target=\_blank}. Common good chains use a different method to allocate slot identifiers.
@@ -85,16 +72,18 @@ To reserve a parachain identifier, follow these steps:
![](/images/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-1.webp)
-3. Navigate to the Parachains sections
- 1. Click on the **Network** tab
- 2. Select **Parachains** from the dropdown menu
+3. Navigate to the **Parachains** section
+
+ 1. Click on the **Network** tab
+ 2. Select **Parachains** from the dropdown menu
![](/images/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.webp)
4. Register a parathread
- 1. Select the **Parathreads** tab
- 2. Click on the **+ ParaId** button
-
+
+ 1. Select the **Parathreads** tab
+ 2. Click on the **+ ParaId** button
+
![](/images/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-3.webp)
5. Fill in the required fields and click on the **+ Submit** button
@@ -119,56 +108,49 @@ To modify the default chain specification, follow these steps:
1. Generate the plain text chain specification for the parachain template node by running the following command
```bash
- ./target/release/parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json
+ ./target/release/parachain-template-node build-spec \
+ --disable-default-bootnode > plain-parachain-chainspec.json
```
2. Open the plain text chain specification for the parachain template node in a text editor
-3. Set the `para_id` to the parachain identifier that you previously reserved
-
- For example, if your reserved identifier is `2000`, set the `para_id` field to 2000:
+3. Set the `para_id` to the parachain identifier that you previously reserved. For example, if your reserved identifier is `2000`, set the `para_id` field to `2000`:
- ```json
- ...
- "relay_chain": "rococo-local",
- "para_id": 2000,
- "codeSubstitutes": {},
- "genesis": {
- ...
- }
- ...
- ```
-
-4. Set the `parachainId` to the parachain identifier that you previously reserved
+ ```json
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:1:4'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:6:6'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:13:15'
+ ```
- For example, if your reserved identifier is 2000, set the `parachainId` field to 2000:
+4. Set the `parachainId` to the parachain identifier that you previously reserved. For example, if your reserved identifier is `2000`, set the `parachainId` field to `2000`
- ```json
- ...
- "parachainSystem": null,
- "parachainInfo": {
- "parachainId": 2000
- },
- ...
- ```
+ ```json
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:1:2'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:6:15'
+ ```
5. If you complete this tutorial simultaneously as anyone on the same local network, an additional step is needed to prevent accidentally peering with their nodes. Find the following line and add characters to make your `protocolId` unique
- ```json
- "protocolId": "template-local"
- ```
+ ```json
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:1:2'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:5:6'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-2.json:13:15'
+ ```
6. Save your changes and close the plain text chain specification file
7. Generate a raw chain specification file from the modified chain specification file by running the following command
- ```bash
- ./target/release/parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json
- ```
+ ```bash
+ ./target/release/parachain-template-node build-spec \
+ --chain plain-parachain-chainspec.json \
+ --disable-default-bootnode \
+ --raw > raw-parachain-chainspec.json
+ ```
- After running the command, you will see the following output:
+ After running the command, you will see the following output:
- --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/raw-chain-spec-terminal.md'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-3.html'
## Prepare the Parachain Collator
@@ -178,23 +160,25 @@ To prepare the parachain collator to be registered:
1. Export the Wasm runtime for the parachain
- The relay chain needs the parachain-specific runtime validation logic to validate parachain blocks. You can export the Wasm runtime for a parachain collator node by running a command similar to the following:
+ The relay chain needs the parachain-specific runtime validation logic to validate parachain blocks. You can export the Wasm runtime for a parachain collator node by running a command similar to the following:
- ```bash
- ./target/release/parachain-template-node export-genesis-wasm --chain raw-parachain-chainspec.json para-2000-wasm
- ```
+ ```bash
+ ./target/release/parachain-template-node export-genesis-wasm \
+ --chain raw-parachain-chainspec.json para-2000-wasm
+ ```
2. Generate a parachain genesis state
- To register a parachain, the relay chain needs to know the genesis state of the parachain. You can export the entire genesis state—hex-encoded—to a file by running a command similar to the following:
+ To register a parachain, the relay chain needs to know the genesis state of the parachain. You can export the entire genesis state—hex-encoded—to a file by running a command similar to the following:
- ```bash
- ./target/release/parachain-template-node export-genesis-state --chain raw-parachain-chainspec.json para-2000-genesis-state
- ```
+ ```bash
+ ./target/release/parachain-template-node export-genesis-state \
+ --chain raw-parachain-chainspec.json para-2000-genesis-state
+ ```
- After running the command, you will see the following output:
+ After running the command, you will see the following output:
- --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/genesis-state.md'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-4.html'
!!!note
You should note that the runtime and state you export must be for the genesis block. You can't connect a parachain with any previous state to a relay chain. All parachains must start from block 0 on the relay chain. See [Convert a Solo Chain](https://docs.substrate.io/reference/how-to-guides/parachains/convert-a-solo-chain/){target=\_blank} for details on how the parachain template was created and how to convert the chain logic—not its history or state migrations—to a parachain.
@@ -222,28 +206,31 @@ To prepare the parachain collator to be registered:
After running the command, you will see the following output:
- --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/start-collator-node.md'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-5.html'
## Register With the Local Relay Chain
-With the local relay chain and collator node running, you can register the parachain on the local relay chain. In a live public network, registration typically involves a [parachain auction](https://wiki.polkadot.network/docs/learn-auction){target=\_blank}. You can use a Sudo transaction and the Polkadot.js App interface for this tutorial and local testing. A Sudo transaction lets you bypass the steps required to acquire a parachain or parathread slot. This transaction should be executed in the relay chain.
+With the local relay chain and collator node running, you can register the parachain on the local relay chain. In a live public network, registration typically involves a [parachain auction](https://wiki.polkadot.network/docs/learn-auction){target=\_blank}. You can use a Sudo transaction and the Polkadot.js Apps interface for this tutorial and local testing. A Sudo transaction lets you bypass the steps required to acquire a parachain or parathread slot. This transaction should be executed in the relay chain.
To register the parachain, follow these steps:
1. Validate that your local relay chain validators are running
2. Navigate to the **Sudo** tab in the Polkadot.js Apps interface
+
1. Click on the **Developer** tab
2. Select **Sudo** from the dropdown menu
![](/images/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-6.webp)
3. Submit a transaction with Sudo privileges
+
1. Select the **`paraSudoWrapper`** pallet
2. Click on the **`sudoScheduleParaInitialize`** extrinsic from the list of available extrinsics
![](/images/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-7.webp)
4. Fill in the required fields
+
1. **`id`** - type the parachain identifier you reserved
2. **`genesisHead`** - click the **file upload** button and select the `para-2000-genesis-state` file you exported
3. **`validationCode`** - click the **file upload** button and select the `para-2000-wasm` file you exported
@@ -268,7 +255,7 @@ To register the parachain, follow these steps:
The terminal where the parachain is running also displays details similar to the following:
- --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/parachain-running.md'
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/connect-a-parachain-6.html'
## Resetting the Blockchain State
@@ -280,23 +267,25 @@ If you want to start over with a clean environment for testing, you should compl
To reset the blockchain state, follow these steps:
-1. In the terminal where the parachain template node is running, press `Control-c`
+1. In the terminal where the parachain template node is running, press `Control-C`
2. Purge the parachain collator state by running the following command
```bash
- ./target/release/parachain-template-node purge-chain --chain raw-parachain-chainspec.json
+ ./target/release/parachain-template-node purge-chain \
+ --chain raw-parachain-chainspec.json
```
-3. In the terminal where either the `alice` validator node or the `bob` validator node is running, press `Control-c`
+3. In the terminal where either the `alice` validator node or the `bob` validator node is running, press `Control-C`
4. Purge the local relay chain state by running the following command
```bash
- ./target/release/polkadot purge-chain --chain local-raw-spec.json
+ ./target/release/polkadot purge-chain \
+ --chain local-raw-spec.json
```
-After purging the chain state, you can restart the local relay chain and parachain collator nodes to begin with a clean environment.
+After purging the chain state, you can restart the local relay chain and parachain collator nodes to begin with a clean environment.
!!! note
Note that to reset the network state and allow all the nodes to sync after the reset, each of them needs to purge their databases. Otherwise, the nodes won't be able to sync with each other effectively.
@@ -304,4 +293,4 @@ After purging the chain state, you can restart the local relay chain and paracha
Now that you have successfully connected a parachain to a relay chain, you can explore more advanced features and functionalities of parachains, such as:
- [Opening HRMP Channels](TODO:update-path){target=\_blank}
-- [Transfer Assets Between Parachains](TODO:update-path){target=\_blank}
\ No newline at end of file
+- [Transfer Assets Between Parachains](TODO:update-path){target=\_blank}
diff --git a/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain.md b/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain.md
index 631b8f961..f1587ed4c 100644
--- a/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain.md
+++ b/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain.md
@@ -7,7 +7,7 @@ description: This tutorial will guide you through preparing a relay chain so tha
## Introduction
-This tutorial illustrates how to configure and spin up a local relay chain. The local relay chain is required to set up a local testing environment to which a test parachain node can connect. Setting up a local relay chain is a crucial step in parachain development. It allows developers to test their parachains in a controlled environment, simulating the interaction between a parachain and the relay chain without needing a live network. This local setup facilitates faster development cycles and easier debugging.
+This tutorial illustrates how to configure and spin up a local relay chain. The local relay chain is needed to set up a local testing environment to which a test parachain node can connect. Setting up a local relay chain is a crucial step in parachain development. It allows developers to test their parachains in a controlled environment, simulating the interaction between a parachain and the relay chain without needing a live network. This local setup facilitates faster development cycles and easier debugging.
The scope of this tutorial includes:
@@ -22,17 +22,18 @@ Before diving into this tutorial, it's recommended that you have a basic underst
To complete this tutorial, ensure that you have:
-- Configured your environment for Substrate development by installing [Rust and the Rust toolchain](https://docs.substrate.io/install/){target=\_blank}
+- Configured your environment for Substrate development by installing [Rust and the Rust toolchain](TODO: add path){target=\_blank}
- Completed [Build a Local Blockchain](/tutorials/polkadot-sdk/build-a-blockchain/build-a-local-blockchain){target=\_blank} tutorial and know how to compile and run a Polkadot SDK-based node
## Build a Local Relay Chain
To build a local relay chain, follow these steps:
-1. Clone the most recent release branch of the Polkadot SDK repository to prepare a stable working environment
+1. Clone the most recent release branch of the Polkadot SDK repository to prepare a stable working environment:
```bash
- git clone --depth 1 --branch polkadot-stable2407-2 https://github.com/paritytech/polkadot-sdk.git
+ git clone --depth 1 --branch polkadot-stable2407-2 \
+ https://github.com/paritytech/polkadot-sdk.git
```
!!! note
@@ -41,22 +42,22 @@ To build a local relay chain, follow these steps:
!!! note
Note that the `--depth 1` flag is used to clone only the latest commit of the branch, which speeds up the cloning process.
-2. Change the directory to the Polkadot SDK repository
+2. Change the directory to the Polkadot SDK repository:
```bash
cd polkadot-sdk
```
-3. Build the relay chain node by running the following command:
+3. Build the relay chain node:
```bash
cargo build --release
```
!!! note
- Depending on your machine’s specifications, the build process may take some time.
+ Depending on your machine's specifications, the build process may take some time.
-4. Verify that the node is built correctly by running the following command:
+4. Verify that the node is built correctly:
```bash
./target/release/polkadot --version
@@ -66,19 +67,19 @@ If command-line help is displayed, the node is ready to configure.
## Relay Chain Configuration
-Every Substrate-based chain requires a [chain specification](https://docs.substrate.io/build/chain-spec/){target=\_blank}. The relay chain network’s chain specification provides the same configuration settings as the chain specification does for other networks. Many of the chain specification file settings are critical for network operations. For example, the chain specification identifies peers participating in the network, keys for validators, bootnode addresses, and other information.
+Every Substrate-based chain requires a [chain specification](TODO:update-path){target=\_blank}. The relay chain's chain specification provides the same configuration settings as the chain specification for other networks. Many of the chain specification file settings are critical for network operations. For example, the chain specification identifies peers participating in the network, keys for validators, bootnode addresses, and other information.
### Sample Chain Configuration
The local relay chain uses a sample chain specification file with two validator relay chain nodes—Alice and Bob—as authorities for this tutorial. Because a relay chain must have at least one more validator node running than the total number of connected parachain collators, you can only use the chain specification from this tutorial for a local relay chain network with a single parachain.
-If you wanted to connect two parachains with a single collator each, you would need to run three or more relay chain validator nodes. You would need to modify the chain specification and hard-code additional validators to set up a local test network for two or more parachains.
+If you wanted to connect two parachains with a single collator each, you must run three or more relay chain validator nodes. You must modify the chain specification and hard-code additional validators to set up a local test network for two or more parachains.
### Plain and Raw Chain Specification
The chain specification file is available in two formats: a JSON file in plain text and a JSON file in SCALE-encoded raw format.
-You can read and edit the plain text version of chain specification file. However, the chain specification file must be converted to the SCALE-encoded raw format before you can use it to start a node. For information about converting a chain specification to use the raw format, see [Customize a Chain Specification](){target=\_blank}.
+You can read and edit the plain text version of the chain specification file. However, the chain specification file must be converted to the SCALE-encoded raw format before you can use it to start a node. For information about converting a chain specification to the raw format, see [Customize a Chain Specification](TODO: add path){target=\_blank}.
The sample chain specification is only valid for a single parachain with two validator nodes. If you add other validators, add additional parachains to your relay chain, or want to use custom account keys instead of the predefined account, you'll need to create a custom chain specification file.
@@ -94,73 +95,74 @@ Before starting block production for a parachain, you need to start a relay chai
To start the validator nodes, follow these steps:
-1. Generate the chain specification file in the plain text format and use it to create the raw chain specification file. Save the raw chain specification file in a local working directory.
+1. Generate the chain specification file in the plain text format and use it to create the raw chain specification file. Save the raw chain specification file in a local working directory
- 1. The plain text chain specification file can be generated by running the following command:
+ 1. Generate the plain text chain specification file:
```bash
- ./target/release/polkadot build-spec --chain rococo-local-testnet > /tmp/plain-local-chainspec.json
+ ./target/release/polkadot build-spec \
+ --chain rococo-local-testnet > /tmp/plain-local-chainspec.json
```
!!! note
Note that the network values are set to the default when generating the chain specification file with the `build-spec`. You can customize the network values by editing the chain specification file for production networks.
- 2. Convert the plain text chain specification file to the raw format by running the following command:
+ 2. Convert the plain text chain specification file to the raw format:
```bash
- ./target/release/polkadot build-spec --chain plain-local-chainspec.json --raw > /tmp/raw-local-chainspec.json
+ ./target/release/polkadot build-spec \
+ --chain plain-local-chainspec.json \
+ --raw > /tmp/raw-local-chainspec.json
```
2. Start the first validator using the `alice` account by running the following command:
```bash
./target/release/polkadot \
- --alice \
- --validator \
- --base-path /tmp/alice \
- --chain /tmp/raw-local-chainspec.json \
- --port 30333 \
- --rpc-port 9944 \
- --insecure-validator-i-know-what-i-do \
- --force-authoring
+ --alice \
+ --validator \
+ --base-path /tmp/alice \
+ --chain /tmp/raw-local-chainspec.json \
+ --port 30333 \
+ --rpc-port 9944 \
+ --insecure-validator-i-know-what-i-do \
+ --force-authoring
```
- This command uses `/tmp/raw-local-chainspec.json` as the location of the sample chain specification file. Be sure the `--chain` command line specifies the path to the raw chain specification you generated. This command also uses the default values for the port (`port`) and WebSocket port (`ws-port`). The values are explicitly included here as a reminder to always check these settings. After the node starts, no other nodes on the same local machine can use these ports.
+ This command uses `/tmp/raw-local-chainspec.json` as the location of the sample chain specification file. Ensure the `--chain` command line specifies the path to your generated raw chain specification. This command also uses the default values for the port (`port`) and WebSocket port (`ws-port`). The values are explicitly included here as a reminder to always check these settings. After the node starts, no other nodes on the same local machine can use these ports.
-3. Review log messages as the node starts and take note of the `Local node identity` value. This value is the node’s peer ID, which you need to connect the parachain to the relay chain
+3. Review log messages as the node starts and take note of the `Local node identity` value. This value is the node's peer ID, which you need to connect the parachain to the relay chain:
- --8<-- "code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-bootstraping-logs.html"
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-1.html'
!!! note
You need to specify this identifier to enable other nodes to connect. In this case, the `Local node identity` is `12D3KooWG393uX82rR3QgDkZpb7U8StzuRx9BQUXCvWsP1ctgygp`.
-4. Open a new terminal and start the second validator using the `bob` account
-
- The command is similar to the command used to start the first node, with a few crucial differences.
+4. Open a new terminal and start the second validator using the `bob` account. The command is similar to the command used to start the first node, with a few crucial differences:
```bash
./target/release/polkadot \
- --bob \
- --validator \
- --base-path /tmp/bob \
- --chain /tmp/raw-local-chainspec.json \
- --port 30334 \
- --rpc-port 9945
+ --bob \
+ --validator \
+ --base-path /tmp/bob \
+ --chain /tmp/raw-local-chainspec.json \
+ --port 30334 \
+ --rpc-port 9945
```
- Notice that this command uses a different base path (/tmp/relay/bob), validator key (`--bob`), and ports (`30334` and `9945`).
+ Notice that this command uses a different base path (`/tmp/relay/bob`), validator key (`--bob`), and ports (`30334` and `9945`).
- Because both validators are running on a single local computer, it isn't necessary to specify the `--bootnodes` command-line option and the first node’s IP address and peer identifier. The `--bootnodes` option is required to connect nodes outside the local network or not identified in the chain specification file.
+ Because both validators are running on a single local computer, it isn't necessary to specify the `--bootnodes` command-line option and the first node's IP address and peer identifier. The `--bootnodes` option is required to connect nodes outside the local network or not identified in the chain specification file.
If you don't see the relay chain producing blocks, try disabling your firewall or adding the bootnodes command-line option with the address of Alice's node to start the node. Adding the bootnodes option looks like this (with the node identity of Alice's node):
```bash
--bootnodes \
- /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWG393uX82rR3QgDkZpb7U8StzuRx9BQUXCvWsP1ctgygp
+ /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWG393uX82rR3QgDkZpb7U8StzuRx9BQUXCvWsP1ctgygp
```
-5. Verify that the relay chain nodes are running by checking the logs for each node. The logs should show that the nodes are connected to each other and producing blocks. For example, Bob's logs will be displayed as follows:
+5. Verify that the relay chain nodes are running by checking the logs for each node. The logs should show that the nodes are connected and producing blocks. For example, Bob's logs will be displayed as follows:
- --8<-- "code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-running-logs.html"
+ --8<-- 'code/tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain/relay-chain-2.html'
-Once the relay chain nodes are running, you can proceed to the next tutorial to set up a test parachain node and connect it to the relay chain.
\ No newline at end of file
+Once the relay chain nodes are running, you can proceed to the next tutorial to [set up a test parachain node and connect it](/tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain/) to the relay chain.