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

Implement web3signer support #14

Merged
merged 19 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/auto_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Bump upstream version

on:
schedule:
- cron: "00 */4 * * *"
push:
branches:
- "master"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npx @dappnode/dappnodesdk github-action bump-upstream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}
6 changes: 3 additions & 3 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- **Is your first login?** use the link with the token attached below. For more information and a full guide on the new method of accessing the Prysm Prater Dashboard visit this forum [post](https://forum.dappnode.io/t/how-to-access-the-prysm-prater-webui-in-v0-1-5-upstream-v2-0-3-and-above/1304)
## Welcome to your eth2 client Prysm-gnosis:

- If you have already logged in with the token go to [gnosis-beacon-chain-prysm.dappnode](http://gnosis-beacon-chain-prysm.dappnode/)
- Upload your keystores in the [web3signer-ui](http://ui.web3signer-gnosis.dappnode?signer_url=http://web3signer.web3signer-gnosis.dappnode:9000) (do not have web3singer-gnosis yet? install it [here](http://my.dappnode/#/installer/web3signer-gnosis.dnp.dappnode.eth))

- If you want to have the complete dashboard with all the metrics you will have to install [metrics-tools](http://my.dappnode/#/installer/metrics-tools.dnp.dappnode.eth) (Grafana dashboard thanks to amazing work of [metanull-operator](https://github.com/metanull-operator/eth2-grafana))
- If you want to have the complete dashboard with all the metrics you will have to install [metrics-tools](http://my.dappnode/#/installer/metrics-tools.dnp.dappnode.eth) (Grafana dashboard thanks to amazing work of [metanull-operator](https://github.com/metanull-operator/eth2-grafana))
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# DAppNodePackage-Gnosis-Beacon-Chain
# Prysm DAppNode package (gnosis config)

Gnosis Beacon Chain (GBC) brings vital canary network functionality to the burgeoning Ethereum 2.0 ecosystem. Applications can iterate through real-world strategies, stage important applications, or choose to run DApps in a faster, lower-stakes environment while enjoying the benefits of massive scalability. This package includes a Prysm validator client to validate the PoS chain
[![prysm github](https://img.shields.io/badge/prysm-Github-blue.svg)](https://prylabs.net/)
[![prysm participate](https://img.shields.io/badge/prysm-participate-753a88.svg)](https://prylabs.net/participate?node=dappnode)

**Prysm gnosis ETH2.0 Beacon chain + validator**

Validate with prysm: a Go implementation of the Ethereum 2.0 Serenity protocol and open source project created by Prysmatic Labs. Beacon node which powers the beacon chain at the core of Ethereum 2.0

![avatar](avatar-default.png)

Grafana dashboard thanks to the amazing work of [metanull-operator](https://github.com/metanull-operator/eth2-grafana)

| Updated | Champion/s |
| :----------------: | :--------: |
Expand Down
Binary file removed avatar-default.png
Binary file not shown.
51 changes: 30 additions & 21 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
FROM debian:buster-slim
##############
# Base image #
##############
ARG UPSTREAM_VERSION
FROM ghcr.io/gnosischain/gbc-prysm-beacon-chain:${UPSTREAM_VERSION}-gbc as base

COPY --from=ghcr.io/gnosischain/gbc-prysm-beacon-chain:v2.1.2-gbc /app/cmd/beacon-chain/beacon-chain /usr/local/bin/beacon-chain
################
# Config image #
################
FROM debian:bullseye-slim as config

WORKDIR /usr/src/app
RUN apt update && apt install curl --yes && \
curl https://raw.githubusercontent.com/gnosischain/prysm-launch/master/config/bootnodes.yaml -o bootnodes.yaml && \
curl https://raw.githubusercontent.com/gnosischain/prysm-launch/master/config/config.yml -o config.yml

################
# Runner image #
################
FROM debian:bullseye-slim

RUN apt update && \
apt install -y ca-certificates file && \
apt install ca-certificates file --yes && \
rm -rf /var/lib/apt/lists/*

COPY /config/bootnodes.yaml /root/sbc/config/
COPY /config/config.yml /root/sbc/config/

ENTRYPOINT [ "sh", "-c", "exec beacon-chain \
--datadir=/data \
--rpc-host=0.0.0.0 \
--grpc-gateway-host=0.0.0.0 \
--monitoring-host=0.0.0.0 \
--p2p-local-ip=0.0.0.0 \
--http-web3provider=\"$XDAI_RPC_URL\" \
--grpc-gateway-port=3500 \
--grpc-gateway-corsdomain=\"$CORSDOMAIN\" \
--accept-terms-of-use \
--contract-deployment-block=\"$DEPLOYMENT_BLOCK\" \
--bootstrap-node /root/sbc/config/bootnodes.yaml \
--config-file /root/sbc/config/config.yml \
--chain-config-file /root/sbc/config/config.yml \
$EXTRA_OPTS" ]
# Get the binary from the base image
COPY --from=base /app/cmd/beacon-chain/beacon-chain /usr/local/bin/beacon-chain

# Prysm launch gnosis config: https://github.com/gnosischain/prysm-launch/tree/master/config
COPY --from=config /usr/src/app/bootnodes.yaml /root/sbc/config/
COPY --from=config /usr/src/app/config.yml /root/sbc/config/

COPY entrypoint.sh /usr/local/bin

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
4 changes: 0 additions & 4 deletions beacon-chain/config/bootnodes.yaml

This file was deleted.

160 changes: 0 additions & 160 deletions beacon-chain/config/config.yml

This file was deleted.

25 changes: 25 additions & 0 deletions beacon-chain/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

if [[ -n $WEB3_BACKUP ]] && [[ $EXTRA_OPTS != *"--fallback-web3provider"* ]]; then
EXTRA_OPTS="--fallback-web3provider=${WEB3_BACKUP} ${EXTRA_OPTS}"
fi

if [[ -n $CHECKPOINT_SYNC_URL ]]; then
EXTRA_OPTS="--checkpoint-sync-url=${CHECKPOINT_SYNC_URL} --genesis-beacon-api-url=${CHECKPOINT_SYNC_URL} ${EXTRA_OPTS}"
fi

exec -c beacon-chain \
--datadir=/data \
--rpc-host=0.0.0.0 \
--grpc-gateway-host=0.0.0.0 \
--monitoring-host=0.0.0.0 \
--p2p-local-ip=0.0.0.0 \
--http-web3provider=$HTTP_WEB3PROVIDER \
--grpc-gateway-port=3500 \
--grpc-gateway-corsdomain=$CORSDOMAIN \
--accept-terms-of-use \
--contract-deployment-block=$DEPLOYMENT_BLOCK \
--bootstrap-node /root/sbc/config/bootnodes.yaml \
--config-file /root/sbc/config/config.yml \
--chain-config-file /root/sbc/config/config.yml \
$EXTRA_OPTS
22 changes: 15 additions & 7 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"name": "gnosis-beacon-chain-prysm.dnp.dappnode.eth",
"version": "0.1.0",
"upstreamVersion": "v2.1.2-gbc",
"version": "1.0.0",
"upstreamVersion": "v2.1.2",
"upstreamRepo": "prysmaticlabs/prysm",
"upstreamArg": "UPSTREAM_VERSION",
"description": "Gnosis Beacon Chain (GBC) brings vital canary network functionality to the burgeoning Ethereum 2.0 ecosystem. Applications can iterate through real-world strategies, stage important applications, or choose to run DApps in a faster, lower-stakes environment while enjoying the benefits of massive scalability. This package includes a Prysm validator client to validate the PoS chain",
"shortDescription":"Gnosis Beacon Chain node + validator",
"shortDescription": "Gnosis Beacon Chain node + validator",
"type": "service",
"mainService": "validator",
"architectures": ["linux/amd64", "linux/arm64"],
"architectures": ["linux/amd64"],
"author": "DAppNode Association <admin@dappnode.io> (https://github.com/dappnode)",
"contributors": [
"pablo <pablo@dappnode.io> (https://github.com/pablomendezroyo)",
"tropicar <tropicar@dappnode.io> (https://github.com/tropicar)"
],
"categories": ["Blockchain", "ETH2.0"],
"license": "GLP-3.0",
"chain": {
"driver": "ethereum-beacon-chain",
"serviceName": "beacon-chain",
"portNumber": 3500
},
"repository": {
"type": "git",
"url": "https://github.com/dappnode/DAppNodePackage-Gnosis-Beacon-Chain-Prysm.git"
Expand All @@ -21,7 +29,7 @@
"url": "https://github.com/dappnode/DAppNodePackage-Gnosis-Beacon-Chain-Prysm/issues"
},
"requirements": {
"minimumDappnodeVersion": "0.2.39"
"minimumDappnodeVersion": "0.2.51"
},
"backup": [
{
Expand All @@ -31,8 +39,8 @@
}
],
"links": {
"ui": "http://gnosis-beacon-chain-prysm.dappnode/",
"readme": "https://github.com/dappnode/DAppNodePackage-prysm-prater",
"ui": "http://ui.web3signer-gnosis.dappnode?signer_url=http://web3signer.web3signer-gnosis.dappnode:9000",
"readme": "https://github.com/dappnode/DAppNodePackage-gnosis-beacon-chain-prysm",
"docs": "https://docs.gnosischain.com/"
}
}
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ services:
build:
context: beacon-chain
args:
UPSTREAM_VERSION: v2.1.2-gbc
UPSTREAM_VERSION: v2.1.2
volumes:
- "beacon-chain-data:/data"
ports:
- 12000/udp
- "13000"
restart: unless-stopped
environment:
XDAI_RPC_URL: "https://rpc.xdaichain.com/"
CHECKPOINT_SYNC_URL: ""
WEB3_BACKUP: "https://rpc.gnosischain.com/"
HTTP_WEB3PROVIDER: "http://nethermind-xdai.dappnode:8545"
CORSDOMAIN: "http://gnosis-beacon-chain-prysm.dappnode"
DEPLOYMENT_BLOCK: 19469077
EXTRA_OPTS: ""
Expand All @@ -22,7 +24,7 @@ services:
build:
context: validator
args:
UPSTREAM_VERSION: v2.1.2-gbc
UPSTREAM_VERSION: v2.1.2
volumes:
- "validator-data:/root/"
restart: unless-stopped
Expand Down
Binary file added prysm-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading