mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
3f629f743b
* client/network: Add scaffolding for finality req to use req resp #sc * client/network/src/finality_requests: Remove * client/network/src/behaviour: Pass request id down to sync * client/network: Use request response for block requests * client/network: Move handler logic into *_*_handler.rs * client/network: Track ongoing finality requests in protocol.rs * client/network: Remove commented out finalization initialization * client/network: Add docs for request handlers * client/network/finality_request_handler: Log errors * client/network/block_request_handler: Log errors * client/network: Format * client/network: Handle block request failure * protocols/network: Fix tests * client/network/src/behaviour: Handle request sending errors * client/network: Move response handling into custom method * client/network/protocol: Handle block response errors * client/network/protocol: Remove tracking of obsolete requests * client/network/protocol: Remove block request start time tracking This will be handled generically via request-responses. * client/network/protocol: Refactor on_*_request_started * client/network: Pass protocol config instead of protocol name * client/network: Pass protocol config in tests * client/network/config: Document request response configs * client/network/src/_request_handler: Document protocol config gen * client/network/src/protocol: Document Peer request values * client/network: Rework request response to always use oneshot * client/network: Unified metric reporting for all request protocols * client/network: Move protobuf parsing into protocol.rs * client/network/src/protocol: Return pending events after poll * client/network: Improve error handling and documentation * client/network/behaviour: Remove outdated error types * Update client/network/src/block_request_handler.rs Co-authored-by: Ashley <ashley.ruglys@gmail.com> * Update client/network/src/finality_request_handler.rs Co-authored-by: Ashley <ashley.ruglys@gmail.com> * client/network/protocol: Reduce reputation on timeout * client/network/protocol: Refine reputation changes * client/network/block_request_handler: Set and explain queue length * client/service: Deny block requests when light client * client/service: Fix role matching * client: Enforce line width * client/network/request_responses: Fix unit tests * client/network: Expose time to build response via metrics * client/network/request_responses: Fix early connection closed error * client/network/protocol: Fix line length * client/network/protocol: Disconnect on most request failures * client/network/protocol: Disconnect peer when oneshot is canceled * client/network/protocol: Disconnect peer even when connection closed * client/network/protocol: Remove debugging log line * client/network/request_response: Use Clone::clone for error * client/network/request_response: Remove outdated comment With libp2p v0.33.0 libp2p-request-response properly sends inbound failures on connections being closed. Co-authored-by: Addie Wagenknecht <addie@nortd.com> Co-authored-by: Ashley <ashley.ruglys@gmail.com>
167 lines
4.4 KiB
YAML
167 lines
4.4 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"
|
|
- "/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"
|
|
- "/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-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"
|
|
- "/dns/validator-a/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"
|
|
- "--bootnodes"
|
|
- "/dns/sentry-a/tcp/30333/p2p/12D3KooWSCufgHzV4fCwRijfH2k3abrpAJxTKxEvN1FDuRXA2U9x"
|
|
- "--no-telemetry"
|
|
- "--rpc-cors"
|
|
- "all"
|
|
# Not only bind to localhost.
|
|
- "--unsafe-ws-external"
|
|
- "--unsafe-rpc-external"
|
|
- "--log"
|
|
- "sub-authority-discovery=trace"
|
|
- "--prometheus-external"
|
|
|
|
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:
|