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

[Substrate.io Migration] Tutorials -> Build a Parachain -> Acquire a TestNet Slot #28

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
1a523ef
fix: adding prepare substrate relay chain
nhussein11 Sep 9, 2024
a59e5e3
fiox: formatting error
nhussein11 Sep 9, 2024
d5cc084
fix: description
nhussein11 Sep 9, 2024
5e7a4dc
fix: paraphrasing
nhussein11 Sep 9, 2024
2413eec
fix: vale warning
nhussein11 Sep 9, 2024
291a833
fix: formatting
nhussein11 Sep 9, 2024
3b73da1
fix: adding conclusion to the tutorial
nhussein11 Sep 9, 2024
fabc617
fix: formatting
nhussein11 Sep 10, 2024
5316122
fix: formatting
nhussein11 Sep 10, 2024
763f598
git: adding intro and build the parachain template section
nhussein11 Sep 10, 2024
d27184f
fix: adding wip
nhussein11 Sep 10, 2024
ff83f15
fix: updating prepare relay chain output and commands
nhussein11 Sep 10, 2024
339514f
Merge branch 'nhussein11/tutorials-substrate-prepare-relay-chain' int…
nhussein11 Sep 10, 2024
907bff6
fix: adding build a parachain complete process
nhussein11 Sep 10, 2024
75d518f
fix: vale suggestion
nhussein11 Sep 10, 2024
77509c5
fix: adding acquire a slot on testnet wip
nhussein11 Sep 11, 2024
a83ddde
fix: adding admin account example
nhussein11 Sep 11, 2024
a956e4a
fix: typos
nhussein11 Sep 11, 2024
2a7f3b3
fix: typo
nhussein11 Sep 11, 2024
010a96d
fix: typo
nhussein11 Sep 11, 2024
4d2296c
fix: formatting
nhussein11 Sep 11, 2024
5f7a28c
fix: formatting
nhussein11 Sep 11, 2024
213814e
fix: typo and adding abs route to build a local blockchain tutorial
nhussein11 Sep 11, 2024
1286b44
fix: paraphrasing
nhussein11 Sep 11, 2024
4f2a152
fix: updating deprecated route
nhussein11 Sep 11, 2024
f8b1fa8
fix: paraphrasing
nhussein11 Sep 11, 2024
1cb5f77
fix: formatting
nhussein11 Sep 11, 2024
5274116
fix: chain specs decoupled from substrate website
nhussein11 Sep 11, 2024
6bfe5e4
Update tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain.md
nhussein11 Sep 23, 2024
6446b16
fix: typo
nhussein11 Sep 23, 2024
aa08eca
fix: removing redundant commands on terminal elements
nhussein11 Sep 23, 2024
8acc357
fix: adding disclaimer for chain spec generation
nhussein11 Sep 23, 2024
231eafe
fix: removing redundant commands on terminal elements
nhussein11 Sep 23, 2024
1cac723
fix: removing unnecessary info
nhussein11 Sep 23, 2024
38ab69e
fix: addin small clarification about sudo txs
nhussein11 Sep 23, 2024
357bd72
fix: clarification about sudo changes
nhussein11 Sep 23, 2024
7a21a64
Update tutorials/polkadot-sdk/build-a-parachain/connect-a-parachain.md
nhussein11 Sep 23, 2024
bd8ff69
fix: adding missing terminal output
nhussein11 Sep 23, 2024
df3357c
fix: adding image to register with the local relay chain process, step 6
nhussein11 Sep 23, 2024
f463234
Apply suggestions from code review
nhussein11 Sep 24, 2024
ac7f71a
fix: moving terminal outputs to code snippets
nhussein11 Sep 24, 2024
1bd5b34
Merge branch 'master' into nhussein11/tutorials-substrate-prepare-rel…
nhussein11 Sep 24, 2024
daadd83
Merge branch 'nhussein11/tutorials-substrate-prepare-relay-chain' int…
nhussein11 Sep 24, 2024
6516f69
fix: adding clarification over resetting bc state
nhussein11 Sep 24, 2024
2f06bc0
fix: replacing Polkadot.Js by Polkadot.js
nhussein11 Sep 24, 2024
8ff9ead
fix: update acquire-a-testnet-slot to paseo and coretime docs
nhussein11 Sep 25, 2024
d4f68e4
fix: adding hook to further tutorials
nhussein11 Sep 25, 2024
5b11e48
Merge branch 'nhussein11/tutorials-substrate-connect-a-parachain' int…
nhussein11 Sep 25, 2024
bdebf22
Merge branch 'master' into nhussein11/tutorials-substrate-acquire-a-t…
nhussein11 Sep 25, 2024
1285978
clean up formatting and grammar
eshaben Sep 26, 2024
ef0fb86
fix snippet
eshaben Sep 26, 2024
e06581f
fix typo
eshaben Sep 26, 2024
8a6e3ac
update .pages file
eshaben Sep 26, 2024
038ca60
Merge remote-tracking branch 'origin/master' into nhussein11/tutorial…
eshaben Sep 26, 2024
4c67b3a
Merge remote-tracking branch 'origin/master' into nhussein11/tutorial…
eshaben Sep 26, 2024
a4ac880
Merge remote-tracking branch 'origin/master' into nhussein11/tutorial…
eshaben Sep 30, 2024
4fa1807
resolve merge conflicts
eshaben Sep 30, 2024
f450181
Update tutorials/polkadot-sdk/build-a-parachain/acquire-a-testnet-slo…
nhussein11 Oct 2, 2024
1098be0
Apply suggestions from code review
nhussein11 Oct 2, 2024
9b22d91
Update tutorials/polkadot-sdk/build-a-parachain/prepare-relay-chain.md
nhussein11 Oct 2, 2024
510ab2d
fix: decoupling from substrate documentation
nhussein11 Oct 2, 2024
316b4f1
fix: adding missed colons
nhussein11 Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)}`);
Expand All @@ -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)}`);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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)}`);
Expand All @@ -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)}`);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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)}`);
Expand All @@ -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)}`);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -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)}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -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)}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -22,4 +22,4 @@ async function main() {

main()
.catch((err) => console.error(err))
.finally(() => process.exit());
.finally(() => process.exit());
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type Format = "payload" | "call" | "submittable";
export type Format = 'payload' | 'call' | 'submittable';
Original file line number Diff line number Diff line change
@@ -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
}
]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"...": "...",
"relay_chain": "paseo",
"para_id": 4508,
"genesis": {
"runtime": {
"...": {},
"parachainInfo": {
"parachainId": 4508
},
"session": {
"keys": [
[
"5HErbKmL5JmUKDVsH1aGyXTGZb4i9iaNsFhSgkNDr8qp2Dvj",
"5HErbKmL5JmUKDVsH1aGyXTGZb4i9iaNsFhSgkNDr8qp2Dvj",
{
"aura": "5HErbKmL5JmUKDVsH1aGyXTGZb4i9iaNsFhSgkNDr8qp2Dvj"
}
]
]
}
},
"...": {}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>./target/release/parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json</span>
<span data-ty="progress">2024-09-10 14:34:58 Building chain spec</span>
<span data-ty="progress">2024-09-10 14:34:59 assembling new collators for new session 0 at #0</span>
<span data-ty="progress">2024-09-10 14:34:59 assembling new collators for new session 1 at #0</span>
<span data-ty="input"><span class="file-path"></span></span>
</div>
<br />
<span data-ty="progress">2024-09-11 09:48:15 Building chain spec</span>
<span data-ty="progress">2024-09-11 09:48:15 assembling new collators for new session 0 at #0</span>
<span data-ty="progress">2024-09-11 09:48:15 assembling new collators for new session 1 at #0</span>
</div>
Original file line number Diff line number Diff line change
@@ -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<Runtime>;
}
Loading