Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from dappnode/pablo/stakers-ui
Browse files Browse the repository at this point in the history
Implement stakers UI support
  • Loading branch information
pablomendezroyo authored Nov 14, 2022
2 parents 6816512 + 28e2614 commit 5d01106
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 44 deletions.
26 changes: 6 additions & 20 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,17 @@ ARG UPSTREAM_VERSION

FROM hyperledger/besu:${UPSTREAM_VERSION}

COPY jwtsecret.hex /jwtsecret
COPY security /security
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

USER root
RUN apt update && apt install curl -y

RUN mkdir /var/lib/besu
RUN chown -R besu:besu /var/lib/besu

USER besu

ENV BESU_OPTS=$BESU_OPTS

ENTRYPOINT besu \
--rpc-ws-host='0.0.0.0' \
--rpc-ws-enabled=$WS_ENABLED \
--rpc-http-host='0.0.0.0' \
--rpc-http-enabled=true \
--host-allowlist=* \
--rpc-http-cors-origins=* \
--engine-rpc-port=8551 \
--engine-host-allowlist=* \
--engine-jwt-secret='/jwtsecret' \
--engine-rpc-enabled=true \
--data-storage-format=$STORAGE_FORMAT \
--metrics-enabled \
--metrics-host='0.0.0.0' \
--data-path=/var/lib/besu \
--sync-mode=$SYNC_MODE \
--rpc-http-max-active-connections=$MAX_HTTP_CONNECTIONS \
--p2p-port=$P2P_PORT \
$EXTRA_OPTS
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
47 changes: 47 additions & 0 deletions build/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/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

# Print the jwt to the dappmanager
JWT=$(cat $JWT_PATH)
curl -X POST "http://my.dappnode/data-send?key=jwt&data=${JWT}"

exec besu --rpc-ws-host='0.0.0.0' \
--rpc-ws-enabled=$WS_ENABLED \
--rpc-http-host='0.0.0.0' \
--rpc-http-enabled=true \
--host-allowlist=* \
--rpc-http-cors-origins=* \
--engine-rpc-port=8551 \
--engine-host-allowlist=* \
--engine-jwt-secret=$JWT_PATH \
--engine-rpc-enabled=true \
--data-storage-format=$STORAGE_FORMAT \
--metrics-enabled \
--metrics-host='0.0.0.0' \
--data-path=/var/lib/besu \
--sync-mode=$SYNC_MODE \
--rpc-http-max-active-connections=$MAX_HTTP_CONNECTIONS \
--p2p-port=$P2P_PORT \
$EXTRA_OPTS
1 change: 1 addition & 0 deletions build/security/default/jwtsecret.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d15
1 change: 1 addition & 0 deletions build/security/lighthouse/jwtsecret.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d16
1 change: 1 addition & 0 deletions build/security/nimbus/jwtsecret.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d17
File renamed without changes.
1 change: 1 addition & 0 deletions build/security/teku/jwtsecret.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d19
17 changes: 13 additions & 4 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "besu.dnp.dappnode.eth",
"name": "besu.public.dappnode.eth",
"version": "1.2.1",
"description": "An enterprise-grade Java-based, Apache 2.0 licensed Ethereum Execution Layer client",
"shortDescription": "Java-based Ethereum Client",
Expand All @@ -15,6 +15,9 @@
"categories": ["Blockchain"],
"architectures": ["linux/amd64", "linux/arm64"],
"chain": "ethereum",
"requirements": {
"minimumDappnodeVersion": "0.2.60"
},
"exposable": [
{
"name": "Besu JSON RPC",
Expand All @@ -30,8 +33,8 @@
}
],
"links": {
"endpoint": "http://besu.dappnode:8545",
"apiEngine": "http://besu.dapppnode:8551",
"endpoint": "http://besu.public.dappnode:8545",
"apiEngine": "http://besu.public.dapppnode:8551",
"homepage": "https://github.com/hyperledger/besu",
"docs": "https://besu.hyperledger.org/en/stable/"
},
Expand All @@ -42,5 +45,11 @@
"type": "git",
"url": "https://github.com/dappnode/DAppNodePackage-Besu.git"
},
"license": "Apache-2.0"
"license": "Apache-2.0",
"globalEnvs": [
{
"envs": ["CONSENSUS_CLIENT_MAINNET"],
"services": ["besu"]
}
]
}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3.5"
services:
node:
besu:
build:
context: build
args:
Expand All @@ -19,7 +19,7 @@ services:
MAX_HTTP_CONNECTIONS: "170"
P2P_PORT: "30414"
BESU_OPTS: ""
image: "node.besu.dnp.dappnode.eth:1.2.1"
image: "besu.besu.public.dappnode.eth:1.2.1"
restart: unless-stopped
volumes:
data: {}
6 changes: 3 additions & 3 deletions getting-started.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Besu (Execution Client)

Welcome to the Merged Besu Ethereum Mainnet Consensus Layer Client
Welcome to the Merged Besu Ethereum Mainnet Execution Layer Client

There are now two RPC APIs in Execution Clients:

1. Querying API `http://besu.dappnode:8545`. Use this endpoint to query transactions on your node and connect to it with your web3 wallet.
2. Engine API `http://besu.dappnode:8551`. Use this endpoint to connect your Beacon Chain (Consensus Layer) client.
1. Querying API `http://besu.public.dappnode:8545`. Use this endpoint to query transactions on your node and connect to it with your web3 wallet.
2. Engine API `http://besu.public.dappnode:8551`. Use this endpoint to connect your Beacon Chain (Consensus Layer) client.

If your Execution Client is not connected to a Consensus Layer client, you won't be able to keep it synced, nor use it to query the blockchain, nor will you be able to connect your wallet to it!
18 changes: 8 additions & 10 deletions prometheus-targets.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[
{
"labels": {
"package": "besu.dnp.dappnode.eth",
"service": "node.besu.dappnode",
"__metrics_path__": "/metrics"
},
"targets": [
"node.besu.dnp.dappnode:9545"
]
}
{
"labels": {
"package": "besu.public.dappnode.eth",
"service": "node.besu.dappnode",
"__metrics_path__": "/metrics"
},
"targets": ["node.besu.public.dappnode:9545"]
}
]
10 changes: 5 additions & 5 deletions setup-wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fields:
target:
type: environment
name: CONFIG_MODE
service: node
service: besu
enum:
- "normal"
- "advanced"
Expand All @@ -26,7 +26,7 @@ fields:
target:
type: environment
name: STORAGE_FORMAT
service: node
service: besu
enum:
- BONSAI
- FOREST
Expand All @@ -45,7 +45,7 @@ fields:
target:
type: environment
name: SYNC_MODE
service: node
service: besu
enum:
- FAST
- FULL
Expand All @@ -60,7 +60,7 @@ fields:
target:
type: environment
name: WS_ENABLED
service: node
service: besu
enum:
- "true"
- "false"
Expand All @@ -72,5 +72,5 @@ fields:
target:
type: environment
name: MAX_HTTP_CONNECTIONS
service: besu.public.dappnode.eth
service: besu
if: { "config_mode": { "enum": ["advanced"] } }

0 comments on commit 5d01106

Please sign in to comment.