Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 7e799e7

Browse files
skunertkoutemichalkucharczyk
authored
README: Document usage of RPC node (#2313)
* Update readme * Improve * Apply suggestions from code review Co-authored-by: Koute <koute@users.noreply.github.com> * Quote urls * Apply suggestions from code review Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> --------- Co-authored-by: Koute <koute@users.noreply.github.com> Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
1 parent 14b9db5 commit 7e799e7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,39 @@ and treat as best.
3737
A Polkadot [collator](https://wiki.polkadot.network/docs/en/learn-collator) for the parachain is
3838
implemented by the `polkadot-parachain` binary (previously called `polkadot-collator`).
3939

40+
### Relaychain Interaction
41+
To operate a parachain node a connection to the corresponding relaychain is necessary. This can be achieved in one of two ways:
42+
1. Run a full relaychain node within the parachain node (default)
43+
2. Connect to an external relaychain node via websocket RPC
44+
45+
#### In-process Relaychain Node
46+
If an external relaychain node is not specified (default behavior) then a full relaychain node will be spawned within the same process.
47+
48+
This node has all of the typical components of a normal Polkadot node, and will have to fully sync with the relaychain to work.
49+
50+
##### Example command
51+
```shell=
52+
# In-process node with this chainspec is spawned
53+
# |
54+
# |-----------------------|
55+
polkadot-parachain --chain parachain-chainspec.json --tmp -- --chain relaychain-chainspec.json
56+
```
57+
58+
#### External Relaychain Node
59+
An external relaychain node can be connected via websocket RPC by using the `--relay-chain-rpc-urls` command line argument. This option accepts one or more space-separated websocket URLs to a full relay chain node. By default only the first URL will be used, with the rest acting as a backup in case the connection to the first node will be lost.
60+
61+
Parachain nodes using this feature won't have to fully sync with the relay chain to work, so in general they will use significantly less system resources.
62+
63+
**Note:** At this time any parachain nodes using this feature will still spawn a very cut down relaychain node in-process, hence even though they lack the majority of normal Polkadot subsystems they will still need to be able to directly connect to the relay chain network.
64+
##### Example command
65+
```shell=
66+
# Perform runtime calls and fetch Still required since we connect
67+
# data via RPC from here. Backup node to the relaychain network
68+
# | | |
69+
# |---------------------------------| |----------------------------------------| |-----------------------|
70+
polkadot-parachain --chain parachain-chainspec.json --tmp --relay-chain-rpc-urls "ws://relaychain-rpc-endpoint:9944" "ws://relaychain-rpc-endpoint-backup:9944" -- --chain relaychain-chainspec.json
71+
```
72+
4073
## Installation and Setup
4174
Before building Cumulus SDK based nodes / runtimes prepare your environment by following Substrate [installation instructions](https://docs.substrate.io/main-docs/install/).
4275

0 commit comments

Comments
 (0)