Skip to content

Commit 83ebaac

Browse files
feat: add trueblocks image (#384)
## Summary Adds an `ethpandaops/trueblocks` image build (`chifra` from `TrueBlocks/trueblocks-core`). Consumed by [ethpandaops/ethereum-package#1404](ethpandaops/ethereum-package#1404) to run the chifra daemon as a kurtosis additional service. TrueBlocks stopped publishing official Docker images after `v5.0.0`. ## Files | File | Purpose | | --- | --- | | `trueblocks/Dockerfile` | Multi-stage build, `golang:1.25.1-bookworm` → `debian:bookworm-slim`, ENTRYPOINT chifra | | `.github/workflows/build-push-trueblocks.yml` | Manual build workflow (modeled on `build-push-slashoor.yml`) | | `branches.yaml` | Adds `trueblocks: [main, v5.9.3]` | | `platforms.yaml` | Adds `trueblocks: [linux/amd64, linux/arm64]` | | `generate_config.py` | Adds `'trueblocks': 'TrueBlocks/trueblocks-core'` to `DEFAULT_REPOS` | | `README.md` | Tooling workflows list addition | The image also ships chifra's bundled per-chain configs (`allocs.csv` etc.) from `src/other/install/per-chain/`. ## Test plan - [x] Local build via `docker buildx build --file ./trueblocks/Dockerfile <source>` against `v5.9.3` — succeeds, image is 139 MB. - [x] End-to-end via [ethereum-package#1404](ethpandaops/ethereum-package#1404) on an Erigon + Lighthouse devnet: chifra daemon comes up, `/status` returns `isArchive: true`, `trueblocksVersion: GHC-TrueBlocks//5.9.3`; `/blocks`, `/list`, `/chunks` all respond. - [ ] Trigger the workflow once after merge to publish the first `ethpandaops/trueblocks:v5.9.3` and `ethpandaops/trueblocks:main` tags. --------- Signed-off-by: Chase Wright <chase.wright@ethereum.org> Co-authored-by: Barnabas Busa <barnabas.busa@ethereum.org>
1 parent 17ae340 commit 83ebaac

6 files changed

Lines changed: 172 additions & 0 deletions

File tree

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build trueblocks docker image
2+
run-name: "${{ inputs.repository }}@${{ inputs.ref }}${{ inputs.correlation_id && format(' [{0}]', inputs.correlation_id) || '' }}"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
repository:
8+
description: The source trueblocks-core repository to build from
9+
default: TrueBlocks/trueblocks-core
10+
type: string
11+
required: true
12+
ref:
13+
description: The branch, tag or SHA to checkout and build from
14+
default: v5.9.3
15+
type: string
16+
required: true
17+
docker_tag:
18+
description: Override target docker tag (defaults to the above source ref if left blank)
19+
type: string
20+
required: false
21+
correlation_id:
22+
description: Optional correlation ID passed through to the run name (used by integrations)
23+
type: string
24+
required: false
25+
26+
jobs:
27+
prepare:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
platforms: ${{ steps.setup.outputs.platforms }}
31+
target_tag: ${{ steps.tag.outputs.docker_tag }}
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
- name: Prepare Matrix
35+
id: setup
36+
uses: ./.github/actions/prepare
37+
with:
38+
client: 'trueblocks'
39+
repository: ${{ inputs.repository }}
40+
ref: ${{ inputs.ref }}
41+
- name: Generate target tag
42+
id: tag
43+
uses: ./.github/actions/docker-tag
44+
with:
45+
input: ${{ inputs.docker_tag || inputs.ref }}
46+
repository: ${{ inputs.repository }}
47+
upstream_repository: TrueBlocks/trueblocks-core
48+
docker_tag: ${{ inputs.docker_tag }}
49+
deploy:
50+
needs:
51+
- prepare
52+
runs-on: ${{ matrix.runner }}
53+
continue-on-error: true
54+
strategy:
55+
matrix:
56+
include: ${{fromJson(needs.prepare.outputs.platforms)}}
57+
outputs:
58+
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
59+
steps:
60+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
61+
- uses: ./.github/actions/install-deps
62+
with:
63+
repository: ${{ inputs.repository }}
64+
- uses: ./.github/actions/deploy
65+
id: deploy
66+
with:
67+
source_repository: ${{ inputs.repository }}
68+
source_ref: ${{ inputs.ref }}
69+
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
70+
target_repository: ethpandaops/trueblocks
71+
target_dockerfile: ./trueblocks/Dockerfile
72+
platform: ${{ matrix.platform }}
73+
74+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
75+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
76+
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
77+
GOPROXY: "${{ vars.GOPROXY }}"
78+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
79+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
80+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
81+
82+
- name: Set job output
83+
id: set_output
84+
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
85+
shell: bash
86+
manifest:
87+
needs:
88+
- prepare
89+
- deploy
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
93+
- uses: ./.github/actions/manifest
94+
with:
95+
source_repository: ${{ inputs.repository }}
96+
source_ref: ${{ inputs.ref }}
97+
target_tag: ${{ needs.prepare.outputs.target_tag }}
98+
target_repository: ethpandaops/trueblocks
99+
platforms: ${{ needs.prepare.outputs.platforms }}
100+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
101+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
102+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
103+
git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }}
104+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
105+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
106+
notify:
107+
name: Discord Notification
108+
runs-on: ubuntu-latest
109+
needs:
110+
- prepare
111+
- deploy
112+
- manifest
113+
if: failure()
114+
steps:
115+
- name: Notify
116+
uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1
117+
with:
118+
github-token: ${{ secrets.github_token }}
119+
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Run the *Build **tooling*** workflow;
3737
- [Build Syncoor](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-syncoor.yml) [[source](https://github.com/ethpandaops/syncoor)]
3838
- [Build Slashoor](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-slashoor.yml) [[source](https://github.com/ethpandaops/slashoor)]
3939
- [Build ere-server-zisk](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-ere-server-zisk.yml) [[source](https://github.com/eth-act/ere)]
40+
- [Build TrueBlocks](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-trueblocks.yml) [[source](https://github.com/TrueBlocks/trueblocks-core)]
4041

4142
## Adding a new image to build on schedule
4243

branches.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ tooling:
184184
syncoor:
185185
branches:
186186
- master
187+
trueblocks:
188+
branches:
189+
- main
187190
tx-fuzz:
188191
branches:
189192
- master

generate_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
'ere-server-zisk': 'eth-act/ere',
4545
'zkboost': 'eth-act/zkboost',
4646
'fuzztools': 'protocol-security/fuzztools',
47+
'trueblocks': 'TrueBlocks/trueblocks-core',
4748
# Add more defaults as needed
4849
}
4950

platforms.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,6 @@ fuzztools:
125125
slashoor:
126126
- linux/amd64
127127
- linux/arm64
128+
trueblocks:
129+
- linux/amd64
130+
- linux/arm64

trueblocks/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Builds chifra from trueblocks-core source.
2+
3+
FROM golang:1.25.1-bookworm AS builder
4+
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends \
7+
ca-certificates \
8+
cmake \
9+
g++ \
10+
gcc \
11+
git \
12+
libcurl4-openssl-dev \
13+
make \
14+
python3 \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
COPY . /src
18+
WORKDIR /src
19+
20+
RUN git submodule update --init --recursive
21+
RUN scripts/go-work-sync.sh
22+
RUN mkdir build && cd build && cmake ../src && make -j"$(nproc)"
23+
24+
# ---------------------------------------------------------------------------
25+
26+
FROM debian:bookworm-slim
27+
28+
RUN apt-get update \
29+
&& apt-get install -y --no-install-recommends \
30+
ca-certificates \
31+
curl \
32+
libcurl4 \
33+
&& rm -rf /var/lib/apt/lists/*
34+
35+
COPY --from=builder /src/bin/chifra /usr/local/bin/chifra
36+
37+
# Tell chifra to look here instead of its default $HOME/.local/share/trueblocks
38+
ENV XDG_CONFIG_HOME=/config
39+
40+
# Ship chifra's bundled per-chain configs (allocs.csv etc.) for known public
41+
# networks; without them chifra's IsNodeArchive can't validate against block 0.
42+
COPY --from=builder /src/src/other/install/per-chain /config/config
43+
44+
EXPOSE 8080
45+
ENTRYPOINT ["chifra"]

0 commit comments

Comments
 (0)