diff --git a/build/startRpNode.sh b/build/startRpNode.sh index a7d0d25..2d28184 100755 --- a/build/startRpNode.sh +++ b/build/startRpNode.sh @@ -1,33 +1,33 @@ #!/bin/bash -NETWORK=${NETWORK} -CONSENSUSCLIENT=${CONSENSUSCLIENT} - +# Check NETWORK value case ${NETWORK} in "mainnet" | "prater") ;; - *) echo "Invalid NETWORK configured" - exit -1 + exit 1 ;; esac -case ${CONSENSUSCLIENT} in -"teku" | "prysm") ;; +# Check CONSENSUSCLIENT value +case ${CONSENSUSCLIENT} in +"teku" | "prysm" | "nimbus") ;; *) echo "Invalid CONSENSUSCLIENT configured" - exit -1 + exit 1 ;; esac + +# Check EXECUTIONCLIENT value case ${EXECUTIONCLIENT} in "geth" | "nethermind") ;; - *) echo "Invalid EXECUTIONCLIENT configured" - exit -1 + exit 1 ;; esac +# Set URLs based on configuration if [ "${EXECUTIONCLIENT}" = "nethermind" ]; then ECHTTPURL="http://avado-dnp-nethermind.my.ava.do:8545" ECWSURL="ws://avado-dnp-nethermind.my.ava.do:8545" @@ -48,18 +48,27 @@ if [ "${CONSENSUSCLIENT}" = "teku" ]; then BCHTTPURL="http://teku.my.ava.do:5051" fi BCJSONRPCURL="" +elif [ "${CONSENSUSCLIENT}" = "nimbus" ]; then + if [ "${NETWORK}" = "prater" ]; then + BCHTTPURL="http://nimbus-prater.my.ava.do:5052" + else + BCHTTPURL="http://nimbus.my.ava.do:5052" + fi + BCJSONRPCURL="" else + BCJSONRPCURL="" BCHTTPURL="http://prysm-beacon-chain-${NETWORK}.my.ava.do:3500" BCJSONRPCURL="http://prysm-beacon-chain-${NETWORK}.my.ava.do:4000" fi +# Export variables and substitute them in the template NETWORK="${NETWORK}" \ CONSENSUSCLIENT="${CONSENSUSCLIENT}" \ ECHTTPURL="${ECHTTPURL}" \ ECWSURL="${ECWSURL}" \ BCHTTPURL="${BCHTTPURL}" \ BCJSONRPCURL="${BCJSONRPCURL}" \ - envsubst <$(dirname "$0")/user-settings.template >$(dirname "$0")/user-settings.yml + envsubst <"$(dirname "$0")/user-settings.template" >"$(dirname "$0")/user-settings.yml" # Create folder for rewards trees mkdir -p /rocketpool/data/rewards-trees/ diff --git a/build/wizard/src/components/NodeStatus.tsx b/build/wizard/src/components/NodeStatus.tsx index 73730d2..6df4a24 100644 --- a/build/wizard/src/components/NodeStatus.tsx +++ b/build/wizard/src/components/NodeStatus.tsx @@ -2,7 +2,7 @@ import React from "react"; import SyncStatusTag from "./SyncStatusTag"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faRocket } from "@fortawesome/free-solid-svg-icons"; -import { networkType, consusClientType, minipoolStatusType, nodeStatusType } from "./Types" +import { nodeStatusType } from "./Types" import WithdrawRpl from "./WithdrawRpl"; diff --git a/build/wizard/src/components/Types.ts b/build/wizard/src/components/Types.ts index 55b2915..48166fe 100644 --- a/build/wizard/src/components/Types.ts +++ b/build/wizard/src/components/Types.ts @@ -1,6 +1,8 @@ export type networkType = "prater" | "mainnet" -export type consusClientType = "teku" | "prysm" + +export const consensusClients = ["teku", "prysm", "nimbus"] as const; +export type consensusClientType = typeof consensusClients[number]; // https://github.com/rocket-pool/smartnode/blob/master/shared/types/api/minipool.go // https://github.com/rocket-pool/rocketpool-go/blob/master/types/minipool.go diff --git a/build/wizard/src/components/ValidatorBanner.tsx b/build/wizard/src/components/ValidatorBanner.tsx index e97a02c..1750b9c 100644 --- a/build/wizard/src/components/ValidatorBanner.tsx +++ b/build/wizard/src/components/ValidatorBanner.tsx @@ -1,7 +1,7 @@ import React from "react"; import { DappManagerHelper } from "./DappManagerHelper"; import { RestApi } from "./RestApi"; -import { networkType, consusClientType, minipoolStatusType, nodeStatusType } from "./Types" +import { networkType, consensusClientType as consensusClientType, minipoolStatusType, nodeStatusType, consensusClients } from "./Types" import { KeyManagerHelper } from "./KeyManagerHelper"; import { confirmAlert } from 'react-confirm-alert'; @@ -18,14 +18,14 @@ const ValidatorBanner = ({ dappManagerHelper, minipoolStatus, setKeyManagerHelpe const [packages, setPackages] = React.useState(); const [network, setNetwork] = React.useState(); - const [consensusClient, setConsensusClient] = React.useState(); + const [consensusClient, setConsensusClient] = React.useState(); React.useEffect(() => { if (dappManagerHelper) { dappManagerHelper?.getEnvs().then( (envs) => { setNetwork(envs["NETWORK" as keyof typeof envs] as networkType ?? "mainnet"); - setConsensusClient(envs["CONSENSUSCLIENT" as keyof typeof envs] as consusClientType ?? "prysm"); + setConsensusClient(envs["CONSENSUSCLIENT" as keyof typeof envs] as consensusClientType ?? "prysm"); } ) dappManagerHelper.getPackages().then( @@ -41,19 +41,24 @@ const ValidatorBanner = ({ dappManagerHelper, minipoolStatus, setKeyManagerHelpe const packageNames = { "prater": { "teku": "teku-prater.avado.dnp.dappnode.eth", + "nimbus": "nimbus-prater.avado.dnp.dappnode.eth", "prysm": "eth2validator-prater.avado.dnp.dappnode.eth" }, "mainnet": { "teku": "teku.avado.dnp.dappnode.eth", + "nimbus": "nimbus.avado.dnp.dappnode.eth", "prysm": "eth2validator.avado.dnp.dappnode.eth" }, } const validatorPackage = packageNames[network][consensusClient] + const supportedPackages = consensusClients.map(n => packageNames[network][n]) - if (packages.includes(packageNames[network]["teku"]) && packages.includes(packageNames[network]["prysm"])) { - setMessage("You have both Teku and Prysm installed. Make sure you do NOT add your keys to both, or you will get slashed.") + const installedConsensusClients = packages.filter(name => supportedPackages.includes(name)) + + if (installedConsensusClients.length > 1) { + setMessage("You have multiple consensus clients installed. Make sure you do NOT add your keys to more than one client, or you will get slashed.") } if (!packages.includes(validatorPackage)) { diff --git a/build/wizard/src/components/Welcome.tsx b/build/wizard/src/components/Welcome.tsx index f41b121..82a05da 100644 --- a/build/wizard/src/components/Welcome.tsx +++ b/build/wizard/src/components/Welcome.tsx @@ -60,6 +60,7 @@ const Welcome = ({ utils, nodeSyncStatus, setNavBar, rplPriceData }: Props) => { const eth2BC = Object.keys(packages).find((k) => { return (( packages[k].name === "prysm-beacon-chain-mainnet.avado.dnp.dappnode.eth") || + packages[k].name === "nimbus.avado.dnp.dappnode.eth" || packages[k].name === "teku.avado.dnp.dappnode.eth" ) }); @@ -69,6 +70,7 @@ const Welcome = ({ utils, nodeSyncStatus, setNavBar, rplPriceData }: Props) => { description: "An ETH2.0 beacon chain", suggestedpackages: [ store.packages.find((p: any) => { return p.manifest.name === "teku.avado.dnp.dappnode.eth" }), + store.packages.find((p: any) => { return p.manifest.name === "nimbus.avado.dnp.dappnode.eth" }), store.packages.find((p: any) => { return p.manifest.name === "prysm-beacon-chain-mainnet.avado.dnp.dappnode.eth" }) ] } @@ -96,6 +98,7 @@ const Welcome = ({ utils, nodeSyncStatus, setNavBar, rplPriceData }: Props) => { description: "An ETH2.0 validator client", suggestedpackages: [ store.packages.find((p: any) => { return p.manifest.name === "teku.avado.dnp.dappnode.eth" }), + store.packages.find((p: any) => { return p.manifest.name === "nimbus.avado.dnp.dappnode.eth" }), store.packages.find((p: any) => { return p.manifest.name === "prysm-beacon-chain-mainnet.avado.dnp.dappnode.eth" }) ] } diff --git a/dappnode_package.json b/dappnode_package.json index 312aaf0..e7204c8 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -1,6 +1,6 @@ { "name": "rocketpool.avado.dnp.dappnode.eth", - "version": "0.0.96", + "version": "0.0.97", "upstream": "v1.10.1", "title": "Rocket Pool", "description": "Rocket Pool is decentralised Ethereum staking protocol", diff --git a/docker-compose.yml b/docker-compose.yml index a927554..b9fec08 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ version: '3.4' services: rocketpool.avado.dnp.dappnode.eth: - image: 'rocketpool.avado.dnp.dappnode.eth:0.0.96' + image: 'rocketpool.avado.dnp.dappnode.eth:0.0.97' build: context: ./build args: - RP_VERSION: v1.10.1 + RP_VERSION: v1.10.2 volumes: - 'rocketpool:/rocketpool' environment: