Skip to content

Commit

Permalink
do not populate peer nodes if there aren't any
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Aug 10, 2021
1 parent d30f3e3 commit 2832703
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docker/polkadot-node-key-configurator/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ chmod 400 /polkadot/k8s_local_node_key

# write public keys for all peers in an env file, to be sourced by polkadot startup script
local_peers=("${LOCAL_PEERS}")
echo "--reserved-nodes " > /polkadot/k8s_local_peer_cmd
rm -rvf /polkadot/k8s_local_peer_cmd
for node in ${local_peers[@]}
do
# do not peer with myself
if [ "${node}" != "${KUBERNETES_NAME_PREFIX}" ]
then
if [ ! -f /polkadot/k8s_local_peer_cmd ]; then
echo "--reserved-nodes " > /polkadot/k8s_local_peer_cmd
fi
echo "/dns4/${node}-private-node-0.${node}-private-node.${node}/tcp/30333/p2p/$(subkey inspect-node-key --file /polkadot-node-keys/$node) " >> /polkadot/k8s_local_peer_cmd
fi
done
1 change: 0 additions & 1 deletion terraform/k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ EOY
}
export -f build_container
find ${path.module}/../docker -mindepth 1 -maxdepth 1 -type d -exec bash -c 'build_container "$0"' {} \; -printf '%f\n'
#build_container ${path.module}/../docker/polkadot-node-key-configurator
EOF
}
}
Expand Down

0 comments on commit 2832703

Please sign in to comment.