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

Commit

Permalink
client: Introduce --sentry-nodes flag (#4285)
Browse files Browse the repository at this point in the history
* client/authority-discovery: Add smoke tests for intervall_at

* client/authority-discovery: Fix interval_at to fire on start

* .maintain/sentry-node: Update docker compose file

* client: Introduce --sentry-nodes flag

Enable operators to specify the public addresses of sentry nodes infront
of a validator node so that the validator node can announce the sentry
node addresses instead of its own public addresses on the DHT via the
authority discovery module.

* client/authority-discovery: Break lines at 100 characters

Limit line length to 100 instead of 120 characters.
  • Loading branch information
mxinden authored and gavofyork committed Dec 3, 2019
1 parent 042dc45 commit e2e3c24
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 80 deletions.
32 changes: 14 additions & 18 deletions .maintain/sentry-node/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ services:
- "--base-path"
- "/tmp/alice"
- "--chain=local"
- "--key"
- "//Alice"
- "--port"
- "30333"
- "--validator"
- "--name"
- "AlicesNode"
- "--alice"
- "--sentry-nodes"
- "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
- "--reserved-nodes"
- "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
# Not only bind to localhost.
Expand All @@ -54,6 +53,8 @@ services:
# - "sub-libp2p=trace"
# - "--log"
# - "afg=trace"
- "--log"
- "sub-authority-discovery=trace"
- "--no-telemetry"
- "--rpc-cors"
- "all"
Expand All @@ -74,28 +75,24 @@ services:
- "--base-path"
- "/tmp/sentry"
- "--chain=local"
# Don't configure a key, as sentry-a is not a validator.
# - "--key"
# - "//Charlie"
- "--port"
- "30333"
# sentry-a is not a validator.
# - "--validator"
- "--name"
- "CharliesNode"
- "--charlie"
- "--bootnodes"
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- "--bootnodes"
- "/dns4/validator-b/tcp/30333/p2p/QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk"
- "--reserved-nodes"
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- "--no-telemetry"
- "--rpc-cors"
- "all"
# Not only bind to localhost.
- "--ws-external"
- "--rpc-external"
# Make sure sentry-a still participates as a grandpa voter to forward
# grandpa finality gossip messages.
- "--grandpa-voter"
- "--log"
- "sub-authority-discovery=trace"
- "--sentry"

validator-b:
image: parity/substrate
Expand All @@ -112,13 +109,10 @@ services:
- "--base-path"
- "/tmp/bob"
- "--chain=local"
- "--key"
- "//Bob"
- "--port"
- "30333"
- "--validator"
- "--name"
- "BobsNode"
- "--bob"
- "--bootnodes"
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- "--bootnodes"
Expand All @@ -129,6 +123,8 @@ services:
# Not only bind to localhost.
- "--ws-external"
- "--rpc-external"
- "--log"
- "sub-authority-discovery=trace"

ui:
image: polkadot-js/apps
Expand Down
7 changes: 5 additions & 2 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ macro_rules! new_full {
is_authority,
force_authoring,
name,
disable_grandpa
disable_grandpa,
sentry_nodes,
) = (
$config.roles.is_authority(),
$config.force_authoring,
$config.name.clone(),
$config.disable_grandpa
$config.disable_grandpa,
$config.network.sentry_nodes.clone(),
);

// sentry nodes announce themselves as authorities to the network
Expand Down Expand Up @@ -194,6 +196,7 @@ macro_rules! new_full {
let authority_discovery = authority_discovery::AuthorityDiscovery::new(
service.client(),
service.network(),
sentry_nodes,
service.keystore(),
future03_dht_event_rx,
);
Expand Down
Loading

0 comments on commit e2e3c24

Please sign in to comment.