diff --git a/.github/workflows/auto_check.yml b/.github/workflows/auto_check.yml new file mode 100644 index 0000000..f62a971 --- /dev/null +++ b/.github/workflows/auto_check.yml @@ -0,0 +1,20 @@ +name: Bump upstream version + +on: + schedule: + - cron: "00 */4 * * *" + workflow_dispatch: + push: + branches: + - "master" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - 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 }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8d478f4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: "Main" +on: + repository_dispatch: + pull_request: + push: + branches: + - "master" + - "v[0-9]+.[0-9]+.[0-9]+" + paths-ignore: + - "README.md" + +jobs: + build-test: + runs-on: ubuntu-latest + name: Build test + steps: + - uses: actions/checkout@v3 + - run: npx @dappnode/dappnodesdk build --skip_save + + e2e-test: + runs-on: mainnet + needs: build-test + if: github.event_name != 'push' + name: End to end tests + steps: + - uses: actions/checkout@v3 + - run: npx @dappnode/dappnodesdk@latest github-action test-end-to-end --errorLogsTimeout 120 --healthCheckUrl http://geth.dappnode:8545 --network mainnet + + release: + name: Release + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event_name == 'repository_dispatch' + steps: + - uses: actions/checkout@v3 + - name: Publish + run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset --timeout 2h + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1" diff --git a/.gitignore b/.gitignore index 2bd624b..449d92f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ build_* +.DS_Store +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..650bcea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +ARG UPSTREAM_VERSION + +FROM ethereum/client-go:${UPSTREAM_VERSION} + +COPY /security /security +COPY entrypoint.sh /usr/local/bin/entrypoint.sh + +RUN apk update && apk add curl + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..56f5371 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Geth Dappnode package + +[![Geth github](https://img.shields.io/badge/Geth-Github-blue.svg)](https://github.com/ethereum/go-ethereum) + +Dappnode Package for execution client Geth in Ethereum mainnet. + +## License + +This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details diff --git a/build/Dockerfile b/build/Dockerfile deleted file mode 100644 index 0f11e46..0000000 --- a/build/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Build Geth in a stock Go builder container -FROM golang:1.11-alpine as builder - -WORKDIR /usr/src/app - -RUN apk add --no-cache make gcc musl-dev linux-headers git jq - -ARG COMMIT=cfbb969da803d4cc92e1a64fc1b3c06db299b564 - -RUN git clone https://github.com/ethereum/go-ethereum.git -RUN cd go-ethereum && git checkout $COMMIT && make geth - -# Pull Geth into a second stage deploy alpine container -FROM alpine:latest - -RUN apk add --no-cache ca-certificates -COPY --from=builder /usr/src/app/go-ethereum/build/bin/geth /usr/local/bin/ - -ENTRYPOINT geth --datadir /root/.ethereum/ethchain-geth --rpc --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*" --ws --wsorigins "*" --wsaddr 0.0.0.0 $EXTRA_OPTS diff --git a/dappnode_package.json b/dappnode_package.json index 2a97c86..ff5a827 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -1,30 +1,43 @@ { - "name": "ethchain-geth.public.dappnode.eth", - "version": "0.0.3", - "description": "Mainnet Geth", - "avatar": "/ipfs/QmTfnrUdZWaMgr2Zi1h1Z7zS5CbYtQZRs72yqKZQHj5fxT", - "type": "library", + "name": "geth.dnp.dappnode.eth", + "version": "0.1.44", + "upstreamVersion": "v1.14.3", + "upstreamRepo": "ethereum/go-ethereum", + "upstreamArg": "UPSTREAM_VERSION", + "shortDescription": "Geth is the official Go implementation of the Ethereum protocol.", + "description": "Ethereum is a global, open-source platform for decentralized applications where you can write code that controls digital value, runs exactly as programmed, and is accessible anywhere in the world.", + "type": "service", + "architectures": ["linux/amd64", "linux/arm64"], "chain": "ethereum", - "image": { - "path": "ethchain-geth.public.dappnode.eth_0.0.3.tar.xz", - "hash": "/ipfs/QmdQF3arvXiEkJ8DSR1auzCqxyhpmv1fGL1acTBQYyZvfr", - "size": 16184810, - "restart": "always", - "ports": [ - "61313:30303", - "61313:30303/udp", - "61314:30304" - ], - "volumes": [ - "ethchain-geth:/root/.ethereum/ethchain-geth" - ], - "environment": [ - "EXTRA_OPTS=--rpcapi eth,net,web3,txpool" - ] - }, - "author": "nanexcool", - "license": "GLP-3.0", + "dockerTimeout": "20min", + "author": "DAppNode Association (https://github.com/dappnode)", + "contributors": [ + "Mariano Conti (nanexcool) (hhttps://github.com/nanexcool)", + "Eduardo Antuña (https://github.com/eduadiez)", + "MysticRyuujin (https://github.com/MysticRyuujin)" + ], + "categories": ["Blockchain"], + "keywords": ["geth", "go-ethereum", "ethereum", "client", "execution"], + "license": "GPL-3.0", "links": { - "endpoint": "http://my.ethchain-geth.public.dappnode.eth:8545" - } -} \ No newline at end of file + "api": "http://geth.dappnode:8545", + "apiEngine": "http://geth.dappnode:8551", + "homepage": "https://github.com/dappnode/DAppNodePackage-geth#readme" + }, + "repository": { + "type": "git", + "url": "https://github.com/dappnode/DAppNodePackage-geth.git" + }, + "bugs": { + "url": "https://github.com/dappnode/DAppNodePackage-geth/issues" + }, + "requirements": { + "minimumDappnodeVersion": "0.2.60" + }, + "globalEnvs": [ + { + "envs": ["CONSENSUS_CLIENT_MAINNET"], + "services": ["geth.dnp.dappnode.eth"] + } + ] +} diff --git a/docker-compose.yml b/docker-compose.yml index 677b6e4..78a638a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,20 @@ -version: '3.4' +version: "3.5" services: - ethchain-geth.public.dappnode.eth: - image: 'ethchain-geth.public.dappnode.eth:0.0.3' - build: ./build + geth.dnp.dappnode.eth: + image: geth.dnp.dappnode.eth:0.1.38 + build: + context: . + args: + UPSTREAM_VERSION: v1.14.3 volumes: - - 'ethchain-geth:/root/.ethereum/ethchain-geth' + - geth:/root/.ethereum environment: - - EXTRA_OPTS= + - EXTRA_OPTION=--http.api eth,engine,net,web3,txpool + - P2P_PORT=30403 + - SYNCMODE=snap ports: - - '127.0.0.1:8546:8546' - - '127.0.0.1:8545:8545' - - '61313:30303' - - '61313:30303/udp' - - '61314:30304/udp' + - 30403:30403/tcp + - 30403:30403/udp + restart: unless-stopped volumes: - ethchain-geth: {} \ No newline at end of file + geth: {} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..1a48dd0 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,50 @@ +#!/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" + ;; +"lodestar.dnp.dappnode.eth") + echo "Using lodestar.dnp.dappnode.eth" + JWT_PATH="/security/lodestar/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 geth \ + --http \ + --http.addr 0.0.0.0 \ + --http.corsdomain "*" \ + --http.vhosts "*" \ + --syncmode ${SYNCMODE:-snap} \ + --ws \ + --ws.origins "*" \ + --ws.addr 0.0.0.0 \ + --port ${P2P_PORT} \ + --metrics \ + --metrics.addr 0.0.0.0 \ + --authrpc.addr 0.0.0.0 \ + --authrpc.port 8551 \ + --authrpc.vhosts "*" \ + --authrpc.jwtsecret ${JWT_PATH} \ + $EXTRA_OPTION diff --git a/geth-avatar.png b/geth-avatar.png new file mode 100644 index 0000000..bf9f30c Binary files /dev/null and b/geth-avatar.png differ diff --git a/getting-started.md b/getting-started.md new file mode 100644 index 0000000..d5a7966 --- /dev/null +++ b/getting-started.md @@ -0,0 +1,8 @@ +# Geth (Execution Client) + +There are now two RPC APIs in Execution Clients: + +1. Querying API `http://geth.dappnode:8545`. Use this endpoint to query transactions on your node and connect your web3 wallet. +2. Engine API `http//geth.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/releases.json b/releases.json new file mode 100644 index 0000000..3c6bba0 --- /dev/null +++ b/releases.json @@ -0,0 +1,64 @@ +{ + "0.1.2": { + "hash": "/ipfs/QmZmT9gEw7YdXHh9Yx22sHZYtWri1f1SrQxBQs4ctKkSC2", + "type": "directory", + "uploadedTo": { + "dappnode": "Fri, 29 Nov 2019 21:53:08 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.2&h=%2Fipfs%2FQmZmT9gEw7YdXHh9Yx22sHZYtWri1f1SrQxBQs4ctKkSC2" + }, + "0.1.3": { + "hash": "/ipfs/QmbrBkpBGmx79B5anoTQLhq8wnYPCiz69eNWwu4jiuMGFx", + "type": "directory", + "uploadedTo": { + "dappnode": "Fri, 03 Jan 2020 14:56:46 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.3&h=%2Fipfs%2FQmbrBkpBGmx79B5anoTQLhq8wnYPCiz69eNWwu4jiuMGFx" + }, + "0.1.4": { + "hash": "/ipfs/QmNqDvqAyy3pN3PvymB6chM7S1FgYyive8LosVKUuaDdfd", + "type": "directory", + "uploadedTo": { + "dappnode": "Fri, 06 Mar 2020 14:06:12 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.4&h=%2Fipfs%2FQmNqDvqAyy3pN3PvymB6chM7S1FgYyive8LosVKUuaDdfd" + }, + "0.1.5": { + "hash": "/ipfs/QmYSoV4pxNZmHckZHXKCLBXBeESWYdbrCgduGFwpWLzPoi", + "type": "directory", + "uploadedTo": { + "dappnode": "Fri, 17 Apr 2020 12:08:45 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.5&h=%2Fipfs%2FQmYSoV4pxNZmHckZHXKCLBXBeESWYdbrCgduGFwpWLzPoi" + }, + "0.1.6": { + "hash": "/ipfs/QmazbxJNXNn5kUe3PHRiMpJtvf91o6SUM4uFphj9znuVt3", + "type": "directory", + "uploadedTo": { + "remote": "Thu, 14 May 2020 16:22:40 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.6&h=%2Fipfs%2FQmazbxJNXNn5kUe3PHRiMpJtvf91o6SUM4uFphj9znuVt3" + }, + "0.1.7": { + "hash": "/ipfs/QmTujfYrQwWG7kRwQX4nBD7TmSDjjSfRkj4CdZW3rmDJLC", + "type": "directory", + "uploadedTo": { + "dappnode": "Fri, 07 Aug 2020 12:53:48 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.7&h=%2Fipfs%2FQmd7jLvxVmUziFFVV9M6R4Svn7KGiM1VGg6kymbCknCgF1" + }, + "0.1.8": { + "hash": "/ipfs/QmUf1uzqZdXyKt4YB96nr1F9GtxUWnPu8hSs7WXJnoc5Cj", + "uploadedTo": { + "remote": "Fri, 07 Aug 2020 12:54:45 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.8&h=%2Fipfs%2FQmUf1uzqZdXyKt4YB96nr1F9GtxUWnPu8hSs7WXJnoc5Cj" + }, + "0.1.9": { + "hash": "/ipfs/QmPF4HJoNmJkoFBedv2CfVQGdPECYTmnZU3kCTodN4vkqg", + "uploadedTo": { + "dappnode": "Wed, 25 Nov 2020 09:18:56 GMT" + }, + "link": "http://my.dappnode/#/sdk/publish/r=geth.dnp.dappnode.eth&v=0.1.9&h=%2Fipfs%2FQmbpQoSXzPcBwm1LUeVMPosgsVUf772pN32xjDyxWnPEHT" + } +} 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/lodestar/jwtsecret.hex b/security/lodestar/jwtsecret.hex new file mode 100644 index 0000000..fa9ef2d --- /dev/null +++ b/security/lodestar/jwtsecret.hex @@ -0,0 +1 @@ +7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d20 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/security/prysm/jwtsecret.hex b/security/prysm/jwtsecret.hex new file mode 100644 index 0000000..68dc70a --- /dev/null +++ b/security/prysm/jwtsecret.hex @@ -0,0 +1 @@ +7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d18 \ No newline at end of file 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