Skip to content

Commit

Permalink
geth v1.13.15
Browse files Browse the repository at this point in the history
lighthouse v5.2.1
mamoru_v1:
Fix/fix version errors (ethereum#87) 1035a6b
geth-mamoru-core-sdk v1.13.11-0.11.3
  • Loading branch information
gofmanaa committed Jul 3, 2024
1 parent c5ba367 commit 0949c90
Show file tree
Hide file tree
Showing 17 changed files with 713 additions and 417 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
build/_workspace
build/_bin
tests/testdata
tmp_node
23 changes: 0 additions & 23 deletions .github/workflows/go.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/mamoru-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Test

on:
push:
branches:
- master
- "mamoru*"
- develop


pull_request:
branches:
- master
- "mamoru*"
- develop


jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Checkout code
uses: actions/checkout@v3

- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup SSH for Private Repository Access
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set Git to use SSH for GitHub
run: git config --global url."[email protected]:".insteadOf "https://github.com/"

- name: Test Build
run: |
ls ~/.ssh
go mod download
make geth
58 changes: 58 additions & 0 deletions .github/workflows/mamoru-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Build docker image"
on:
push:
branches:
- master
- "mamoru*"
- develop

env:
REPOSITORY: mamorufoundation/go-ethereum-sniffer

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Get current date
id: date
run: echo "::set-output name=date::$(date -u +'%Y-%m-%d')"

- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Prepare git and ssh config for build context
run: |
mkdir -p root-config
cp -r ~/.gitconfig ~/.ssh root-config/
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
build-args: |
GIT_REVISION=${{ github.sha }}
BUILD_DATE=${{ steps.date.outputs.date }}
PROFILE=release
push: true
tags: |
${{ env.REPOSITORY }}:latest
${{ env.REPOSITORY }}:${{ github.sha }}
cache-to: type=local,dest=/tmp/docker-cache
cache-from: type=local,src=/tmp/docker-cache,mode=max
ssh: |
default=${{ env.SSH_AUTH_SOCK }}
65 changes: 65 additions & 0 deletions .github/workflows/mamoru-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Unit Test

on:
push:
branches:
- master
- "mamoru*"
- develop

pull_request:
branches:
- master
- "mamoru*"
- develop

jobs:
unit-test:

runs-on: self-hosted

steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- run: go version

- name: Checkout code
uses: actions/checkout@v3

- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup SSH for Private Repository Access
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set Git to use SSH for GitHub
run: git config --global url."[email protected]:".insteadOf "https://github.com/"

- name: Set Git to use SSH for GitHub
run: git config --global url."ssh://[email protected]:".insteadOf "https://github.com/"

- name: Unit Test
env:
ANDROID_HOME: "" # Skip android test
run: |
go mod download
make test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
*/**/*tx_database*
*/**/*dapps*
build/_vendor/pkg

tmp_node
#*
.#*
*#
*~
.project
.settings
/root-config

# used by the Makefile
/build/_workspace/
Expand Down
46 changes: 36 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,53 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.21-alpine as builder
FROM golang:1.21 as builder

RUN apk add --no-cache gcc musl-dev linux-headers git
RUN apt-get update \
&& apt-get install -y gcc musl-dev git curl tar libc6-dev


# Copy the two files in place and fix different path/locations inside the Docker image
COPY root-config /root/
RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts

# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod /go-ethereum/
COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download
RUN --mount=type=ssh cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
RUN cd /go-ethereum && GO111MODULE=on go run build/ci.go install ./cmd/geth

# Install the Lighthouse Consensus Client
ENV LIGHTHOUSE_VERSION=v5.2.1
RUN curl -LO https://github.com/sigp/lighthouse/releases/download/${LIGHTHOUSE_VERSION}/lighthouse-${LIGHTHOUSE_VERSION}-x86_64-unknown-linux-gnu.tar.gz
RUN tar xvf lighthouse-${LIGHTHOUSE_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
&& mv lighthouse /usr/local/bin \
&& rm lighthouse-${LIGHTHOUSE_VERSION}-x86_64-unknown-linux-gnu.tar.gz

# Pull Geth into a second stage deploy debian container
FROM debian:12.0-slim
#debian:bullseye-slim

COPY docker/cron/cron.conf /etc/cron.d/cron.conf
COPY docker/cron/prune.sh /prune.sh
COPY docker/supervisord/gethlighthousebn.conf /etc/supervisor/conf.d/supervisord.conf
# Install Supervisor and create the Unix socket
RUN touch /var/run/supervisor.sock

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest
RUN apt-get update \
&& apt-get install -y ca-certificates jq unzip bash grep curl sed htop procps cron supervisor \
&& apt-get clean \
&& crontab /etc/cron.d/cron.conf

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
COPY --from=builder /usr/local/bin/lighthouse /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]
EXPOSE 9000 8545 8546 8551 30303 30303/udp

ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Add some metadata labels to help programatic image consumption
ARG COMMIT=""
ARG VERSION=""
Expand Down
Loading

0 comments on commit 0949c90

Please sign in to comment.