From 3f15894aaacc73295ad9dede2c83177267b65162 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Fri, 28 Mar 2025 09:51:24 +1300 Subject: [PATCH] Files for testing chorus with relay-tester --- test_with_relay_tester/.gitignore | 3 ++ test_with_relay_tester/README.md | 12 +++++++ test_with_relay_tester/run_relay_tester.sh | 12 +++++++ test_with_relay_tester/test_chorus.sh | 10 ++++++ test_with_relay_tester/test_chorus.toml | 40 ++++++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 test_with_relay_tester/.gitignore create mode 100644 test_with_relay_tester/README.md create mode 100755 test_with_relay_tester/run_relay_tester.sh create mode 100755 test_with_relay_tester/test_chorus.sh create mode 100644 test_with_relay_tester/test_chorus.toml diff --git a/test_with_relay_tester/.gitignore b/test_with_relay_tester/.gitignore new file mode 100644 index 0000000..1e9e949 --- /dev/null +++ b/test_with_relay_tester/.gitignore @@ -0,0 +1,3 @@ +data +relay-tester + diff --git a/test_with_relay_tester/README.md b/test_with_relay_tester/README.md new file mode 100644 index 0000000..dd6f8ad --- /dev/null +++ b/test_with_relay_tester/README.md @@ -0,0 +1,12 @@ +# Testing Chorus with relay-tester + +First, git clone https://github.com/mikedilger/relay-tester and build that project +(cargo build --release). + +Then copy that target/release/relay-tester binary into this directory. + +Then run from two different shells, in this order: + +shell1: ./test_chorus.sh + +shell2: ./run_relay_tester.sh diff --git a/test_with_relay_tester/run_relay_tester.sh b/test_with_relay_tester/run_relay_tester.sh new file mode 100755 index 0000000..9a25692 --- /dev/null +++ b/test_with_relay_tester/run_relay_tester.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ ! -x relay-tester ] ; then + echo "You must build https://github.com/mikedilge/relay-tester and copy the " + echo "resultant target/release/relay-tester binary into this directory." + exit 1 +fi + +./relay-tester \ + ws://localhost:8080/ \ + nsec16xfd467kyd3xpu9x5u4933u00v73xrl0jyq9rk5ktd9t2j38k20qtwxuj3 \ + nsec1l50yuf6uxm2l5qxm87fkm56z3m7g88jnfy5s6az5wscxpu5l2yqq6qwk88 diff --git a/test_with_relay_tester/test_chorus.sh b/test_with_relay_tester/test_chorus.sh new file mode 100755 index 0000000..82759bc --- /dev/null +++ b/test_with_relay_tester/test_chorus.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Use ws://localhost:8080/ as the relay url" + +cargo build --release +rm -rf ./data/ +../target/release/chorus_init ./test_chorus.toml +../target/release/chorus_cmd ./test_chorus.toml add_user de16d3ed2d5ceb91d33e39dbe30585164e0c19f3f2e2a5b121def086b447a2e5 0 +../target/release/chorus_cmd ./test_chorus.toml add_user 35d6bbcf17fc31a9c4f7a2f68aa40ad32c8f9de1ae77505dc5eb3722d8b2987d 0 +../target/release/chorus ./test_chorus.toml diff --git a/test_with_relay_tester/test_chorus.toml b/test_with_relay_tester/test_chorus.toml new file mode 100644 index 0000000..11ab4ab --- /dev/null +++ b/test_with_relay_tester/test_chorus.toml @@ -0,0 +1,40 @@ +# See contrib/chorus.toml for a documented config file + +data_directory = "./data" +ip_address = "127.0.0.1" +port = 8080 +hostname = "localhost" +chorus_is_behind_a_proxy = false +use_tls = false +certchain_pem_path = "tls/fullchain.pem" +key_pem_path = "tls/privkey.pem" +name = "Chorus Sample" +description = "A sample run of the Chorus relay" +#icon_url = +open_relay = false +admin_hex_keys = [ + "ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49", + + # npub1mctd8mfdtn4er5e788d7xpv9ze8qcx0n7t32tvfpmmcgddz85tjsuyxe7z + "de16d3ed2d5ceb91d33e39dbe30585164e0c19f3f2e2a5b121def086b447a2e5", + + # npub1xhtthnchlsc6n38h5tmg4fq26vkgl80p4em4qhw9avmj9k9jnp7sm78ql6 + "35d6bbcf17fc31a9c4f7a2f68aa40ad32c8f9de1ae77505dc5eb3722d8b2987d" +] +verify_events = true +allow_scraping = false +allow_scrape_if_limited_to = 100 +allow_scrape_if_max_seconds = 7200 +max_subscriptions = 128 +serve_ephemeral = true +serve_relay_lists = true +server_log_level = "Info" +library_log_level = "Info" +client_log_level = "Debug" +enable_ip_blocking = false +minimum_ban_seconds = 1 +timeout_seconds = 60 +max_connections_per_ip = 5 +throttling_bytes_per_second = 131072 +throttling_burst = 4194304 +enable_negentropy = true