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

Cumulus Tutorial Refactor & Update #203

Merged
merged 34 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
87fd23b
config add, start on links
Oct 5, 2021
36c179b
up
Oct 5, 2021
98e88c4
formatting (auto)
nuke-web3 Oct 5, 2021
d556453
formatting
nuke-web3 Oct 5, 2021
17005c3
prettier
nuke-web3 Oct 5, 2021
ab69f74
up
nuke-web3 Oct 5, 2021
935822d
Merge branch 'develop' into cumulus-update-main
nuke-web3 Oct 6, 2021
70b25ae
spell
nuke-web3 Oct 6, 2021
6a55337
revert formatting
nuke-web3 Oct 6, 2021
d1b8e1a
revert formatting 2
nuke-web3 Oct 6, 2021
15600fb
revert format 3
nuke-web3 Oct 6, 2021
2a58270
types correct
nuke-web3 Oct 6, 2021
392bb18
updates
nuke-web3 Oct 6, 2021
3e43142
Update page slugs throughout
Oct 6, 2021
dcc1998
edits
nuke-web3 Oct 7, 2021
bf289dc
pt1 review complete
nuke-web3 Oct 7, 2021
8288e7a
update headers, gatsby crap
nuke-web3 Oct 7, 2021
ec054ca
change dir, add new page
nuke-web3 Oct 7, 2021
3edb8ad
correct line brak error in frontmatter
nuke-web3 Oct 7, 2021
deb73d3
rename image folder, link correctly
nuke-web3 Oct 7, 2021
23c0cf5
para id, keywords
nuke-web3 Oct 7, 2021
0093208
Merge branch 'develop' into cumulus-update-main
nuke-web3 Oct 7, 2021
5228053
pt2 complete, next step sections
nuke-web3 Oct 7, 2021
3c7acae
ready for content review
nuke-web3 Oct 7, 2021
df98b82
revert format
nuke-web3 Oct 7, 2021
f9bd355
rm config
nuke-web3 Oct 7, 2021
7306edb
revert
nuke-web3 Oct 7, 2021
eb0c503
Merge branch 'develop' into cumulus-update-main
jimmychu0807 Oct 8, 2021
761c156
Merge branch 'develop' into cumulus-update-main
jimmychu0807 Oct 8, 2021
66f03e4
Fixing basic issues that prevent running
jimmychu0807 Oct 8, 2021
0662732
Merging Develop and removing conflicts
imadarai Oct 8, 2021
e5dd358
prettierignore file update
imadarai Oct 8, 2021
e940d88
git rm .env.development
nuke-web3 Oct 8, 2021
8e1d159
fix links, content polish
nuke-web3 Oct 8, 2021
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
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore build/dev artifacts:
.cache
node_modules
public

# Ignore files that don't need *text* formatting
src/images
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = {
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/v3/tutorials/09-cumulus-workshop/`,
path: `${__dirname}/v3/tutorials/09-cumulus/`,
name: `cumulus`,
},
},
Expand Down
4 changes: 2 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ const tutsInfo = [
},
{
name: 'cumulus',
navSlug: 'cumulusWorkshop',
version: '3.0',
navSlug: 'cumulusTutorial',
version: 'polkadot-v0.9.10',
},
{
name: 'frontier',
Expand Down
20 changes: 12 additions & 8 deletions src/components/DevNavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -685,22 +685,26 @@ DevNavMenuTuts.set('inkWorkshop', [
],
},
])
DevNavMenuTuts.set('cumulusWorkshop', [
DevNavMenuTuts.set('cumulusTutorial', [
{
name: `Substrate Cumulus Workshop`,
name: `Cumulus Tutorial`,
items: [
{
title: `Getting Started`,
link: '/tutorials/v3/cumulus-workshop/pt1',
title: `Start a relay chain`,
link: '/tutorials/v3/cumulus/pt1',
},
{
title: `Connecting to a Relay Chain`,
link: '/tutorials/v3/cumulus-workshop/pt2',
title: `Connect a parachain`,
link: '/tutorials/v3/cumulus/pt2',
},
{
title: `Launch a Development Environment`,
link: '/tutorials/v3/cumulus-workshop/pt3',
title: `Launch a parachain testnet`,
link: '/tutorials/v3/cumulus/pt3',
},
// {
// title: `Register on Rococo`,
// link: '/tutorials/v3/cumulus/pt4',
// },
nuke-web3 marked this conversation as resolved.
Show resolved Hide resolved
],
},
])
Expand Down
12 changes: 5 additions & 7 deletions src/pages/tutorials/v3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ export default function tutorials({ data }: any) {
<Layout>
<SEO title="Tutorials" />
<div className="px-4">
<h1 className="text-center my-8 lg:my-12">
{intl.formatMessage({ id: 'nav-tutorials' })}
</h1>
<h1 className="text-center my-8 lg:my-12">{intl.formatMessage({ id: 'nav-tutorials' })}</h1>
<div className="mb-40 flex flex-col items-center md:flex-row md:flex-wrap md:justify-center">
<TutorialCard
title={`Create Your First Substrate Chain`}
Expand Down Expand Up @@ -116,14 +114,14 @@ export default function tutorials({ data }: any) {
link={`/tutorials/v3/frontier`}
/>
<TutorialCard
title={`Cumulus Workshop`}
title={`Create a Parachain with Cumulus`}
image={data.tutorialNine}
description={`A workshop to configure a Substrate node as a Parachain`}
description={`Learn to use the parachain template in local testnet`}
time={`3 Hours`}
difficulty={3}
prerequisites={true}
version={`V3.0.0`}
link={`/tutorials/v3/cumulus-workshop/pt1`}
version={`polkadot-0.9.10`}
nuke-web3 marked this conversation as resolved.
Show resolved Hide resolved
link={`/tutorials/v3/cumulus/pt1`}
/>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
/docs/en/tutorials/frontier/* /tutorials/v3/frontier/* 301!

### Tutorial - Cumulus Workshop
/tutorials/substrate-cumulus-workshop /tutorials/v3/cumulus-workshop 301!
/tutorials/substrate-cumulus-workshop/* /tutorials/v3/cumulus-workshop 301!
/cumulus-workshop /tutorials/v3/cumulus-workshop 301!
/cumulus-workshop/* /tutorials/v3/cumulus-workshop 301!
/tutorials/substrate-cumulus-workshop /tutorials/v3/cumulus/p1 301!
/tutorials/substrate-cumulus-workshop/* /tutorials/v3/cumulus/p1 301!
/cumulus-workshop /tutorials/v3/cumulus/p1 301!
/cumulus-workshop/* /tutorials/v3/cumulus/p1 301!

### Tutorial - Kitties Workshop
/tutorials/kitties /tutorials/v3/kitties 301!
Expand Down

This file was deleted.

37 changes: 37 additions & 0 deletions static/assets/tutorials/cumulus/node-start-local-testing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Build Spec
./target/release/polkadot build-spec --chain rococo-local --disable-default-bootnode > rococo-custom-2-plain.json
./target/release/polkadot build-spec --chain rococo-custom-2-plain.json --raw --disable-default-bootnode > rococo-custom-2-raw.json

# modify from snipets to copy and make 3 & 4 validator plain specs

./target/release/polkadot build-spec --chain rococo-custom-3-plain.json --raw --disable-default-bootnode > rococo-custom-3-raw.json
./target/release/polkadot build-spec --chain rococo-custom-4-plain.json --raw --disable-default-bootnode > rococo-custom-4-raw.json

# Clear old DBs

rm -rf /tmp/relay /tmp/parachain

# Relay Validators with 2 validator chainspec
./target/release/polkadot --alice --validator --base-path /tmp/relay/alice --chain ../cumulus-workshop/shared/chainspecs/rococo-custom-2-raw.json --port 30333 --ws-port 9944

./target/release/polkadot --bob --validator --base-path /tmp/relay/bob --chain ../cumulus-workshop/shared/chainspecs/rococo-custom-2-raw.json --port 30334 --ws-port 9945

# ./target/release/polkadot --charlie --validator --base-path /tmp/relay/charlie --chain ../cumulus-workshop/shared/chainspecs/rococo-custom-2-raw.json --port 30335 --ws-port 9946

# Register para ID 2000 with `Charlie`
# https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains/parathreads

# Parachain collators gen state
./target/release/parachain-collator export-genesis-state --parachain-id 2000 > para-2000-genesis
# Parachain collators gen wasm
./target/release/parachain-collator export-genesis-wasm > para-2000-wasm

# Submit (as sudo) parasSudoWrapper -> sudoScheduleParaInitialize(id, genesis) for parachain 2000
# https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/sudo
# Parachain = Yes (true)

# Parachain collator launch
./target/release/parachain-collator --alice --collator --force-authoring --parachain-id 2000 --base-path /tmp/parachain/alice --port 40333 --ws-port 8844 -- --execution wasm --chain ../cumulus-workshop/shared/chainspecs/rococo-custom-2-raw.json --port 30343 --ws-port 9977

# Force que action to speed up (as sudo): paras -> forceQueueAction(para) for 2000
# https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/sudo
5 changes: 3 additions & 2 deletions v3/how-to-guides/07-parachains/c-reserve-id/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: How to reserve a ParaID
slug: /how-to-guides/v3/parachains/reserve-id
keywords: parachains, paraID
version: 3.0
keywords: parachains, para ID
version: 3.0
section: how to guides
category: parachains
difficulty: 1
Expand Down Expand Up @@ -34,4 +34,5 @@ creating channels to other parachains for XCM, starting a crowdloan, etc.
- Reserve the ParaID. This operation requires a deposit.

## Examples

[TODO]
8 changes: 4 additions & 4 deletions v3/how-to-guides/07-parachains/d-register/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ To register your parachain you need to provide your ParaID, genesis state and
your compressed WASM validation logic.

- Generate
[parachain Genesis state](/tutorials/v3/cumulus-workshop/pt2#3-generate-parachain-genesis-state)
- [Obtain WASM runtime validation logic](/tutorials/v3/cumulus-workshop/pt2#4-obtain-wasm-runtime-validation-function).
[parachain Genesis state](/tutorials/v3/cumulus/pt2#3-generate-parachain-genesis-state)
- [Obtain WASM runtime validation logic](/tutorials/v3/cumulus/pt2#4-obtain-wasm-runtime-validation-function).
maximum size of the WASM blob is 750 kilobytes on Kusama
- Compress WASM validation logic
- [Register the parachain](/tutorials/v3/cumulus-workshop/pt2#parachain-registration).
- [Register the parachain](/tutorials/v3/cumulus/pt2#parachain-registration).
This transaction requires a deposit. The amount of the deposit depends on the
size of the WASM blob and the genesis states.
- Check and calculate the exact formulas for deposit calculation for
Expand All @@ -48,5 +48,5 @@ your compressed WASM validation logic.

## Examples

[register-paraid]: /tutorials/v3/cumulus-workshop/pt2#1-reserve-a-para-id
[register-paraid]: /tutorials/v3/cumulus/pt2#1-reserve-a-para-id
[crowdloan-paraid]: https://wiki.polkadot.network/docs/learn-crowdloans
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ become a collator. Use the democracy pallet to elect these members and define th

### 2. Starting a collator node

Refer to [this guide](/tutorials/v3/cumulus-workshop/pt2#5-start-the-collator-node) to start and set up a collator node.
Refer to [this guide](/tutorials/v3/cumulus/pt2#5-start-the-collator-node) to start and set up a collator node.

### 3. Adding collators

Refer to [this instruction](/tutorials/v3/cumulus-workshop/pt2#1-start-the-second-collator) to add more collators.
Refer to [this instruction](/tutorials/v3/cumulus/pt2#1-start-the-second-collator) to add more collators.

## Examples

Expand Down
12 changes: 7 additions & 5 deletions v3/how-to-guides/07-parachains/f-start-testnet/index.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
title: Start a testnet on Rococo
slug: /how-to-guides/v3/parachains/rococo
keywords: parachains, paraID
version: 3.0
keywords: parachains, para ID
version: 3.0
section: how to guides
category: parachains
---

## Goal

Start up a local testnetwork on Rococo.

## Use cases

## Overview
Expand All @@ -31,7 +33,7 @@ cargo run -- \

### 2. Start Bob

Use Alice's local node identity as shown in the stdout logs to declare as a bootnode.
Use Alice's local node identity as shown in the stdout logs to declare as a bootnode.

```bash
cargo run -- \
Expand All @@ -55,6 +57,6 @@ cargo run -- \

#### Docs

#### Other
#### Other

- [Polkadot Wiki on Using Rococo](https://wiki.polkadot.network/docs/build-pdk#testing-a-parachain-rococo-testnet)
- [Polkadot Wiki on Using Rococo](https://wiki.polkadot.network/docs/build-pdk#testing-a-parachain-rococo-testnet)
Loading