1
0
mirror of synced 2025-01-11 08:15:48 +00:00
nomos-node/testnet/scripts/consensus_node_list.sh
gusto eeb88b9430
Docker compose consensus layer config (#482)
* Same consensus node list for all nodes

* Extract duplicate code and add debug info

* Update initial net peer list script

* Remove unused envvar
2023-10-30 16:51:40 +02:00

23 lines
565 B
Bash
Executable File

#!/bin/sh
set -e
# This node id will be used to generate consensus node list.
tmp_node_id=0
# OVERLAY_NODES might be set in compose.yml.
tmp_overlay_nodes=$OVERLAY_NODES
# All spawned nodes should be added to consensus configuration.
for i in $(seq 1 $LIBP2P_REPLICAS); do
tmp_node_id=$((tmp_node_id + 1))
node_key=$(/etc/nomos/scripts/node_key_from_id.sh "$LIBP2P_NODE_MASK" "$tmp_node_id")
if [ -z "$tmp_overlay_nodes" ]; then
tmp_overlay_nodes=$node_key
else
tmp_overlay_nodes="${tmp_overlay_nodes},${node_key}"
fi
done
echo "${tmp_overlay_nodes}"