فهرست منبع

contrib: add dchatd localnet for minimal net testing

draoi 2 سال پیش
والد
کامیت
9bcb691c65

+ 23 - 0
contrib/localnet/dchatd-four-nodes/dchat1.toml

@@ -0,0 +1,23 @@
+# dchat toml
+
+## RPC listen address. 
+rpc_listen="tcp://127.0.0.1:51345"
+
+[net]
+## P2P accept addresses Required for inbound nodes.
+inbound=["tcp://127.0.0.1:31448"]
+
+## P2P external addresses. Required for inbound nodes.
+external_addrs=["tcp://127.0.0.1:31448"]
+
+## Seed nodes to connect to. Required for inbound and outbound nodes.
+seeds=["tcp://127.0.0.1:44448"]
+
+## Outbound connect slots. Required for outbound nodes.
+outbound_connections = 5
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+# Set to true if testing on localhost
+localnet = true

+ 23 - 0
contrib/localnet/dchatd-four-nodes/dchat2.toml

@@ -0,0 +1,23 @@
+# dchat toml
+
+## RPC listen address. 
+rpc_listen="tcp://127.0.0.1:52345"
+
+[net]
+## P2P accept addresses Required for inbound nodes.
+inbound=["tcp://127.0.0.1:32448"]
+
+## P2P external addresses. Required for inbound nodes.
+external_addrs=["tcp://127.0.0.1:32448"]
+
+## Seed nodes to connect to. Required for inbound and outbound nodes.
+seeds=["tcp://127.0.0.1:44448"]
+
+## Outbound connect slots. Required for outbound nodes.
+outbound_connections = 5
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+# Set to true if testing on localhost
+localnet = true

+ 23 - 0
contrib/localnet/dchatd-four-nodes/dchat3.toml

@@ -0,0 +1,23 @@
+# dchat toml
+
+## RPC listen address. 
+rpc_listen="tcp://127.0.0.1:53345"
+
+[net]
+## P2P accept addresses Required for inbound nodes.
+inbound=["tcp://127.0.0.1:33448"]
+
+## P2P external addresses. Required for inbound nodes.
+external_addrs=["tcp://127.0.0.1:33448"]
+
+## Seed nodes to connect to. Required for inbound and outbound nodes.
+seeds=["tcp://127.0.0.1:44448"]
+
+## Outbound connect slots. Required for outbound nodes.
+outbound_connections = 5
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+# Set to true if testing on localhost
+localnet = true

+ 23 - 0
contrib/localnet/dchatd-four-nodes/dchat4.toml

@@ -0,0 +1,23 @@
+# dchat toml
+
+## RPC listen address. 
+rpc_listen="tcp://127.0.0.1:54325"
+
+[net]
+## P2P accept addresses Required for inbound nodes.
+inbound=["tcp://127.0.0.1:35448"]
+
+## P2P external addresses. Required for inbound nodes.
+external_addrs=["tcp://127.0.0.1:35448"]
+
+## Seed nodes to connect to. Required for inbound and outbound nodes.
+seeds=["tcp://127.0.0.1:44448"]
+
+## Outbound connect slots. Required for outbound nodes.
+outbound_connections = 5
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+# Set to true if testing on localhost
+localnet = true

+ 13 - 0
contrib/localnet/dchatd-four-nodes/seed.toml

@@ -0,0 +1,13 @@
+# dchat toml
+
+rpc_listen="tcp://127.0.0.1:54448"
+
+[net]
+## P2P accept addresses Required for inbound nodes.
+inbound=["tcp://127.0.0.1:44448"]
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+# Set to true if testing on localhost
+localnet = true

+ 18 - 0
contrib/localnet/dchatd-four-nodes/tmux_sessions.sh

@@ -0,0 +1,18 @@
+#!/bin/sh
+# Start a tmux session of four dchatd nodes.
+set -e
+
+tmux new-session -s "dchatd" -n "dchatd" -d
+tmux send-keys "../../../target/release/dchatd --config seed.toml -vv 2>&1 | tee seed.log" Enter && sleep 1
+tmux split-window -h
+tmux send-keys "../../../target/release/dchatd --config dchat1.toml -vv 2>&1 | tee dchat1.log" Enter && sleep 1
+tmux split-window -h
+tmux send-keys "../../../target/release/dchatd --config dchat2.toml -vv 2>&1 | tee dchat2.log" Enter
+tmux select-pane -t 0
+tmux split-window -v
+tmux send-keys "../../../target/release/dchatd --config dchat3.toml -vv 2>&1 | tee dchat3.log" Enter
+tmux select-pane -t 2
+tmux split-window -v
+tmux send-keys "../../../target/release/dchatd --config dchat4.toml -vv 2>&1 | tee dchat4.log" Enter
+
+tmux attach