Skip to content

Commit

Permalink
Make it possible to pass extra arguments to the eth1, eth2 and valida…
Browse files Browse the repository at this point in the history
…tor container
  • Loading branch information
tedsteen committed Aug 15, 2021
1 parent 3f3a81c commit d39c358
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ if [ "$CLIENT" = "geth" ]; then
CMD="$CMD --port $ETH1_P2P_PORT"
fi

exec ${CMD} --http.vhosts '*'
exec ${CMD} --http.vhosts '*' ${ETH1_EXTRA_ARGS}

fi


# Infura startup
if [ "$CLIENT" = "infura" ]; then

exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --network goerli --projectId $INFURA_PROJECT_ID --providerType infura
exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --network goerli --projectId $INFURA_PROJECT_ID --providerType infura $ETH1_EXTRA_ARGS

fi


# Pocket startup
if [ "$CLIENT" = "pocket" ]; then

exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --network eth-goerli --projectId $POCKET_PROJECT_ID --providerType pocket
exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --network eth-goerli --projectId $POCKET_PROJECT_ID --providerType pocket $ETH1_EXTRA_ARGS

fi


# Custom provider startup
if [ "$CLIENT" = "custom" ]; then

exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --httpProviderUrl $HTTP_PROVIDER_URL --wsProviderUrl $WS_PROVIDER_URL --providerType=""
exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --httpProviderUrl $HTTP_PROVIDER_URL --wsProviderUrl $WS_PROVIDER_URL --providerType="" $ETH1_EXTRA_ARGS

fi

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ "$CLIENT" = "lighthouse" ]; then
CMD="$CMD --target-peers $ETH2_MAX_PEERS"
fi

exec ${CMD}
exec ${CMD} ${ETH2_EXTRA_ARGS}

fi

Expand All @@ -41,7 +41,7 @@ if [ "$CLIENT" = "nimbus" ]; then
fi

# Graffiti breaks if it's in the CMD string instead of here because of spaces
exec ${CMD} --graffiti="$GRAFFITI"
exec ${CMD} --graffiti="$GRAFFITI" ${ETH2_EXTRA_ARGS}

fi

Expand All @@ -60,7 +60,7 @@ if [ "$CLIENT" = "prysm" ]; then
CMD="$CMD --p2p-max-peers $ETH2_MAX_PEERS"
fi

exec ${CMD}
exec ${CMD} ${ETH2_EXTRA_ARGS}

fi

Expand All @@ -74,6 +74,6 @@ if [ "$CLIENT" = "teku" ]; then
CMD="$CMD --p2p-peer-lower-bound=$ETH2_MAX_PEERS --p2p-peer-upper-bound=$ETH2_MAX_PEERS"
fi

exec ${CMD}
exec ${CMD} ${ETH2_EXTRA_ARGS}

fi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
# Lighthouse startup
if [ "$CLIENT" = "lighthouse" ]; then

exec /usr/local/bin/lighthouse validator --network prater --datadir /validators/lighthouse --init-slashing-protection --beacon-node "http://$ETH2_PROVIDER" --graffiti "$GRAFFITI"
exec /usr/local/bin/lighthouse validator --network prater --datadir /validators/lighthouse --init-slashing-protection --beacon-node "http://$ETH2_PROVIDER" --graffiti "$GRAFFITI" ${VALIDATOR_EXTRA_ARGS}

fi

Expand All @@ -35,15 +35,15 @@ if [ "$CLIENT" = "prysm" ]; then
# Get rid of the protocol prefix
ETH2_PROVIDER=$(echo $ETH2_PROVIDER | sed -E 's/.*\:\/\/(.*)/\1/')

exec /app/cmd/validator/validator --accept-terms-of-use --prater --wallet-dir /validators/prysm-non-hd --wallet-password-file /validators/prysm-non-hd/direct/accounts/secret --beacon-rpc-provider "$ETH2_PROVIDER" --graffiti "$GRAFFITI"
exec /app/cmd/validator/validator --accept-terms-of-use --prater --wallet-dir /validators/prysm-non-hd --wallet-password-file /validators/prysm-non-hd/direct/accounts/secret --beacon-rpc-provider "$ETH2_PROVIDER" --graffiti "$GRAFFITI" ${VALIDATOR_EXTRA_ARGS}

fi


# Teku startup
if [ "$CLIENT" = "teku" ]; then

exec /opt/teku/bin/teku validator-client --network=prater --validator-keys=/validators/teku/keys:/validators/teku/passwords --beacon-node-api-endpoint="http://$ETH2_PROVIDER" --validators-graffiti="$GRAFFITI"
exec /opt/teku/bin/teku validator-client --network=prater --validator-keys=/validators/teku/keys:/validators/teku/passwords --beacon-node-api-endpoint="http://$ETH2_PROVIDER" --validators-graffiti="$GRAFFITI" ${VALIDATOR_EXTRA_ARGS}

fi

3 changes: 3 additions & 0 deletions amd64/rp-smartnode-install/network/prater/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- GETH_CACHE_SIZE=${GETH_CACHE_SIZE}
- GETH_MAX_PEERS=${GETH_MAX_PEERS}
- ETH1_P2P_PORT=${ETH1_P2P_PORT}
- ETH1_EXTRA_ARGS=${ETH1_EXTRA_ARGS}
entrypoint: sh
command: "/setup/start-node.sh"
eth2:
Expand Down Expand Up @@ -51,6 +52,7 @@ services:
- ETH2_MAX_PEERS=${ETH2_MAX_PEERS}
- ENABLE_METRICS=${ENABLE_METRICS}
- ETH2_METRICS_PORT=${ETH2_METRICS_PORT}
- ETH2_EXTRA_ARGS=${ETH2_EXTRA_ARGS}
entrypoint: sh
command: "/setup/start-beacon.sh"
depends_on:
Expand All @@ -71,6 +73,7 @@ services:
- ETH2_PROVIDER=${ETH2_PROVIDER}
- CUSTOM_GRAFFITI=${CUSTOM_GRAFFITI}
- ROCKET_POOL_VERSION=${ROCKET_POOL_VERSION}
- VALIDATOR_EXTRA_ARGS=${ETH1_EXTRA_ARGS}
entrypoint: sh
command: "/setup/start-validator.sh"
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ if [ "$CLIENT" = "geth" ]; then
CMD="$CMD --port $ETH1_P2P_PORT"
fi

exec ${CMD} --http.vhosts '*'
exec ${CMD} --http.vhosts '*' ${ETH1_EXTRA_ARGS}

fi


# Infura startup
if [ "$CLIENT" = "infura" ]; then

exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --network goerli --projectId $INFURA_PROJECT_ID --providerType infura
exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --network goerli --projectId $INFURA_PROJECT_ID --providerType infura ${ETH1_EXTRA_ARGS}

fi


# Pocket startup
if [ "$CLIENT" = "pocket" ]; then

exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --network eth-goerli --projectId $POCKET_PROJECT_ID --providerType pocket
exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --network eth-goerli --projectId $POCKET_PROJECT_ID --providerType pocket ${ETH1_EXTRA_ARGS}

fi


# Custom provider startup
if [ "$CLIENT" = "custom" ]; then

exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --httpProviderUrl $HTTP_PROVIDER_URL --wsProviderUrl $WS_PROVIDER_URL --providerType=""
exec /go/bin/rocketpool-pow-proxy --httpPort 8545 --wsPort 8546 --httpProviderUrl $HTTP_PROVIDER_URL --wsProviderUrl $WS_PROVIDER_URL --providerType="" ${ETH1_EXTRA_ARGS}

fi

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ "$CLIENT" = "lighthouse" ]; then
CMD="$CMD --target-peers $ETH2_MAX_PEERS"
fi

exec ${CMD}
exec ${CMD} ${ETH2_EXTRA_ARGS}

fi

Expand All @@ -41,7 +41,7 @@ if [ "$CLIENT" = "nimbus" ]; then
fi

# Graffiti breaks if it's in the CMD string instead of here because of spaces
exec ${CMD} --graffiti="$GRAFFITI"
exec ${CMD} --graffiti="$GRAFFITI" ${ETH2_EXTRA_ARGS}

fi

Expand All @@ -60,7 +60,7 @@ if [ "$CLIENT" = "prysm" ]; then
CMD="$CMD --p2p-max-peers $ETH2_MAX_PEERS"
fi

exec ${CMD}
exec ${CMD} ${ETH2_EXTRA_ARGS}

fi

Expand All @@ -74,6 +74,6 @@ if [ "$CLIENT" = "teku" ]; then
CMD="$CMD --p2p-peer-lower-bound=$ETH2_MAX_PEERS --p2p-peer-upper-bound=$ETH2_MAX_PEERS"
fi

exec ${CMD}
exec ${CMD} ${ETH2_EXTRA_ARGS}

fi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
# Lighthouse startup
if [ "$CLIENT" = "lighthouse" ]; then

exec /usr/local/bin/lighthouse validator --network prater --datadir /validators/lighthouse --init-slashing-protection --beacon-node "http://$ETH2_PROVIDER" --graffiti "$GRAFFITI"
exec /usr/local/bin/lighthouse validator --network prater --datadir /validators/lighthouse --init-slashing-protection --beacon-node "http://$ETH2_PROVIDER" --graffiti "$GRAFFITI" ${VALIDATOR_EXTRA_ARGS}

fi

Expand All @@ -35,15 +35,15 @@ if [ "$CLIENT" = "prysm" ]; then
# Get rid of the protocol prefix
ETH2_PROVIDER=$(echo $ETH2_PROVIDER | sed -E 's/.*\:\/\/(.*)/\1/')

exec /app/cmd/validator/validator --accept-terms-of-use --prater --wallet-dir /validators/prysm-non-hd --wallet-password-file /validators/prysm-non-hd/direct/accounts/secret --beacon-rpc-provider "$ETH2_PROVIDER" --graffiti "$GRAFFITI"
exec /app/cmd/validator/validator --accept-terms-of-use --prater --wallet-dir /validators/prysm-non-hd --wallet-password-file /validators/prysm-non-hd/direct/accounts/secret --beacon-rpc-provider "$ETH2_PROVIDER" --graffiti "$GRAFFITI" ${VALIDATOR_EXTRA_ARGS}

fi


# Teku startup
if [ "$CLIENT" = "teku" ]; then

exec /opt/teku/bin/teku validator-client --network=prater --validator-keys=/validators/teku/keys:/validators/teku/passwords --beacon-node-api-endpoint="http://$ETH2_PROVIDER" --validators-graffiti="$GRAFFITI"
exec /opt/teku/bin/teku validator-client --network=prater --validator-keys=/validators/teku/keys:/validators/teku/passwords --beacon-node-api-endpoint="http://$ETH2_PROVIDER" --validators-graffiti="$GRAFFITI" ${VALIDATOR_EXTRA_ARGS}

fi

3 changes: 3 additions & 0 deletions arm64/rp-smartnode-install/network/prater/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- GETH_CACHE_SIZE=${GETH_CACHE_SIZE}
- GETH_MAX_PEERS=${GETH_MAX_PEERS}
- ETH1_P2P_PORT=${ETH1_P2P_PORT}
- ETH1_EXTRA_ARGS=${ETH1_EXTRA_ARGS}
entrypoint: sh
command: "/setup/start-node.sh"
eth2:
Expand Down Expand Up @@ -51,6 +52,7 @@ services:
- ETH2_MAX_PEERS=${ETH2_MAX_PEERS}
- ENABLE_METRICS=${ENABLE_METRICS}
- ETH2_METRICS_PORT=${ETH2_METRICS_PORT}
- ETH2_EXTRA_ARGS=${ETH2_EXTRA_ARGS}
entrypoint: sh
command: "/setup/start-beacon.sh"
depends_on:
Expand All @@ -71,6 +73,7 @@ services:
- ETH2_PROVIDER=${ETH2_PROVIDER}
- CUSTOM_GRAFFITI=${CUSTOM_GRAFFITI}
- ROCKET_POOL_VERSION=${ROCKET_POOL_VERSION}
- VALIDATOR_EXTRA_ARGS=${VALIDATOR_EXTRA_ARGS}
entrypoint: sh
command: "/setup/start-validator.sh"
depends_on:
Expand Down

0 comments on commit d39c358

Please sign in to comment.