Explorar el Código

bin/darkirc: add tmux script for testing

Dastan-glitch hace 3 años
padre
commit
658e3ad90b

+ 33 - 0
bin/darkirc/script/tmux_session/ircd_full_node1.toml

@@ -0,0 +1,33 @@
+## JSON-RPC listen URL
+rpc_listen="tcp://127.0.0.1:8890"
+
+## IRC listen URL
+irc_listen="tcp://127.0.0.1:22022"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections=0
+
+inbound = ["tcp://127.0.0.1:25552"]
+
+external_addr = ["tcp://127.0.0.1:25552"]
+
+peers = []
+
+## Seed nodes to connect to 
+# seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+outbound_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+# [channel."#test1"]
+# secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 33 - 0
bin/darkirc/script/tmux_session/ircd_full_node2.toml

@@ -0,0 +1,33 @@
+## JSON-RPC listen URL
+rpc_listen="tcp://127.0.0.1:8891"
+
+## IRC listen URL
+irc_listen="tcp://127.0.0.1:22023"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections=3
+
+inbound = ["tcp://127.0.0.1:25553"]
+
+external_addr = ["tcp://127.0.0.1:25553"]
+
+peers = ["tls://127.0.0.1:25552"]
+
+## Seed nodes to connect to 
+# seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+outbound_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+# [channel."#test1"]
+# secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 33 - 0
bin/darkirc/script/tmux_session/ircd_full_node3.toml

@@ -0,0 +1,33 @@
+## JSON-RPC listen URL
+rpc_listen="tcp://127.0.0.1:8892"
+
+## IRC listen URL
+irc_listen="tcp://127.0.0.1:22024"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections=3
+
+inbound = ["tcp://127.0.0.1:25554"]
+
+external_addr = ["tcp://127.0.0.1:25554"]
+
+peers = ["tls://127.0.0.1:25552"]
+
+## Seed nodes to connect to 
+# seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+outbound_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+# [channel."#test1"]
+# secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 33 - 0
bin/darkirc/script/tmux_session/ircd_full_node4.toml

@@ -0,0 +1,33 @@
+## JSON-RPC listen URL
+rpc_listen="tcp://127.0.0.1:8893"
+
+## IRC listen URL
+irc_listen="tcp://127.0.0.1:22025"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections=3
+
+inbound = ["tcp://127.0.0.1:25555"]
+
+external_addr = ["tcp://127.0.0.1:25555"]
+
+peers = ["tls://127.0.0.1:25554"]
+
+## Seed nodes to connect to
+# seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+outbound_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+# [channel."#test1"]
+# secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 34 - 0
bin/darkirc/script/tmux_session/seed.toml

@@ -0,0 +1,34 @@
+## JSON-RPC listen URL
+# rpc_listen="tcp://127.0.0.1:8888"
+
+## IRC listen URL
+# irc_listen="tcp://127.0.0.1:22020"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev"]
+
+## TLS certificate path if IRC acceptor uses TLS (optional)
+#irc_tls_cert = "/etc/letsencrypt/ircd/fullchain.pem"
+
+## TLS secret key path if IRC acceptor uses TLS (optional)
+#irc_tls_secret = "/etc/letsencrypt/ircd/privkey.pem"
+
+## P2P net settings
+[net]
+## Connection slots
+# outbound_connections=8
+
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+outbound_transports = ["tcp"]
+
+## Seed nodes to connect to 
+# seeds = ["tcp://127.0.0.1:25551", "tls://lilith1.dark.fi:25551"]
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+# [channel."#test1"]
+# secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 30 - 0
bin/darkirc/script/tmux_session/tmux_sessions.sh

@@ -0,0 +1,30 @@
+#!/bin/sh
+# Start a tmux session of four ircd nodes, and optionally four weechat clients.
+set -e
+
+tmux new-session -s "darkirc" -n "darkirc" -d
+# tmux send-keys "../../../../darkirc --localnet --config seed.toml" Enter && sleep 1
+# tmux split-window -h
+tmux send-keys "../../../../darkirc --config ircd_full_node1.toml" Enter && sleep 1
+tmux split-window -h
+tmux send-keys "../../../../darkirc --config ircd_full_node2.toml" Enter
+tmux select-pane -t 0
+tmux split-window -v
+tmux send-keys "../../../../darkirc --config ircd_full_node3.toml" Enter
+tmux select-pane -t 2
+tmux split-window -v
+tmux send-keys "../../../../darkirc --config ircd_full_node4.toml" Enter
+
+if [ -z "$1" ]; then
+	tmux new-window -t "darkirc:1" -n "weechat"
+	tmux send-keys "weechat -t -r '/server add ircd_a 127.0.0.1/22022;/connect ircd_a;/nick Alice'" Enter
+	tmux split-window -v
+	tmux send-keys "weechat -t -r '/server add ircd_b 127.0.0.1/22023;/connect ircd_b;/nick Bob'" Enter
+	tmux split-window -h
+	tmux send-keys "weechat -t -r '/server add ircd_c 127.0.0.1/22024;/connect ircd_c;/nick Charlie'" Enter
+	tmux select-pane -t 0
+	tmux split-window -h
+	tmux send-keys "weechat -t -r '/server add ircd_d 127.0.0.1/22025;/connect ircd_d;/nick Dave'" Enter
+fi
+
+tmux attach