mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +00:00
d742e88e79
* client/authority-discovery: Allow to be run by sentry node When run as a sentry node, the authority discovery module does not publish any addresses to the dht, but still discovers validators and sentry nodes of validators. * client/authority-discovery/src/lib: Wrap lines at 100 characters * client/authority-discovery: Remove TODO and unused import * client/authority-discovery: Pass role to new unit tests * client/authority-discovery: Apply suggestions Co-Authored-By: André Silva <123550+andresilva@users.noreply.github.com> * bin/node/cli/src/service: Use expressions instead of statements Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
172 lines
4.5 KiB
YAML
172 lines
4.5 KiB
YAML
# Docker compose file to simulate a sentry node setup.
|
|
#
|
|
#
|
|
# Setup:
|
|
#
|
|
# Validator A is not supposed to be connected to the public internet. Instead it
|
|
# 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.
|
|
#
|
|
#
|
|
# Usage:
|
|
#
|
|
# 1. Build `target/release/substrate` binary: `cargo build --release`
|
|
#
|
|
# 2. Start networks and containers: `sudo docker-compose -f .maintain/sentry-node/docker-compose.yml up`
|
|
#
|
|
# 3. Reach:
|
|
# - polkadot/apps on localhost:3000
|
|
# - validator-a: localhost:9944
|
|
# - validator-b: localhost:9945
|
|
# - sentry-a: localhost:9946
|
|
# - grafana: localhost:3001
|
|
# - prometheus: localhost:9090
|
|
|
|
|
|
version: "3.7"
|
|
services:
|
|
|
|
validator-a:
|
|
ports:
|
|
- "9944:9944"
|
|
- "9615:9615"
|
|
volumes:
|
|
- ../../target/release/substrate:/usr/local/bin/substrate
|
|
image: parity/substrate
|
|
networks:
|
|
- network-a
|
|
command:
|
|
# Local node id: QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR
|
|
- "--node-key"
|
|
- "0000000000000000000000000000000000000000000000000000000000000001"
|
|
- "--base-path"
|
|
- "/tmp/alice"
|
|
- "--chain=local"
|
|
- "--port"
|
|
- "30333"
|
|
- "--validator"
|
|
- "--alice"
|
|
- "--sentry-nodes"
|
|
- "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
|
|
- "--reserved-nodes"
|
|
- "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
|
|
# 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"
|
|
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
|
|
- "--reserved-nodes"
|
|
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
|
|
- "--bootnodes"
|
|
- "/dns4/validator-b/tcp/30333/p2p/QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk"
|
|
- "--no-telemetry"
|
|
- "--rpc-cors"
|
|
- "all"
|
|
# Not only bind to localhost.
|
|
- "--unsafe-ws-external"
|
|
- "--unsafe-rpc-external"
|
|
- "--log"
|
|
- "sub-authority-discovery=trace"
|
|
- "--prometheus-external"
|
|
|
|
validator-b:
|
|
image: parity/substrate
|
|
ports:
|
|
- "9945:9944"
|
|
volumes:
|
|
- ../../target/release/substrate:/usr/local/bin/substrate
|
|
networks:
|
|
- internet
|
|
command:
|
|
# Local node id: QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk
|
|
- "--node-key"
|
|
- "0000000000000000000000000000000000000000000000000000000000000002"
|
|
- "--base-path"
|
|
- "/tmp/bob"
|
|
- "--chain=local"
|
|
- "--port"
|
|
- "30333"
|
|
- "--validator"
|
|
- "--bob"
|
|
- "--bootnodes"
|
|
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
|
|
- "--bootnodes"
|
|
- "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
|
|
- "--no-telemetry"
|
|
- "--rpc-cors"
|
|
- "all"
|
|
# Not only bind to localhost.
|
|
- "--unsafe-ws-external"
|
|
- "--unsafe-rpc-external"
|
|
- "--log"
|
|
- "sub-authority-discovery=trace"
|
|
- "--prometheus-external"
|
|
|
|
ui:
|
|
image: polkadot-js/apps
|
|
ports:
|
|
- "3000:80"
|
|
|
|
prometheus:
|
|
image: prom/prometheus
|
|
networks:
|
|
- network-a
|
|
- internet
|
|
ports:
|
|
- "9090:9090"
|
|
links:
|
|
- validator-a:validator-a
|
|
- sentry-a:sentry-a
|
|
- validator-b:validator-b
|
|
volumes:
|
|
- ./prometheus/:/etc/prometheus/
|
|
restart: always
|
|
|
|
grafana:
|
|
image: grafana/grafana
|
|
user: "104"
|
|
depends_on:
|
|
- prometheus
|
|
networks:
|
|
- network-a
|
|
- internet
|
|
ports:
|
|
- 3001:3000
|
|
volumes:
|
|
- ./grafana/provisioning/:/etc/grafana/provisioning
|
|
- ../monitoring/grafana-dashboards/:/etc/grafana/provisioning/dashboard-definitions
|
|
restart: always
|
|
|
|
networks:
|
|
network-a:
|
|
internet:
|