Skip to content

Commit c80f76f

Browse files
update polkadot, substrate, cumulus readme (#1182)
* update readmes * temporary ReadMe for the Polkadot SDK * delete welcome readme * update links on substrate readme * update links on polkadot readme * update links on cumulus readme * update overseer feature comment Co-authored-by: Liam Aharon <[email protected]> * Update cumulus/README.md Co-authored-by: Liam Aharon <[email protected]> * Update cumulus/README.md Co-authored-by: Liam Aharon <[email protected]> * Update polkadot/README.md Co-authored-by: Liam Aharon <[email protected]> * Update polkadot/README.md Co-authored-by: Liam Aharon <[email protected]> * Update polkadot/README.md Co-authored-by: Liam Aharon <[email protected]> * update gitlab links Co-authored-by: Liam Aharon <[email protected]> * terminal friendly convention --------- Co-authored-by: Liam Aharon <[email protected]>
1 parent b728724 commit c80f76f

File tree

3 files changed

+559
-21
lines changed

3 files changed

+559
-21
lines changed

cumulus/README.md

Lines changed: 264 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,270 @@
1-
Dear contributors and users,
1+
# Cumulus ☁️
22

3-
We would like to inform you that we have recently made significant changes to our repository structure. In order to streamline our development process and foster better contributions, we have merged three separate repositories Cumulus, Substrate and Polkadot into a single new repository: [the Polkadot SDK](https://github.com/paritytech/polkadot-sdk). Go ahead and make sure to support us by giving a star ⭐️ to the new repo.
3+
[![Doc](https://img.shields.io/badge/cumulus%20docs-master-brightgreen)](https://paritytech.github.io/cumulus/)
44

5-
By consolidating our codebase, we aim to enhance collaboration and provide a more efficient platform for future development.
5+
This repository contains both the Cumulus SDK and also specific chains implemented on top of this
6+
SDK.
67

7-
If you currently have an open pull request in any of the merged repositories, we kindly request that you resubmit your PR in the new repository. This will ensure that your contributions are considered within the updated context and enable us to review and merge them more effectively.
8+
If you only want to run a **Polkadot Parachain Node**, check out our [container
9+
section](./docs/container.md).
810

9-
We appreciate your understanding and ongoing support throughout this transition. Should you have any questions or require further assistance, please don't hesitate to [reach out to us](https://forum.polkadot.network/t/psa-parity-is-currently-working-on-merging-the-polkadot-stack-repositories-into-one-single-repository/2883).
11+
## Cumulus SDK
1012

11-
Best Regards,
13+
A set of tools for writing [Substrate](https://substrate.io/)-based
14+
[Polkadot](https://wiki.polkadot.network/en/)
15+
[parachains](https://wiki.polkadot.network/docs/en/learn-parachains). Refer to the included
16+
[overview](docs/overview.md) for architectural details, and the [Connect to a relay chain how-to
17+
guide](https://docs.substrate.io/reference/how-to-guides/parachains/connect-to-a-relay-chain/) for a
18+
guided walk-through of using these tools.
1219

13-
Parity Technologies
20+
It's easy to write blockchains using Substrate, and the overhead of writing parachains'
21+
distribution, p2p, database, and synchronization layers should be just as low. This project aims to
22+
make it easy to write parachains for Polkadot by leveraging the power of Substrate.
23+
24+
Cumulus clouds are shaped sort of like dots; together they form a system that is intricate,
25+
beautiful and functional.
26+
27+
### Consensus
28+
29+
[`parachain-consensus`](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/client/consensus/common/src/parachain_consensus.rs)
30+
is a [consensus engine](https://docs.substrate.io/v3/advanced/consensus) for Substrate that follows
31+
a Polkadot [relay chain](https://wiki.polkadot.network/docs/en/learn-architecture#relay-chain). This
32+
will run a Polkadot node internally, and dictate to the client and synchronization algorithms which
33+
chain to follow,
34+
[finalize](https://wiki.polkadot.network/docs/en/learn-consensus#probabilistic-vs-provable-finality),
35+
and treat as best.
36+
37+
### Collator
38+
39+
A Polkadot [collator](https://wiki.polkadot.network/docs/en/learn-collator) for the parachain is
40+
implemented by the `polkadot-parachain` binary (previously called `polkadot-collator`).
41+
42+
You may run `polkadot-parachain` locally after building it or using one of the container option
43+
described [here](./docs/container.md).
44+
45+
### Relay Chain Interaction
46+
To operate a parachain node, a connection to the corresponding relay
47+
chain is necessary. This can be achieved in one of three ways:
48+
1. Run a full relay chain node within the parachain node (default)
49+
2. Connect to an external relay chain node via WebSocket RPC
50+
3. Run a light client for the relay chain
51+
52+
#### In-process Relay Chain Node
53+
If an external relay chain node is not specified (default behavior), then a full relay chain node is
54+
spawned within the same process.
55+
56+
This node has all of the typical components of a regular Polkadot node and will have to fully sync
57+
with the relay chain to work.
58+
59+
##### Example command
60+
```bash
61+
polkadot-parachain \
62+
--chain parachain-chainspec.json \
63+
--tmp \
64+
-- \
65+
--chain relaychain-chainspec.json
66+
```
67+
68+
#### External Relay Chain Node
69+
An external relay chain node is connected via WebsSocket RPC by using the
70+
`--relay-chain-rpc-urls` command line argument. This option accepts one or more
71+
space-separated WebSocket URLs to a full relay chain node. By default, only the
72+
first URL will be used, with the rest as a backup in case the connection to the
73+
first node is lost.
74+
75+
Parachain nodes using this feature won't have to fully sync with the relay chain
76+
to work, so in general they will use fewer system resources.
77+
78+
**Note:** At this time, any parachain nodes using this feature will still spawn a
79+
significantly cut-down relay chain node in-process. Even though they lack the
80+
majority of normal Polkadot subsystems, they will still need to connect directly
81+
to the relay chain network.
82+
83+
##### Example command
84+
85+
```bash
86+
polkadot-parachain \
87+
--chain parachain-chainspec.json \
88+
--tmp \
89+
--relay-chain-rpc-urls \
90+
"ws://relaychain-rpc-endpoint:9944" \
91+
"ws://relaychain-rpc-endpoint-backup:9944" \
92+
-- \
93+
--chain relaychain-chainspec.json
94+
```
95+
96+
#### Relay Chain Light Client
97+
An internal relay chain light client provides a fast and lightweight approach
98+
for connecting to the relay chain network. It provides relay chain notifications
99+
and facilitates runtime calls.
100+
101+
To specify which chain the light client should connect to, users need to supply
102+
a relay chain chain-spec as part of the relay chain arguments.
103+
104+
**Note:** At this time, any parachain nodes using this feature will still spawn
105+
a significantly cut-down relay chain node in-process. Even though they lack the
106+
majority of normal Polkadot subsystems, they will still need to connect directly
107+
to the relay chain network.
108+
109+
110+
##### Example command
111+
```bash
112+
polkadot-parachain \
113+
--chain parachain-chainspec.json \
114+
--tmp \
115+
--relay-chain-light-client \
116+
-- \
117+
--chain relaychain-chainspec.json
118+
```
119+
120+
## Installation and Setup
121+
Before building Cumulus SDK based nodes / runtimes prepare your environment by
122+
following Substrate [installation instructions](https://docs.substrate.io/main-docs/install/).
123+
124+
To launch a local network, you can use [zombienet](https://github.com/paritytech/zombienet)
125+
for quick setup and experimentation or follow the [manual setup](#manual-setup).
126+
127+
### Zombienet
128+
We use Zombienet to spin up networks for integration tests and local networks.
129+
Follow [these installation steps](https://github.com/paritytech/zombienet#requirements-by-provider)
130+
to set it up on your machine. A simple network specification with two relay chain
131+
nodes and one collator is located at [zombienet/examples/small_network.toml](zombienet/examples/small_network.toml).
132+
133+
#### Which provider should I use?
134+
Zombienet offers multiple providers to run networks. Choose the one that best fits your needs:
135+
- **Podman:** Choose this if you want to spin up a network quick and easy.
136+
- **Native:** Choose this if you want to develop and deploy your changes. Requires compilation
137+
of the binaries.
138+
- **Kubernetes:** Choose this for advanced use-cases or running on cloud-infrastructure.
139+
140+
#### How to run
141+
To run the example network, use the following commands:
142+
```bash
143+
# Podman provider
144+
zombienet --provider podman spawn ./zombienet/examples/small_network.toml
145+
146+
# Native provider, assumes polkadot and polkadot-parachains binary in $PATH
147+
zombienet --provider native spawn ./zombienet/examples/small_network.toml
148+
```
149+
150+
### Manual Setup
151+
#### Launch the Relay Chain
152+
153+
```bash
154+
# Clone
155+
git clone https://github.com/paritytech/polkadot-sdk
156+
157+
# Compile Polkadot
158+
cargo build --release --bin polkadot
159+
160+
# Generate a raw chain spec
161+
./target/release/polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > rococo-local-cfde.json
162+
163+
# Alice
164+
./target/release/polkadot --chain rococo-local-cfde.json --alice --tmp
165+
166+
# Bob (In a separate terminal)
167+
./target/release/polkadot --chain rococo-local-cfde.json --bob --tmp --port 30334
168+
```
169+
170+
#### Launch the Parachain
171+
172+
```bash
173+
# Clone
174+
git clone https://github.com/paritytech/polkadot-sdk
175+
176+
# Compile
177+
cargo build --release --bin polkadot-parachain
178+
179+
# Export genesis state
180+
./target/release/polkadot-parachain export-genesis-state > genesis-state
181+
182+
# Export genesis wasm
183+
./target/release/polkadot-parachain export-genesis-wasm > genesis-wasm
184+
185+
# Collator1
186+
./target/release/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --rpc-port 9946 -- --chain ../polkadot/rococo-local-cfde.json --port 30335
187+
188+
# Collator2
189+
./target/release/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --rpc-port 9947 -- --chain ../polkadot/rococo-local-cfde.json --port 30336
190+
191+
# Parachain Full Node 1
192+
./target/release/polkadot-parachain --tmp --port 40337 --rpc-port 9948 -- --chain ../polkadot/rococo-local-cfde.json --port 30337
193+
```
194+
195+
#### Register the parachain
196+
197+
![image](https://user-images.githubusercontent.com/2915325/99548884-1be13580-2987-11eb-9a8b-20be658d34f9.png)
198+
199+
200+
## Asset Hub 🪙
201+
202+
This repository also contains the Asset Hub runtimes. Asset Hub is a system parachain
203+
providing an asset store for the Polkadot ecosystem.
204+
205+
### Build & Launch a Node
206+
207+
To run an Asset Hub node, you will need to compile the `polkadot-parachain` binary:
208+
209+
```bash
210+
cargo build --release --locked --bin polkadot-parachain
211+
```
212+
213+
Once the executable is built, launch the parachain node via:
214+
215+
```bash
216+
CHAIN=asset-hub-westend # or asset-hub-kusama
217+
./target/release/polkadot-parachain --chain $CHAIN
218+
```
219+
220+
Refer to the [setup instructions](#manual-setup) to run a local network for development.
221+
222+
## Contracts 📝
223+
224+
See [the `contracts-rococo` readme](parachains/runtimes/contracts/contracts-rococo/README.md) for details.
225+
226+
## Bridge-hub 📝
227+
228+
See [the `bridge-hubs` readme](parachains/runtimes/bridge-hubs/README.md) for details.
229+
230+
## Rococo 👑
231+
[Rococo](https://polkadot.js.org/apps/?rpc=wss://rococo-rpc.polkadot.io) is becoming a
232+
[Community Parachain Testbed](https://polkadot.network/blog/rococo-revamp-becoming-a-community-parachain-testbed/)
233+
for parachain teams in the Polkadot ecosystem. It supports multiple parachains with the
234+
differentiation of long-term connections and recurring short-term connections, to see
235+
which parachains are currently connected and how long they will be connected for
236+
[see here](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains).
237+
238+
Rococo is an elaborate style of design and the name describes the painstaking effort that
239+
has gone into this project.
240+
241+
### Build & Launch Rococo Collators
242+
243+
Collators are similar to validators in the relay chain. These nodes build the blocks that
244+
will eventually be included by the relay chain for a parachain.
245+
246+
To run a Rococo collator you will need to compile the following binary:
247+
248+
249+
```bash
250+
cargo build --release --locked --bin polkadot-parachain
251+
```
252+
253+
Once the executable is built, launch collators for each parachain (repeat once each for chain
254+
`tick`, `trick`, `track`):
255+
256+
```bash
257+
./target/release/polkadot-parachain --chain $CHAIN --validator
258+
```
259+
260+
You can also build [using a container](./docs/container.md).
261+
262+
### Parachains
263+
264+
* [Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-statemint-rpc.polkadot.io#/explorer)
265+
* [Contracts on Rococo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/explorer)
266+
* [RILT](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.kilt.io#/explorer)
267+
268+
The network uses horizontal message passing (HRMP) to enable communication between
269+
parachains and the relay chain and, in turn, between parachains. This means that every
270+
message is sent to the relay chain, and from the relay chain to its destination parachain.

0 commit comments

Comments
 (0)