Parcourir la source

contrib: add bit of instruction/script to test nym transport over local ircd nodes

Dastan-glitch il y a 3 ans
Parent
commit
885470859c

+ 38 - 0
contrib/localnet/ircd-nym-two-nodes/README.md

@@ -0,0 +1,38 @@
+
+## Prerequisites
+Download `nym-network-requester` and `nym-socks5-client` binaries 
+from: https://github.com/nymtech/nym/releases
+(version 1.1.10 was tested)
+
+## initializing and run nym bins:
+- ### network requester:
+```
+# --gateway is optional
+# gateway address is an already existing one
+# if omitted, gateway will be randomly chosen based on some factors
+% ./nym-network-requester init --id nettestnode --gateway 2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh
+% ./nym-network-requester run --id nettestnode
+```
+take note of the address in the log, will be something like this:
+
+> \> The address of this client is: 4owvZtatuzYJkJFmG6xyAxCg7ic7aZiJfBnReb6SbEtf.3F5DS1p1UP9Y6H7AGNnRAeTqXU81dQVj8BTDeVNLZWsp@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh
+
+alternatively you can check the config file:
+`~/.nym/service-providers/network-requester/nettestnode/config/config.toml`
+
+- ### client:
+```
+# --provider is required
+% ./nym-socks5-client init --id sockstest --provider 4owvZtatuzYJkJFmG6xyAxCg7ic7aZiJfBnReb6SbEtf.3F5DS1p1UP9Y6H7AGNnRAeTqXU81dQVj8BTDeVNLZWsp@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh
+% ./nym-socks5-client run --id sockstest
+```
+
+after `nym-network-requester` initialization you can add '`127.0.0.1`' or '`localhost`'
+to `~/.nym/service-providers/network-requester/allowed.list`
+
+adding a new domain/address to `allowed.list` while `nym-network-requester` is running
+will require you to restart it.
+
+
+now you can run tmux_session.sh
+

+ 24 - 0
contrib/localnet/ircd-nym-two-nodes/node1.toml

@@ -0,0 +1,24 @@
+## 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 = ["nym://127.0.0.1:25552"]
+
+external_addr = ["nym://127.0.0.1:25552"]
+
+# peers = ["nym://127.0.0.1:25553"]
+
+## Seed nodes to connect to 
+# seeds = ["nym://127.0.0.1:25551"]
+
+outbound_transports = ["nym"]

+ 24 - 0
contrib/localnet/ircd-nym-two-nodes/node2.toml

@@ -0,0 +1,24 @@
+## 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=0
+
+inbound = ["nym://127.0.0.1:25553"]
+
+external_addr = ["nym://127.0.0.1:25553"]
+
+peers = ["nym://127.0.0.1:25552"]
+
+## Seed nodes to connect to 
+# seeds = ["nym://127.0.0.1:25551"]
+
+outbound_transports = ["nym"]

+ 17 - 0
contrib/localnet/ircd-nym-two-nodes/tmux_session.sh

@@ -0,0 +1,17 @@
+#!/bin/sh
+# Start a tmux session of five ircd nodes, and optionally 5 weechat clients.
+set -e
+
+tmux new-session -s "ircd" -n "ircd" -d
+tmux send-keys "../../../ircd --config node1.toml" Enter && sleep 1
+tmux split-window -h
+tmux send-keys "../../../ircd --config node2.toml" Enter && sleep 1
+
+if [ -z "$1" ]; then
+	tmux new-window -t "ircd:1" -n "weechat"
+	tmux send-keys "weechat -t -r '/server add node1 127.0.0.1/22022;/connect node1'" Enter
+	tmux split-window -v
+	tmux send-keys "weechat -t -r '/server add node2 127.0.0.1/22023;/connect node2'" Enter
+fi
+
+tmux attach