97c653efe3
* Update rust build image version * Docker compose file for testnet * Wrap tcp into dns transport in order to resolve hostnames (#346) * Docker compose for small libp2p node network * Install etcdctl to node containers * Register libp2p nodes on etcd * Register IP address in KV store * Interconnect libp2p nodes * Use delimiter in cli and env variables * Use docker compose initial env config * Leave main Dockerfile as is, use new ones in testnet dir * Remove etcd installation script * run_mixnet.sh placeholder * Use .env file for docker compose config * Ignore local .env file * Wrap sh envvars used in strings * Remove mixnode placeholders * Use default values for envconfig * Update labels in Dockerfiles * Sanitize scripts via shellcheck * Export env for nomos node * Updated to latest libp2p config * Pass config to bootstrap node
32 lines
820 B
Bash
Executable File
32 lines
820 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
# Set env variables for nomos-node.
|
|
NET_NODE_KEY=$(./etc/nomos/register_node.sh)
|
|
CONSENSUS_PRIV_KEY=$NET_NODE_KEY
|
|
|
|
node_ids=$(etcdctl get "/node/" --prefix --keys-only)
|
|
for node_id in $node_ids; do
|
|
node_key=$(etcdctl get "/config${node_id}/key" --print-value-only)
|
|
node_ip=$(etcdctl get "/config${node_id}/ip" --print-value-only)
|
|
node_multiaddr="/ip4/${node_ip}/tcp/3000"
|
|
|
|
if [ -z "$OVERLAY_NODES" ]; then
|
|
OVERLAY_NODES=$node_key
|
|
NET_INITIAL_PEERS=$node_multiaddr
|
|
else
|
|
OVERLAY_NODES="${OVERLAY_NODES},${node_key}"
|
|
NET_INITIAL_PEERS="${NET_INITIAL_PEERS},${node_multiaddr}"
|
|
fi
|
|
done
|
|
|
|
export CONSENSUS_PRIV_KEY \
|
|
OVERLAY_NODES \
|
|
NET_NODE_KEY \
|
|
NET_INITIAL_PEERS
|
|
|
|
echo "I am a container ${HOSTNAME} node ${NET_NODE_KEY}"
|
|
|
|
exec /usr/bin/nomos-node /etc/nomos/config.yaml
|