diff --git a/Dockerfile b/Dockerfile index 66aebed..767054b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,8 @@ ARG UPSTREAM_VERSION FROM nethermind/nethermind:${UPSTREAM_VERSION} -COPY jwtsecret.hex /jwtsecret -ENTRYPOINT [ "sh", "-c", "exec ./Nethermind.Runner \ - --JsonRpc.Enabled=true \ - --JsonRpc.JwtSecretFile=/jwtsecret \ - --Init.BaseDbPath=/data \ - --HealthChecks.Enabled true \ - --Init.LogDirectory=/data/logs \ - $EXTRA_OPTS" ] + +COPY /security /security +COPY entrypoint.sh /usr/local/bin/entrypoint.sh + +ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] \ No newline at end of file diff --git a/dappnode_package.json b/dappnode_package.json index 7e21e89..bf0c59e 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -9,9 +9,7 @@ "dependencies": {}, "chain": "ethereum", "author": "DAppNode Association (https://github.com/dappnode)", - "contributors": [ - "Eduardo Antuña (https://github.com/eduadiez)" - ], + "contributors": ["Eduardo Antuña (https://github.com/eduadiez)"], "exposable": [ { "name": "Nethermind JSON RPC", @@ -39,10 +37,16 @@ "url": "https://github.com/dappnode/DAppNodePackage-nethermind.git" }, "requirements": { - "minimumDappnodeVersion": "0.2.56" + "minimumDappnodeVersion": "0.2.60" }, "bugs": { "url": "https://github.com/dappnode/DAppNodePackage-nethermind/issues" }, - "license": "LGPL-3.0" + "license": "LGPL-3.0", + "globalEnvs": [ + { + "envs": ["CONSENSUS_CLIENT_MAINNET"], + "services": ["nethermind"] + } + ] } diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..11db02f --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +case "$_DAPPNODE_GLOBAL_CONSENSUS_CLIENT_MAINNET" in +"prysm.dnp.dappnode.eth") + echo "Using prysm.dnp.dappnode.eth" + JWT_PATH="/security/prysm/jwtsecret.hex" + ;; +"lighthouse.dnp.dappnode.eth") + echo "Using lighthouse.dnp.dappnode.eth" + JWT_PATH="/security/lighthouse/jwtsecret.hex" + ;; +"teku.dnp.dappnode.eth") + echo "Using teku.dnp.dappnode.eth" + JWT_PATH="/security/teku/jwtsecret.hex" + ;; +"nimbus.dnp.dappnode.eth") + echo "Using nimbus.dnp.dappnode.eth" + JWT_PATH="/security/nimbus/jwtsecret.hex" + ;; +*) + echo "Using default" + JWT_PATH="/security/default/jwtsecret.hex" + ;; +esac + +apt update +apt install -y curl + +# Print the jwt to the dappmanager +JWT=$(cat $JWT_PATH) +curl -X POST "http://my.dappnode/data-send?key=jwt&data=${JWT}" + +exec /nethermind/Nethermind.Runner \ + --JsonRpc.Enabled=true \ + --JsonRpc.JwtSecretFile=${JWT_PATH} \ + --Init.BaseDbPath=/data \ + --HealthChecks.Enabled true \ + --Init.LogDirectory=/data/logs \ + $EXTRA_OPTS diff --git a/getting-started.md b/getting-started.md index 72dad3b..57487ae 100644 --- a/getting-started.md +++ b/getting-started.md @@ -1,13 +1,10 @@ -## Nethermind (Execution Client) +# Nethermind Nethermind (Execution Client) Nethermind is now ready for the merge! -If you are enabled the UI: you can access by clicking on [Nethermind UI](http://nethermind.public.dappnode:8551/healthchecks-ui) -If you want to enable it you can do it if you go to config section and enable the below option. - There are now two RPC APIs in Execution Clients: -1. Querying API `http://nethermind.public.dappnode:8545`. Use this endpoint to query transactions on your node and connect your web3 wallet. -2. Engine API `http://nethermind.public.dappnode:8551`. Use this enpoint to connect your Beacon Chain (Consensus Layer) client. +1. Querying API `http://nethermind.dappnode:8545`. Use this endpoint to query transactions on your node and connect to it with your web3 wallet. +2. Engine API `http://nethermind.dappnode:8551`. Use this endpoint to connect your Beacon Chain (Consensus Layer) client. After the merge, if your Execution Client is not connected to a Consensus Layer client, you won't be able to use it to query the blockchain, nor will you be able to connect your wallet to it! diff --git a/security/default/jwtsecret.hex b/security/default/jwtsecret.hex new file mode 100644 index 0000000..dcf3548 --- /dev/null +++ b/security/default/jwtsecret.hex @@ -0,0 +1 @@ +7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d15 \ No newline at end of file diff --git a/security/lighthouse/jwtsecret.hex b/security/lighthouse/jwtsecret.hex new file mode 100644 index 0000000..137fd76 --- /dev/null +++ b/security/lighthouse/jwtsecret.hex @@ -0,0 +1 @@ +7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d16 \ No newline at end of file diff --git a/security/nimbus/jwtsecret.hex b/security/nimbus/jwtsecret.hex new file mode 100644 index 0000000..53d2fa8 --- /dev/null +++ b/security/nimbus/jwtsecret.hex @@ -0,0 +1 @@ +7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d17 \ No newline at end of file diff --git a/jwtsecret.hex b/security/prysm/jwtsecret.hex similarity index 100% rename from jwtsecret.hex rename to security/prysm/jwtsecret.hex diff --git a/security/teku/jwtsecret.hex b/security/teku/jwtsecret.hex new file mode 100644 index 0000000..9ef7300 --- /dev/null +++ b/security/teku/jwtsecret.hex @@ -0,0 +1 @@ +7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d19 \ No newline at end of file