mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
.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
This commit is contained in:
+52
-65
@@ -1,24 +1,26 @@
|
|||||||
# Docker compose file to simulate a sentry node setup.
|
# Docker compose file to start a multi node local test network.
|
||||||
#
|
#
|
||||||
|
# # Nodes
|
||||||
#
|
#
|
||||||
# Setup:
|
# - Validator node A
|
||||||
|
# - Validator node B
|
||||||
|
# - Light client C
|
||||||
#
|
#
|
||||||
# Validator A is not supposed to be connected to the public internet. Instead it
|
# # Auxiliary nodes
|
||||||
# connects to a sentry node (sentry-a) which connects to the public internet.
|
|
||||||
# Validator B can reach validator A via sentry node A and vice versa.
|
|
||||||
#
|
#
|
||||||
|
# - Prometheus monitoring each node.
|
||||||
|
# - Grafana pointed at the Prometheus node, configured with all dashboards.
|
||||||
#
|
#
|
||||||
# Usage:
|
# # Usage
|
||||||
#
|
#
|
||||||
# 1. Build `target/release/substrate` binary: `cargo build --release`
|
# 1. Build `target/release/substrate` binary: `cargo build --release`
|
||||||
#
|
# 2. Start networks and containers:
|
||||||
# 2. Start networks and containers: `sudo docker-compose -f .maintain/sentry-node/docker-compose.yml up`
|
# `sudo docker-compose -f .maintain/sentry-node/docker-compose.yml up`
|
||||||
#
|
# 3. Connect to nodes:
|
||||||
# 3. Reach:
|
|
||||||
# - polkadot/apps on localhost:3000
|
|
||||||
# - validator-a: localhost:9944
|
# - validator-a: localhost:9944
|
||||||
# - validator-b: localhost:9945
|
# - validator-b: localhost:9945
|
||||||
# - sentry-a: localhost:9946
|
# - light-c: localhost:9946
|
||||||
|
# - via polkadot.js/apps: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2Flocalhost%3A<NODE_PORT>#/explorer
|
||||||
# - grafana: localhost:3001
|
# - grafana: localhost:3001
|
||||||
# - prometheus: localhost:9090
|
# - prometheus: localhost:9090
|
||||||
|
|
||||||
@@ -34,9 +36,8 @@ services:
|
|||||||
- ../../target/release/substrate:/usr/local/bin/substrate
|
- ../../target/release/substrate:/usr/local/bin/substrate
|
||||||
image: parity/substrate
|
image: parity/substrate
|
||||||
networks:
|
networks:
|
||||||
- network-a
|
- internet
|
||||||
command:
|
command:
|
||||||
# Local node id: QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR
|
|
||||||
- "--node-key"
|
- "--node-key"
|
||||||
- "0000000000000000000000000000000000000000000000000000000000000001"
|
- "0000000000000000000000000000000000000000000000000000000000000001"
|
||||||
- "--base-path"
|
- "--base-path"
|
||||||
@@ -46,56 +47,16 @@ services:
|
|||||||
- "30333"
|
- "30333"
|
||||||
- "--validator"
|
- "--validator"
|
||||||
- "--alice"
|
- "--alice"
|
||||||
- "--sentry-nodes"
|
|
||||||
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
|
|
||||||
- "--reserved-nodes"
|
|
||||||
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
|
|
||||||
# Not only bind to localhost.
|
|
||||||
- "--unsafe-ws-external"
|
|
||||||
- "--unsafe-rpc-external"
|
|
||||||
# - "--log"
|
|
||||||
# - "sub-libp2p=trace"
|
|
||||||
# - "--log"
|
|
||||||
# - "afg=trace"
|
|
||||||
- "--log"
|
|
||||||
- "sub-authority-discovery=trace"
|
|
||||||
- "--no-telemetry"
|
|
||||||
- "--rpc-cors"
|
|
||||||
- "all"
|
|
||||||
- "--prometheus-external"
|
|
||||||
|
|
||||||
sentry-a:
|
|
||||||
image: parity/substrate
|
|
||||||
ports:
|
|
||||||
- "9946:9944"
|
|
||||||
volumes:
|
|
||||||
- ../../target/release/substrate:/usr/local/bin/substrate
|
|
||||||
networks:
|
|
||||||
- network-a
|
|
||||||
- internet
|
|
||||||
command:
|
|
||||||
# Local node id: QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi
|
|
||||||
- "--node-key"
|
|
||||||
- "0000000000000000000000000000000000000000000000000000000000000003"
|
|
||||||
- "--base-path"
|
|
||||||
- "/tmp/sentry"
|
|
||||||
- "--chain=local"
|
|
||||||
- "--port"
|
|
||||||
- "30333"
|
|
||||||
- "--sentry"
|
|
||||||
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
|
|
||||||
- "--reserved-nodes"
|
|
||||||
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
|
|
||||||
- "--bootnodes"
|
- "--bootnodes"
|
||||||
- "/dns/validator-b/tcp/30333/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD"
|
- "/dns/validator-b/tcp/30333/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD"
|
||||||
- "--no-telemetry"
|
|
||||||
- "--rpc-cors"
|
|
||||||
- "all"
|
|
||||||
# Not only bind to localhost.
|
# Not only bind to localhost.
|
||||||
- "--unsafe-ws-external"
|
- "--unsafe-ws-external"
|
||||||
- "--unsafe-rpc-external"
|
- "--unsafe-rpc-external"
|
||||||
- "--log"
|
- "--log"
|
||||||
- "sub-authority-discovery=trace"
|
- "sub-libp2p=trace"
|
||||||
|
- "--no-telemetry"
|
||||||
|
- "--rpc-cors"
|
||||||
|
- "all"
|
||||||
- "--prometheus-external"
|
- "--prometheus-external"
|
||||||
|
|
||||||
validator-b:
|
validator-b:
|
||||||
@@ -107,7 +68,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internet
|
- internet
|
||||||
command:
|
command:
|
||||||
# Local node id: QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk
|
|
||||||
- "--node-key"
|
- "--node-key"
|
||||||
- "0000000000000000000000000000000000000000000000000000000000000002"
|
- "0000000000000000000000000000000000000000000000000000000000000002"
|
||||||
- "--base-path"
|
- "--base-path"
|
||||||
@@ -119,8 +79,6 @@ services:
|
|||||||
- "--bob"
|
- "--bob"
|
||||||
- "--bootnodes"
|
- "--bootnodes"
|
||||||
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
|
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
|
||||||
- "--bootnodes"
|
|
||||||
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
|
|
||||||
- "--no-telemetry"
|
- "--no-telemetry"
|
||||||
- "--rpc-cors"
|
- "--rpc-cors"
|
||||||
- "all"
|
- "all"
|
||||||
@@ -128,20 +86,50 @@ services:
|
|||||||
- "--unsafe-ws-external"
|
- "--unsafe-ws-external"
|
||||||
- "--unsafe-rpc-external"
|
- "--unsafe-rpc-external"
|
||||||
- "--log"
|
- "--log"
|
||||||
- "sub-authority-discovery=trace"
|
- "sub-libp2p=trace"
|
||||||
|
- "--prometheus-external"
|
||||||
|
|
||||||
|
light-c:
|
||||||
|
image: parity/substrate
|
||||||
|
ports:
|
||||||
|
- "9946:9944"
|
||||||
|
volumes:
|
||||||
|
- ../../target/release/substrate:/usr/local/bin/substrate
|
||||||
|
networks:
|
||||||
|
- internet
|
||||||
|
command:
|
||||||
|
- "--node-key"
|
||||||
|
- "0000000000000000000000000000000000000000000000000000000000000003"
|
||||||
|
- "--base-path"
|
||||||
|
- "/tmp/light"
|
||||||
|
- "--chain=local"
|
||||||
|
- "--port"
|
||||||
|
- "30333"
|
||||||
|
- "--light"
|
||||||
|
- "--bootnodes"
|
||||||
|
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
|
||||||
|
- "--bootnodes"
|
||||||
|
- "/dns/validator-b/tcp/30333/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD"
|
||||||
|
- "--no-telemetry"
|
||||||
|
- "--rpc-cors"
|
||||||
|
- "all"
|
||||||
|
# Not only bind to localhost.
|
||||||
|
- "--unsafe-ws-external"
|
||||||
|
- "--unsafe-rpc-external"
|
||||||
|
- "--log"
|
||||||
|
- "sub-libp2p=trace"
|
||||||
- "--prometheus-external"
|
- "--prometheus-external"
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: prom/prometheus
|
image: prom/prometheus
|
||||||
networks:
|
networks:
|
||||||
- network-a
|
|
||||||
- internet
|
- internet
|
||||||
ports:
|
ports:
|
||||||
- "9090:9090"
|
- "9090:9090"
|
||||||
links:
|
links:
|
||||||
- validator-a:validator-a
|
- validator-a:validator-a
|
||||||
- sentry-a:sentry-a
|
|
||||||
- validator-b:validator-b
|
- validator-b:validator-b
|
||||||
|
- light-c:light-c
|
||||||
volumes:
|
volumes:
|
||||||
- ./prometheus/:/etc/prometheus/
|
- ./prometheus/:/etc/prometheus/
|
||||||
restart: always
|
restart: always
|
||||||
@@ -152,7 +140,6 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- prometheus
|
- prometheus
|
||||||
networks:
|
networks:
|
||||||
- network-a
|
|
||||||
- internet
|
- internet
|
||||||
ports:
|
ports:
|
||||||
- 3001:3000
|
- 3001:3000
|
||||||
+3
-3
@@ -7,9 +7,9 @@ scrape_configs:
|
|||||||
- targets: ['validator-a:9615']
|
- targets: ['validator-a:9615']
|
||||||
labels:
|
labels:
|
||||||
network: dev
|
network: dev
|
||||||
- targets: ['sentry-a:9615']
|
|
||||||
labels:
|
|
||||||
network: dev
|
|
||||||
- targets: ['validator-b:9615']
|
- targets: ['validator-b:9615']
|
||||||
labels:
|
labels:
|
||||||
network: dev
|
network: dev
|
||||||
|
- targets: ['light-c:9615']
|
||||||
|
labels:
|
||||||
|
network: dev
|
||||||
Reference in New Issue
Block a user