Skip to content

Commit e34e02c

Browse files
authored
Support standalone node for parachain (#1059)
* use unified crate version and cargo update * initial add standalone mode * fix chain spec id * fix clippy * add script to start standalone node * add Makefile * use 9944 as parachain port consistently * adjust bridge endpoint * minor update * recover docker image * minor update * bump version * update README
1 parent 01ab120 commit e34e02c

36 files changed

+491
-107
lines changed

.github/workflows/release-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
release-bot:
88
runs-on: ubuntu-latest
99
# this means the release contains a new docker image (thus a new client)
10-
if: contains(github.event.release.body, 'docker')
10+
if: contains(github.event.release.body, 'litentry/litentry-parachain:v')
1111
steps:
1212
- name: Post discord message
1313
env:

Cargo.lock

Lines changed: 42 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ build-node-tryruntime:
7474
cargo build --locked --features try-runtime --release
7575

7676
# launch a local network
77+
78+
.PHONY: launch-standalone ## Launch a local standalone node without relaychain network
79+
launch-standalone:
80+
@./scripts/launch-standalone.sh
81+
7782
.PHONY: launch-docker-bridge
7883
launch-docker-bridge:
7984
@./scripts/launch-local-bridge-docker.sh

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ The wasms should be located under `target/release/wbuild/litentry-parachain-runt
4242

4343
Similarly, use `make build-runtime-litmus` and `make build-runtime-rococo` to build the litmus-parachain-runtime and rococo-parachain-runtime, respectively.
4444

45-
## launch of local network
45+
## launch a standalone node
46+
47+
Simply run
48+
```
49+
make launch-standalone
50+
```
51+
A standalone node will be launched without relaychain, where blocks are finalised immediately. The node is accessible via ws 9944 port.
52+
53+
## launch a local network with relaychain + parachain
4654

4755
The following steps take rococo-parachain for example, because `sudo` will be removed for litentry-parachain and [was removed](https://github.com/litentry/litentry-parachain/issues/775) for litmus-parachain. But generally speaking, lauching a local network works with either of the three chain-settings.
4856

@@ -78,6 +86,8 @@ In this case we could try to launch the network with raw binaries.
7886
- you should have locally compiled binaries, for both `polkadot` and `litentry-collator`
7987
- run `./scripts/launch-local-binary.sh rococo path-to-polkadot-bin path-to-litentry-parachain-bin`
8088

89+
After launching, the parachain node is reachable via ws 9944 port and the relaychain nodes are reachable via ws 9946/9947 ports.
90+
8191
When finished with the network, run
8292
```
8393
make clean-binary

docker/litentry-parachain-launch-config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ relaychain:
1313
- --execution=wasm
1414
nodes:
1515
- name: alice
16+
wsPort: 9946
17+
rpcPort: 9936
18+
port: 30336
1619
- name: bob
20+
wsPort: 9947
21+
rpcPort: 9937
22+
port: 30337
1723

1824
# Parachain Configuration
1925
parachains:
@@ -34,3 +40,6 @@ parachains:
3440
nodes:
3541
- flags:
3642
- --alice
43+
wsPort: 9944
44+
rpcPort: 9933
45+
port: 30333

docker/litmus-parachain-launch-config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ relaychain:
1313
- --execution=wasm
1414
nodes:
1515
- name: alice
16+
wsPort: 9946
17+
rpcPort: 9936
18+
port: 30336
1619
- name: bob
20+
wsPort: 9947
21+
rpcPort: 9937
22+
port: 30337
1723

1824
# Parachain Configuration
1925
parachains:
@@ -33,3 +39,6 @@ parachains:
3339
nodes:
3440
- flags:
3541
- --alice
42+
wsPort: 9944
43+
rpcPort: 9933
44+
port: 30333

docker/rococo-parachain-launch-config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ relaychain:
1313
- --execution=wasm
1414
nodes:
1515
- name: alice
16+
wsPort: 9946
17+
rpcPort: 9936
18+
port: 30336
1619
- name: bob
20+
wsPort: 9947
21+
rpcPort: 9937
22+
port: 30337
1723

1824
# Parachain Configuration
1925
parachains:
@@ -33,3 +39,6 @@ parachains:
3339
nodes:
3440
- flags:
3541
- --alice
42+
wsPort: 9944
43+
rpcPort: 9933
44+
port: 30333

mock-tee-primitives/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version = "0.1.0"
77
[dependencies]
88
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
99
hex = { version = "0.4.3", default-features = false, optional = true }
10-
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
10+
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }
1111
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
1212
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
1313
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false }

0 commit comments

Comments
 (0)