Skip to content
Open
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-latest
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.24.0

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

- name: Verify dependencies
run: go mod verify

- name: Build all
run: make all

- name: Run tests
run: go test -short ./...

- 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
40 changes: 20 additions & 20 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ name: i386 linux tests

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

jobs:
lint:
name: Lint
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

# Cache build tools to avoid downloading them each time
- uses: actions/cache@v4
with:
path: build/cache
key: ${{ runner.os }}-build-tools-cache-${{ hashFiles('build/checksums.txt') }}
# Cache build tools to avoid downloading them each time
- uses: actions/cache@v4
with:
path: build/cache
key: ${{ runner.os }}-build-tools-cache-${{ hashFiles('build/checksums.txt') }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.0
cache: false
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.0
cache: false

- name: Run linters
run: |
go run build/ci.go lint
go run build/ci.go check_generate
go run build/ci.go check_baddeps
- name: Run linters
run: |
go run build/ci.go lint
go run build/ci.go check_generate
go run build/ci.go check_baddeps

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.24.0
cache: false
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.24.0
uses: actions/setup-go@v3
with:
go-version: 1.24.0
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
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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/

# binaries
Expand All @@ -55,4 +72,6 @@ cmd/ethkey/ethkey
cmd/evm/evm
cmd/geth/geth
cmd/rlpdump/rlpdump
cmd/workload/workload
cmd/workload/workload
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
30 changes: 15 additions & 15 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.24-alpine AS builder

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

# 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

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
Loading
Loading