Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade BSP to geth-v1.14.13 #241

Merged
merged 4 commits into from
Jan 30, 2025
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
43 changes: 43 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build-test

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "develop"

jobs:
audit:
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22.5

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

- name: Verify dependencies
run: go mod verify

- name: Build all
run: make all

- name: Run tests
run: make test

- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}

- name: Clean
run: make clean
46 changes: 46 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: docker-image-ci

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "develop"

jobs:
push-image:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: ${{ !env.ACT }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}

- uses: actions/checkout@v2
- name: Build & Publish the Docker image
if: ${{ !env.ACT }}
run: |
docker build . --file Dockerfile --tag ghcr.io/covalenthq/bsp-geth:latest
docker push ghcr.io/covalenthq/bsp-geth:latest

# - name: Start containers
# run: docker-compose -f "docker-compose.yml" up --build --remove-orphans --force-recreate --exit-code-from agent

# - name: Check running bsp-geth
# run: docker inspect bsp-geth

# - name: Check running containers
# run: docker ps

# - name: Stop containers
# if: always()
# run: docker-compose -f "docker-compose.yml" down
31 changes: 31 additions & 0 deletions .github/workflows/gcr-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: gcr-image

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "develop"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}

- uses: actions/checkout@v2
# - uses: satackey/[email protected]
- name: Build & Publish the Docker image
run: |
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:latest --push
11 changes: 5 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ name: i386 linux tests

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
workflow_dispatch:

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v2
with:
go-version: 1.23.0
cache: false
go-version: 1.22.5
- name: Run tests
run: go test -short ./...
env:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: golangci-lint

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "develop"
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci-build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Set up Go 1.22.5
uses: actions/setup-go@v3
with:
go-version: 1.22.5
id: go
- run: go version

- name: Lint
run: |
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2
# ./bin/golangci-lint run

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
21 changes: 21 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: dockerfile-lint

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "develop"

jobs:
linter:
name: lint-dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: lint dockerfile
uses: brpaz/hadolint-action@master
with:
dockerfile: "Dockerfile"
39 changes: 39 additions & 0 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: tag-release

on:
push:
tags:
- "v*.*.*"

jobs:
tagged-release:
name: Tagged Release
runs-on: "ubuntu-latest"

steps:
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}

- uses: actions/checkout@v2

# - uses: satackey/[email protected]

- name: Set env
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build & Publish the Docker image
run: |
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:stable -t us-docker.pkg.dev/covalent-project/network/bsp-geth:"${{ env.TAG }}" --push

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false
files: |
*.zip
*.tar.gz
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,23 @@ profile.cov
# VS Code
.vscode

# dashboard
/dashboard/assets/flow-typed
/dashboard/assets/node_modules
/dashboard/assets/stats.json
/dashboard/assets/bundle.js
/dashboard/assets/bundle.js.map
/dashboard/assets/package-lock.json

**/yarn-error.log

data/
ganache_data/
.env
scripts/
logs/
coverage.out
coverage.txt
tests/spec-tests/
bin/
out/
4 changes: 4 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignored:
- DL3018
- DL3016
- DL3059
32 changes: 16 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Support setting various labels on the final image
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
# # Support setting various labels on the final image
# ARG COMMIT=""
# ARG VERSION=""
# ARG BUILDNUM=""
ARG USER=$USER

# Build Geth in a stock Go builder container
FROM golang:1.23-alpine AS builder

RUN apk add --no-cache gcc musl-dev linux-headers git
# Build Geth in a stock Go builder container
FROM golang:1.22-alpine as builder

# 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 apk add --no-cache gcc musl-dev linux-headers git make

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
COPY . /go-ethereum
WORKDIR /go-ethereum
RUN go run build/ci.go install -static ./cmd/geth

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest
FROM alpine:3.21

RUN apk add --no-cache ca-certificates

COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/

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

# Add some metadata labels to help programmatic image consumption
ENTRYPOINT ["geth", "--mainnet", "--syncmode", "full", "--datadir", "/root/.ethereum/covalent", "--replication.targets", "redis://localhost:6379/?topic=replication", "--replica.result", "true", "--replica.specimen", "true", "--replica.blob", "true"]

# Add some metadata labels to help programatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.23-alpine AS builder
FROM golang:1.22-alpine AS builder

RUN apk add --no-cache gcc musl-dev linux-headers git

Expand Down
Loading