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

Commit 1baeefa

Browse files
authored
.maintain: Replace sentry-node with local-docker-test-network (#7943)
Sentry nodes are deprecated. Thus there is no need for `.maintain/sentry-node` to spin up a sentry node test environment. Instead this commit rewrites the setup to contain two full-connected validators and one light client. With the steps below one can now spin up a local test network with two validators, one light-client, Prometheus and Grafana. - cargo build --release - sudo docker-compose -f .maintain/local-docker-test-network/docker-compose.yml up
1 parent d5bdd81 commit 1baeefa

File tree

4 files changed

+36
-49
lines changed

4 files changed

+36
-49
lines changed

.maintain/sentry-node/docker-compose.yml renamed to .maintain/local-docker-test-network/docker-compose.yml

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
# Docker compose file to simulate a sentry node setup.
1+
# Docker compose file to start a multi node local test network.
22
#
3+
# # Nodes
34
#
4-
# Setup:
5+
# - Validator node A
6+
# - Validator node B
7+
# - Light client C
58
#
6-
# Validator A is not supposed to be connected to the public internet. Instead it
7-
# connects to a sentry node (sentry-a) which connects to the public internet.
8-
# Validator B can reach validator A via sentry node A and vice versa.
9+
# # Auxiliary nodes
910
#
11+
# - Prometheus monitoring each node.
12+
# - Grafana pointed at the Prometheus node, configured with all dashboards.
1013
#
11-
# Usage:
14+
# # Usage
1215
#
1316
# 1. Build `target/release/substrate` binary: `cargo build --release`
14-
#
15-
# 2. Start networks and containers: `sudo docker-compose -f .maintain/sentry-node/docker-compose.yml up`
16-
#
17-
# 3. Reach:
18-
# - polkadot/apps on localhost:3000
17+
# 2. Start networks and containers:
18+
# `sudo docker-compose -f .maintain/sentry-node/docker-compose.yml up`
19+
# 3. Connect to nodes:
1920
# - validator-a: localhost:9944
2021
# - validator-b: localhost:9945
21-
# - sentry-a: localhost:9946
22+
# - light-c: localhost:9946
23+
# - via polkadot.js/apps: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2Flocalhost%3A<NODE_PORT>#/explorer
2224
# - grafana: localhost:3001
2325
# - prometheus: localhost:9090
2426

@@ -34,9 +36,8 @@ services:
3436
- ../../target/release/substrate:/usr/local/bin/substrate
3537
image: parity/substrate
3638
networks:
37-
- network-a
39+
- internet
3840
command:
39-
# Local node id: QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR
4041
- "--node-key"
4142
- "0000000000000000000000000000000000000000000000000000000000000001"
4243
- "--base-path"
@@ -46,102 +47,89 @@ services:
4647
- "30333"
4748
- "--validator"
4849
- "--alice"
49-
- "--sentry-nodes"
50-
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
51-
- "--reserved-nodes"
52-
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
50+
- "--bootnodes"
51+
- "/dns/validator-b/tcp/30333/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD"
5352
# Not only bind to localhost.
5453
- "--unsafe-ws-external"
5554
- "--unsafe-rpc-external"
56-
# - "--log"
57-
# - "sub-libp2p=trace"
58-
# - "--log"
59-
# - "afg=trace"
6055
- "--log"
61-
- "sub-authority-discovery=trace"
56+
- "sub-libp2p=trace"
6257
- "--no-telemetry"
6358
- "--rpc-cors"
6459
- "all"
6560
- "--prometheus-external"
6661

67-
sentry-a:
62+
validator-b:
6863
image: parity/substrate
6964
ports:
70-
- "9946:9944"
65+
- "9945:9944"
7166
volumes:
7267
- ../../target/release/substrate:/usr/local/bin/substrate
7368
networks:
74-
- network-a
7569
- internet
7670
command:
77-
# Local node id: QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi
7871
- "--node-key"
79-
- "0000000000000000000000000000000000000000000000000000000000000003"
72+
- "0000000000000000000000000000000000000000000000000000000000000002"
8073
- "--base-path"
81-
- "/tmp/sentry"
74+
- "/tmp/bob"
8275
- "--chain=local"
8376
- "--port"
8477
- "30333"
85-
- "--sentry"
86-
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
87-
- "--reserved-nodes"
88-
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
78+
- "--validator"
79+
- "--bob"
8980
- "--bootnodes"
90-
- "/dns/validator-b/tcp/30333/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD"
81+
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
9182
- "--no-telemetry"
9283
- "--rpc-cors"
9384
- "all"
9485
# Not only bind to localhost.
9586
- "--unsafe-ws-external"
9687
- "--unsafe-rpc-external"
9788
- "--log"
98-
- "sub-authority-discovery=trace"
89+
- "sub-libp2p=trace"
9990
- "--prometheus-external"
10091

101-
validator-b:
92+
light-c:
10293
image: parity/substrate
10394
ports:
104-
- "9945:9944"
95+
- "9946:9944"
10596
volumes:
10697
- ../../target/release/substrate:/usr/local/bin/substrate
10798
networks:
10899
- internet
109100
command:
110-
# Local node id: QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk
111101
- "--node-key"
112-
- "0000000000000000000000000000000000000000000000000000000000000002"
102+
- "0000000000000000000000000000000000000000000000000000000000000003"
113103
- "--base-path"
114-
- "/tmp/bob"
104+
- "/tmp/light"
115105
- "--chain=local"
116106
- "--port"
117107
- "30333"
118-
- "--validator"
119-
- "--bob"
108+
- "--light"
120109
- "--bootnodes"
121110
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
122111
- "--bootnodes"
123-
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
112+
- "/dns/validator-b/tcp/30333/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD"
124113
- "--no-telemetry"
125114
- "--rpc-cors"
126115
- "all"
127116
# Not only bind to localhost.
128117
- "--unsafe-ws-external"
129118
- "--unsafe-rpc-external"
130119
- "--log"
131-
- "sub-authority-discovery=trace"
120+
- "sub-libp2p=trace"
132121
- "--prometheus-external"
133122

134123
prometheus:
135124
image: prom/prometheus
136125
networks:
137-
- network-a
138126
- internet
139127
ports:
140128
- "9090:9090"
141129
links:
142130
- validator-a:validator-a
143-
- sentry-a:sentry-a
144131
- validator-b:validator-b
132+
- light-c:light-c
145133
volumes:
146134
- ./prometheus/:/etc/prometheus/
147135
restart: always
@@ -152,7 +140,6 @@ services:
152140
depends_on:
153141
- prometheus
154142
networks:
155-
- network-a
156143
- internet
157144
ports:
158145
- 3001:3000

.maintain/sentry-node/prometheus/prometheus.yml renamed to .maintain/local-docker-test-network/prometheus/prometheus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ scrape_configs:
77
- targets: ['validator-a:9615']
88
labels:
99
network: dev
10-
- targets: ['sentry-a:9615']
10+
- targets: ['validator-b:9615']
1111
labels:
1212
network: dev
13-
- targets: ['validator-b:9615']
13+
- targets: ['light-c:9615']
1414
labels:
1515
network: dev

0 commit comments

Comments
 (0)