#!/bin/sh # LIBP2P_NODE_MASK is set via compose.yml file. node_key_from_id() { echo "${LIBP2P_NODE_MASK}" | sed "s/.\{${#NODE_ID}\}$/${NODE_ID}/" } END=$LIBP2P_REPLICAS NODE_ID=1 NODE_IP=$(hostname -i) NODE_KEY=$(node_key_from_id) register_node() { ## Conditional transaction to set node config key if it doesn't exist. ## Newlines in EOF block are important, more info here: ## https://github.com/etcd-io/etcd/tree/main/etcdctl#examples-3 etcdctl txn <