More testnet scripts fixes cherry-picked from the interop branch

This commit is contained in:
Zahary Karadjov 2019-09-26 19:07:38 +03:00
parent 0eaa433e84
commit df7531f9bf
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
6 changed files with 26 additions and 9 deletions

View File

@ -56,7 +56,7 @@ RUN cd nim-beacon-chain \
FROM debian:9-slim
RUN apt update \
&& apt install -y librocksdb-dev curl \
&& apt install -y librocksdb-dev curl psmisc \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -69,4 +69,7 @@ LABEL description="Nimbus installation that can act as an ETH2 network bootstrap
RUN echo Built from Git revision: ${GIT_REVISION}
ENTRYPOINT ["/usr/bin/beacon_node"]
# TODO: This custom entry script is necessary only because we must clean up
# temporary files left by previous executions of the Go daeamon.
# We should be able to remove it once we have a native LibP2P impl.
ENTRYPOINT ["/usr/bin/run_beacon_node.sh"]

View File

@ -1,7 +1,19 @@
#!/bin/bash
# Deal with previous execution of the deamon leaving behind
# socket files that prevent the deamon from launching again
# inside the container.
killall p2pd
rm -rf /tmp/*
beacon_node --nat:none $*
if [[ "$2" == "" ]]; then
# TODO This is a normal execution of a long-running testnet node.
# If the nat is enabled at the moment, the node fails to start.
beacon_node --nat:none
else
# This is a one-off command such as createTestnet.
# We cannot reuse the command above, because the --nat option
# is not compatible with most of the commands.
beacon_node "$@"
fi

View File

@ -34,7 +34,7 @@ LAST_VALIDATOR="$VALIDATORS_DIR/v$(printf '%07d' $LAST_VALIDATOR_NUM).deposit.js
if [ ! -f "${LAST_VALIDATOR}" ]; then
$BEACON_NODE_BIN makeDeposits \
--totalDeposits="${NUM_VALIDATORS}" \
--depositDir="$VALIDATORS_DIR" \
--depositsDir="$VALIDATORS_DIR" \
--randomKeys=false
fi
@ -45,7 +45,8 @@ if [ ! -f "${SNAPSHOT_FILE}" ]; then
--validatorsDir="${VALIDATORS_DIR}" \
--totalValidators="${NUM_VALIDATORS}" \
--outputGenesis="${SNAPSHOT_FILE}" \
--outputNetwork="${NETWORK_METADATA_FILE}" \
--outputNetworkMetadata="${NETWORK_METADATA_FILE}" \
--outputBootstrapNodes="${SIMULATION_DIR}/bootstrap_nodes.txt" \
--bootstrapAddress=127.0.0.1 \
--bootstrapPort=50000 \
--genesisOffset=10 # Delay in seconds

View File

@ -21,7 +21,8 @@ The `beacon_node` binary has a `createTestnet` command.
--totalValidators=$VALIDATOR_COUNT \
--lastUserValidator=$LAST_USER_VALIDATOR \
--outputGenesis=$NETWORK_DIR/genesis.json \
--outputNetwork=$NETWORK_DIR/network.json \
--outputNetworkMetadata=$NETWORK_DIR/network.json \
--outputBootstrapNodes=$NETWORK_DIR/bootstrap_nodes.txt \
--bootstrapAddress=$PUBLIC_IP \
--genesisOffset=600 # Delay in seconds
```

View File

@ -100,4 +100,3 @@ SSH
echo Publishing docker image...
make push
fi

View File

@ -58,7 +58,8 @@ if [ ! -f "${SNAPSHOT_FILE}" ]; then
--validatorsDir="${VALIDATORS_DIR}" \
--totalValidators="${NUM_VALIDATORS}" \
--outputGenesis="${SNAPSHOT_FILE}" \
--outputNetwork="${NETWORK_METADATA_FILE}" \
--outputNetworkMetadata="${NETWORK_METADATA_FILE}" \
--outputBootstrapNodes="${SIMULATION_DIR}/bootstrap_nodes.txt" \
--bootstrapAddress=127.0.0.1 \
--bootstrapPort=50000 \
--genesisOffset=5 # Delay in seconds