From f0e7f299963efa192f0e800298c65816803b8612 Mon Sep 17 00:00:00 2001 From: DaMandal0rian Date: Tue, 9 Apr 2024 08:40:51 +0300 Subject: [PATCH] restore the script files deleted in #263 --- .../create_bootstrap_node_compose_file.sh | 119 +++++++++++++ .../create_bootstrap_node_evm_compose_file.sh | 156 ++++++++++++++++++ .../create_domain_node_compose.file.sh | 103 ++++++++++++ .../create_farmer_node_compose_file.sh | 100 +++++++++++ .../scripts/create_node_compose_file.sh | 68 ++++++++ 5 files changed, 546 insertions(+) create mode 100644 testing-framework/hetzner/network/scripts/create_bootstrap_node_compose_file.sh create mode 100644 testing-framework/hetzner/network/scripts/create_bootstrap_node_evm_compose_file.sh create mode 100644 testing-framework/hetzner/network/scripts/create_domain_node_compose.file.sh create mode 100644 testing-framework/hetzner/network/scripts/create_farmer_node_compose_file.sh create mode 100644 testing-framework/hetzner/network/scripts/create_node_compose_file.sh diff --git a/testing-framework/hetzner/network/scripts/create_bootstrap_node_compose_file.sh b/testing-framework/hetzner/network/scripts/create_bootstrap_node_compose_file.sh new file mode 100644 index 00000000..d155c28c --- /dev/null +++ b/testing-framework/hetzner/network/scripts/create_bootstrap_node_compose_file.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` + +reserved_only=${1} +node_count=${2} +current_node=${3} + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + +services: + dsn-bootstrap-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-bootstrap-node + image: \${REPO_ORG}/\${NODE_TAG}:latest + restart: unless-stopped + environment: + - RUST_LOG=info + ports: + - "30533:30533" + command: + - start + - "--keypair" + - \${DSN_NODE_KEY} + - "--listen-on" + - /ip4/0.0.0.0/udp/30533/quic-v1 + - "--listen-on" + - /ip4/0.0.0.0/tcp/30533 + - --protocol-version + - \${GENESIS_HASH} + - "--in-peers" + - "1000" + - "--out-peers" + - "1000" + - "--pending-in-peers" + - "1000" + - "--pending-out-peers" + - "1000" + - "--external-address" +## comment to disable external addresses using IP format for now +# - "--external-address" +# - "/ip4/$EXTERNAL_IP/udp/30533/quic-v1" +# - "--external-address" +# - "/ip4/$EXTERNAL_IP/tcp/30533" +EOF + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" == "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR_TCP=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + fi +done + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" != "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--reserved-peers\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"--bootstrap-nodes\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + fi +done + +cat >> ~/subspace/subspace/docker-compose.yml << EOF + archival-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-node + image: \${REPO_ORG}/node:latest + volumes: + - archival_node_data:/var/subspace:rw + restart: unless-stopped + ports: + - "30333:30333/udp" + - "30433:30433/udp" + - "30333:30333/tcp" + - "30433:30433/tcp" + - "9615:9615" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "256", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", + "--dsn-external-address", "/ip4/$EXTERNAL_IP/udp/30433/quic-v1", + "--dsn-external-address", "/ip4/$EXTERNAL_IP/tcp/30433", + "--node-key", "\${NODE_KEY}", + "--in-peers", "1000", + "--out-peers", "1000", + "--dsn-in-connections", "1000", + "--dsn-out-connections", "1000", + "--dsn-pending-in-connections", "1000", + "--dsn-pending-out-connections", "1000", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" != "${i}" ]; then + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace/node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + fi +done + +if [ "${reserved_only}" == true ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +echo ' ]' >> ~/subspace/subspace/docker-compose.yml diff --git a/testing-framework/hetzner/network/scripts/create_bootstrap_node_evm_compose_file.sh b/testing-framework/hetzner/network/scripts/create_bootstrap_node_evm_compose_file.sh new file mode 100644 index 00000000..825d8591 --- /dev/null +++ b/testing-framework/hetzner/network/scripts/create_bootstrap_node_evm_compose_file.sh @@ -0,0 +1,156 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` + +reserved_only=${1} +node_count=${2} +current_node=${3} +bootstrap_node_count=${4} +enable_domains=${5} + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + +services: + dsn-bootstrap-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-bootstrap-node + image: \${REPO_ORG}/\${NODE_TAG}:latest + restart: unless-stopped + environment: + - RUST_LOG=info + ports: + - "30533:30533" + command: + - start + - "--keypair" + - \${DSN_NODE_KEY} + - "--listen-on" + - /ip4/0.0.0.0/udp/30533/quic-v1 + - "--listen-on" + - /ip4/0.0.0.0/tcp/30533 + - --protocol-version + - \${GENESIS_HASH} + - "--in-peers" + - "1000" + - "--out-peers" + - "1000" + - "--pending-in-peers" + - "1000" + - "--pending-out-peers" + - "1000" +## comment to disable external addresses using IP format for now +# - "--external-address" +# - "/ip4/$EXTERNAL_IP/udp/30533/quic-v1" +# - "--external-address" +# - "/ip4/$EXTERNAL_IP/tcp/30533" +EOF + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" == "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR_TCP=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + fi +done + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" != "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--reserved-peers\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"--bootstrap-nodes\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + fi +done + +cat >> ~/subspace/subspace/docker-compose.yml << EOF + archival-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-node + image: \${REPO_ORG}/node:latest + volumes: + - archival_node_data:/var/subspace:rw + restart: unless-stopped + ports: + - "30333:30333/udp" + - "30433:30433/udp" + - "30333:30333/tcp" + - "30433:30433/tcp" + - "30334:30334/tcp" + - "9615:9615" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "256", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", +## comment to disable dsn external addresses using IP format for now +# "--dsn-external-address", "/ip4/$EXTERNAL_IP/udp/30433/quic-v1", +# "--dsn-external-address", "/ip4/$EXTERNAL_IP/tcp/30433", + "--node-key", "\${NODE_KEY}", + "--in-peers", "1000", + "--out-peers", "1000", + "--dsn-in-connections", "1000", + "--dsn-out-connections", "1000", + "--dsn-pending-in-connections", "1000", + "--dsn-pending-out-connections", "1000", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" == "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSTRATE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--dsn-external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSTRATE_MULTI_ADDR_TCP=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--dsn-external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + fi +done + +for (( i = 0; i < bootstrap_node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace/bootstrap_node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +for (( i = 0; i < dsn_bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " \"--dsn-reserved-peers\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--dsn-bootstrap-nodes\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +if [ "${reserved_only}" == true ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +if [ "${enable_domains}" == "true" ]; then + { + # core domain + echo ' "--",' + echo ' "--domain-id", "${DOMAIN_ID}",' + echo ' "--state-pruning", "archive",' + echo ' "--blocks-pruning", "archive",' + echo ' "--listen-on", "/ip4/0.0.0.0/tcp/30334",' + echo ' "--rpc-cors", "all",' + echo ' "--rpc-listen-on", "127.0.0.1:8944",' + for (( i = 0; i < node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_OPERATOR_MULTI_ADDR=//p" ~/subspace/node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/docker-compose.yml + done + + } >> ~/subspace/subspace/docker-compose.yml +fi + +echo ' ]' >> ~/subspace/subspace/docker-compose.yml diff --git a/testing-framework/hetzner/network/scripts/create_domain_node_compose.file.sh b/testing-framework/hetzner/network/scripts/create_domain_node_compose.file.sh new file mode 100644 index 00000000..97b9d679 --- /dev/null +++ b/testing-framework/hetzner/network/scripts/create_domain_node_compose.file.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + +services: + archival-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-node + image: \${REPO_ORG}/\${NODE_TAG}:latest + volumes: + - archival_node_data:/var/subspace:rw + restart: unless-stopped + ports: + - "30333:30333/udp" + - "30433:30433/udp" + - "30333:30333/tcp" + - "30433:30433/tcp" + - "30334:30334" + - "9615:9615" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "archive", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", +## comment to disable dsn external addresses using IP format for now +# "--dsn-external-address", "/ip4/$EXTERNAL_IP/udp/30433/quic-v1", +# "--dsn-external-address", "/ip4/$EXTERNAL_IP/tcp/30433", + "--node-key", "\${NODE_KEY}", + "--in-peers", "500", + "--out-peers", "250", + "--rpc-max-connections", "10000", + "--rpc-cors", "all", + "--rpc-listen-on", "0.0.0.0:9944", + "--rpc-methods", "safe", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +reserved_only=${1} +node_count=${2} +current_node=${3} +bootstrap_node_count=${4} +dsn_bootstrap_node_count=${4} +enable_domains=${5} +domain_id=${6} + +for (( i = 0; i < node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSTRATE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--dsn-external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSTRATE_MULTI_ADDR_TCP=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--dsn-external-address\"" >> ~/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/docker-compose.yml +done + +for (( i = 0; i < bootstrap_node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace//bootstrap_node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +#// TODO: make configurable with gemini network as it's not needed for devnet +for (( i = 0; i < dsn_bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " \"--dsn-reserved-peers\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--dsn-bootstrap-nodes\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +if [ "${reserved_only}" == "true" ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +if [ "${enable_domains}" == "true" ]; then + { + # core domain + echo ' "--",' + echo ' "--domain-id", "${DOMAIN_ID}",' + echo ' "--state-pruning", "archive",' + echo ' "--blocks-pruning", "archive",' + echo ' "--operator-id", "0",' + echo ' "--listen-on", "/ip4/0.0.0.0/tcp/30334",' + echo ' "--rpc-cors", "all",' + echo ' "--rpc-methods", "safe",' + echo ' "--rpc-listen-on", "0.0.0.0:8944",' + + for (( i = 0; i < bootstrap_node_evm_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace/bootstrap_node_evm_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/docker-compose.yml + done + + } >> ~/subspace/subspace/docker-compose.yml +fi + +echo ' ]' >> ~/subspace/subspace/docker-compose.yml diff --git a/testing-framework/hetzner/network/scripts/create_farmer_node_compose_file.sh b/testing-framework/hetzner/network/scripts/create_farmer_node_compose_file.sh new file mode 100644 index 00000000..d1762f68 --- /dev/null +++ b/testing-framework/hetzner/network/scripts/create_farmer_node_compose_file.sh @@ -0,0 +1,100 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + farmer_data: {} + +services: + farmer: + depends_on: + archival-node: + condition: service_healthy + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-farmer + image: \${REPO_ORG}/\${NODE_TAG}:latest + volumes: + - farmer_data:/var/subspace + restart: unless-stopped + ports: + - "30533:30533/udp" + - "30533:30533/tcp" + command: [ + "farm", "path=/var/subspace,size=\${PLOT_SIZE}", + "--node-rpc-url", "ws://archival-node:9944", + "--external-address", "/ip4/$EXTERNAL_IP/udp/30533/quic-v1", + "--external-address", "/ip4/$EXTERNAL_IP/tcp/30533", + "--listen-on", "/ip4/0.0.0.0/udp/30533/quic-v1", + "--listen-on", "/ip4/0.0.0.0/tcp/30533", + "--reward-address", "\${REWARD_ADDRESS}", + "--metrics-endpoint=0.0.0.0:9616", + "--cache-percentage", "15", + ] + + archival-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-node + image: \${REPO_ORG}/node:\${NODE_TAG} + volumes: + - archival_node_data:/var/subspace:rw + restart: unless-stopped + ports: + - "30333:30333/udp" + - "30433:30433/udp" + - "30333:30333/tcp" + - "30433:30433/tcp" + - "9615:9615" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "256", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", + "--dsn-external-address", "/ip4/$EXTERNAL_IP/udp/30433/quic-v1", + "--dsn-external-address", "/ip4/$EXTERNAL_IP/tcp/30433", + "--node-key", "\${NODE_KEY}", + "--farmer", + "--timekeeper", + "--rpc-cors", "all", + "--rpc-listen-on", "0.0.0.0:9944", + "--rpc-methods", "unsafe", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +reserved_only=${1} +node_count=${2} +current_node=${3} +bootstrap_node_count=${4} +dsn_bootstrap_node_count=${4} +force_block_production=${5} + +for (( i = 0; i < bootstrap_node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace//bootstrap_node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +# // TODO: make configurable with gemini network +for (( i = 0; i < dsn_bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " \"--dsn-reserved-peers\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--dsn-bootstrap-nodes\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +if [ "${reserved_only}" == true ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +if [ "${force_block_production}" == true ]; then + echo " \"--force-synced\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--force-authoring\"," >> ~/subspace/subspace/docker-compose.yml +fi + +echo ' ]' >> ~/subspace/subspace/docker-compose.yml diff --git a/testing-framework/hetzner/network/scripts/create_node_compose_file.sh b/testing-framework/hetzner/network/scripts/create_node_compose_file.sh new file mode 100644 index 00000000..85f4956c --- /dev/null +++ b/testing-framework/hetzner/network/scripts/create_node_compose_file.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + +services: + archival-node: + build: + context: . + dockerfile: $HOME/subspace/subspace/Dockerfile-node + image: \${REPO_ORG}/\${NODE_TAG}:latest + volumes: + - archival_node_data:/var/subspace:rw + restart: unless-stopped + ports: + - "30333:30333/udp" + - "30433:30433/udp" + - "30333:30333/tcp" + - "30433:30433/tcp" + - "9615:9615" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "archive", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", + "--dsn-external-address", "/ip4/$EXTERNAL_IP/udp/30433/quic-v1", + "--dsn-external-address", "/ip4/$EXTERNAL_IP/tcp/30433", + "--node-key", "\${NODE_KEY}", + "--in-peers", "500", + "--out-peers", "250", + "--rpc-max-connections", "10000", + "--rpc-cors", "all", + "--rpc-listen-on", "0.0.0.0:9944", + "--rpc-methods", "safe", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +reserved_only=${1} +node_count=${2} +current_node=${3} +bootstrap_node_count=${4} +dsn_bootstrap_node_count=${4} + +for (( i = 0; i < bootstrap_node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace//bootstrap_node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +# // TODO: make configurable with gemini network as it's not needed for devnet +for (( i = 0; i < dsn_bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " \"--dsn-reserved-peers\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--dsn-bootstrap-nodes\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +if [ "${reserved_only}" == true ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +echo ' ]' >> ~/subspace/subspace/docker-compose.yml