Skip to content

Commit 4b59cab

Browse files
authored
Merge pull request #65 from flare-foundation/v1_11_0-upgrade-prerelease
Upgrade to v1.11.0
2 parents f529e68 + ed4f6fc commit 4b59cab

File tree

2,338 files changed

+155459
-96018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,338 files changed

+155459
-96018
lines changed

.github/workflows/build-binary.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
tags:
99

1010
env:
11-
go_version: 1.21.8
11+
go_version: 1.22.12
1212

1313
jobs:
1414
build:
@@ -24,7 +24,6 @@ jobs:
2424
with:
2525
go-version: ${{ env.go_version }}
2626

27-
2827
- run: echo "IMAGE_TAG=dev" >> $GITHUB_ENV
2928
if: ${{ github.ref_name }} == 'main'
3029
- run: echo "IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
@@ -33,6 +32,8 @@ jobs:
3332
- run: sudo apt-get update -y && sudo apt-get install -y rsync
3433
- name: build
3534
id: build
35+
env:
36+
GOPATH: ${{ github.workspace }}/go
3637
run: |
3738
cd avalanchego
3839
./scripts/build.sh
Lines changed: 101 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,132 @@
11
name: container-images
22

3-
43
on:
54
push:
6-
branches: [ "main" ]
5+
branches: [ "main", "feature/**" ]
76
tags: [ "v*" ]
87

98
jobs:
10-
build-and-push:
11-
runs-on: ubuntu-latest
9+
build-and-push-matrix:
10+
name: Build & Push Matrix
11+
runs-on: ${{ matrix.runner }}
1212
permissions:
1313
contents: read
1414
packages: write
15+
id-token: write
16+
env:
17+
USE_DOCKER_HUB: true
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- platform: linux/amd64
23+
runner: ubuntu-24.04
24+
- platform: linux/arm64
25+
runner: ubuntu-24.04-arm
26+
1527
steps:
16-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
1729
with:
1830
fetch-depth: 0
19-
- uses: docker/setup-qemu-action@v1
20-
- uses: docker/setup-buildx-action@v1
31+
- uses: docker/setup-qemu-action@v3
32+
- uses: docker/setup-buildx-action@v3
2133

2234
- run: echo "IMAGE_TAG=dev" >> $GITHUB_ENV
23-
if: github.ref_name == 'main'
35+
if: github.ref_name == 'main' || startsWith(github.ref_name, 'feature/')
2436
- run: echo "IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
2537
if: startsWith(github.ref, 'refs/tags/v')
2638

2739
- name: Login to ghcr.io
28-
uses: docker/login-action@v2
40+
uses: docker/login-action@v3
2941
with:
3042
registry: ghcr.io
3143
username: ${{ github.actor }}
3244
password: ${{ secrets.GITHUB_TOKEN }}
3345

3446
- name: Login to docker.io
35-
uses: docker/login-action@v2
47+
if: ${{ env.USE_DOCKER_HUB == 'true' }}
48+
uses: docker/login-action@v3
3649
with:
3750
username: ${{ secrets.DOCKER_HUB_UID }}
3851
password: ${{ secrets.DOCKER_HUB_PAT }}
3952

40-
- name: Build image
41-
run: |
53+
- name: Build standard image
54+
run: |
55+
TAGS="--tag ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}"
56+
57+
if [ "${USE_DOCKER_HUB}" = "true" ]; then
58+
TAGS="$TAGS --tag ${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}"
59+
fi
60+
4261
docker buildx build \
43-
--platform linux/amd64,linux/arm64 \
44-
--tag ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} \
45-
--tag ${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }} \
62+
--platform ${{ matrix.platform }} \
63+
$TAGS \
4664
--file ./Dockerfile \
47-
--output type=image,push=true .
65+
--output type=image,push=true \
66+
.
67+
68+
- name: Build distroless image
69+
run: |
70+
TAGS="--tag ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}"
71+
72+
if [ "${USE_DOCKER_HUB}" = "true" ]; then
73+
TAGS="$TAGS --tag ${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}"
74+
fi
75+
76+
docker buildx build \
77+
--platform ${{ matrix.platform }} \
78+
$TAGS \
79+
--file ./Dockerfile.dless \
80+
--output type=image,push=true \
81+
.
82+
83+
- name: Install Cosign
84+
uses: sigstore/cosign-installer@v3.8.1
85+
86+
- name: Sign ghcr images
87+
shell: bash
88+
env:
89+
COSIGN_EXPERIMENTAL: 1
90+
run: |
91+
cosign sign --yes "ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}"
92+
cosign sign --yes "ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}-dless"
93+
94+
- name: Sign docker hub images
95+
if: ${{ env.USE_DOCKER_HUB == 'true' }}
96+
shell: bash
97+
env:
98+
COSIGN_EXPERIMENTAL: 1
99+
run: |
100+
cosign sign --yes "${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}"
101+
cosign sign --yes "${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}-dless"
102+
103+
- name: Verify ghcr image signatures
104+
shell: bash
105+
env:
106+
COSIGN_EXPERIMENTAL: 1
107+
run: |
108+
cosign verify \
109+
--certificate-identity=https://github.com/${{ github.repository }}/.github/workflows/build-container.yml@${{ github.ref }} \
110+
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
111+
"ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}"
112+
113+
cosign verify \
114+
--certificate-identity=https://github.com/${{ github.repository }}/.github/workflows/build-container.yml@${{ github.ref }} \
115+
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
116+
"ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}-dless"
117+
118+
- name: Verify docker hub image signatures
119+
if: ${{ env.USE_DOCKER_HUB == 'true' }}
120+
shell: bash
121+
env:
122+
COSIGN_EXPERIMENTAL: 1
123+
run: |
124+
cosign verify \
125+
--certificate-identity=https://github.com/${{ github.repository }}/.github/workflows/build-container.yml@${{ github.ref }} \
126+
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
127+
"${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}"
128+
129+
cosign verify \
130+
--certificate-identity=https://github.com/${{ github.repository }}/.github/workflows/build-container.yml@${{ github.ref }} \
131+
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
132+
"${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}-dless"

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.21 AS build
1+
FROM golang:1.22 AS build
22

33
RUN apt-get update -y && \
44
apt-get install -y rsync
@@ -14,7 +14,7 @@ WORKDIR /app/avalanchego/
1414

1515
RUN /app/avalanchego/scripts/build.sh
1616

17-
FROM ubuntu:24.10
17+
FROM ubuntu:24.04
1818

1919
WORKDIR /app
2020

@@ -32,9 +32,10 @@ ENV HTTP_HOST=0.0.0.0 \
3232
NETWORK_ID=costwo \
3333
AUTOCONFIGURE_PUBLIC_IP=1 \
3434
AUTOCONFIGURE_BOOTSTRAP=1 \
35-
AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=https://coston2.flare.network/ext/info \
35+
AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=https://coston2-bootstrap.flare.network/ext/info \
3636
EXTRA_ARGUMENTS="" \
37-
BOOTSTRAP_BEACON_CONNECTION_TIMEOUT="1m"
37+
BOOTSTRAP_BEACON_CONNECTION_TIMEOUT="1m" \
38+
HTTP_ALLOWED_HOSTS="*"
3839

3940
RUN apt-get update -y && \
4041
apt-get install -y curl jq
@@ -54,4 +55,4 @@ VOLUME [ "${CHAIN_CONFIG_DIR}" ]
5455
HEALTHCHECK CMD curl --fail http://localhost:${HTTP_PORT}/ext/health || exit 1
5556

5657
ENTRYPOINT [ "/usr/bin/bash" ]
57-
CMD [ "/app/entrypoint.sh" ]
58+
CMD [ "/app/entrypoint.sh" ]

Dockerfile.dless

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
FROM golang:1.22 AS build
2+
3+
RUN apt-get update -y && \
4+
apt-get install -y rsync
5+
6+
WORKDIR /app/
7+
8+
COPY ./.git /app/.git
9+
COPY ./avalanchego /app/avalanchego
10+
COPY ./config /app/config
11+
COPY ./coreth /app/coreth
12+
13+
WORKDIR /app/avalanchego/
14+
15+
RUN /app/avalanchego/scripts/build.sh
16+
17+
RUN mkdir -p /app/conf/coston /app/conf/C /app/logs /app/db
18+
19+
WORKDIR /entrypoint
20+
COPY entrypoint/main.go .
21+
RUN go build -ldflags="-s -w" -o /out/entrypoint main.go
22+
23+
FROM gcr.io/distroless/base:nonroot AS final
24+
25+
USER nonroot
26+
27+
WORKDIR /app
28+
29+
ENV HTTP_HOST=0.0.0.0 \
30+
HTTP_PORT=9650 \
31+
STAKING_PORT=9651 \
32+
PUBLIC_IP= \
33+
DB_DIR=/app/db \
34+
DB_TYPE=leveldb \
35+
BOOTSTRAP_IPS= \
36+
BOOTSTRAP_IDS= \
37+
CHAIN_CONFIG_DIR=/app/conf \
38+
LOG_DIR=/app/logs \
39+
LOG_LEVEL=info \
40+
NETWORK_ID=costwo \
41+
AUTOCONFIGURE_PUBLIC_IP=1 \
42+
AUTOCONFIGURE_BOOTSTRAP=1 \
43+
AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=https://coston2-bootstrap.flare.network/ext/info \
44+
EXTRA_ARGUMENTS="" \
45+
BOOTSTRAP_BEACON_CONNECTION_TIMEOUT="1m" \
46+
HTTP_ALLOWED_HOSTS="*"
47+
48+
COPY --from=build --chown=nonroot:nonroot /app/conf /app/conf
49+
COPY --from=build --chown=nonroot:nonroot /app/logs /app/logs
50+
COPY --from=build --chown=nonroot:nonroot /app/db /app/db
51+
52+
COPY --from=build --chown=nonroot:nonroot /app/avalanchego/build /app/build
53+
COPY --from=build --chown=nonroot:nonroot /out/entrypoint /app/entrypoint
54+
55+
EXPOSE ${STAKING_PORT}
56+
EXPOSE ${HTTP_PORT}
57+
58+
VOLUME [ "${DB_DIR}" ]
59+
VOLUME [ "${LOG_DIR}" ]
60+
VOLUME [ "${CHAIN_CONFIG_DIR}" ]
61+
62+
ENTRYPOINT [ "/app/entrypoint" ]

README-docker.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# Flare & Coston2
1+
# go-flare
22

3-
Docker image for the Flare & Coston2 node implementation found on [github](https://github.com/flare-foundation/go-flare).
3+
Docker images for the go-flare node implementation found at [github](https://github.com/flare-foundation/go-flare).
4+
5+
## Variants
6+
Images with `-dless` postfix are build using distroless base and are rootless.
7+
Process runs under user `nonroot` with UID `65532`. You should chown your volume mounts to match this UID using `chown -R 65532:65532 /mnt/my/db`.
48

59
## Quickstart
610

711
```sh
812
docker run -d \
913
-p 9650-9651:9650-9651 \
10-
flarefoundation/flare:latest
14+
flarefoundation/go-flare:<version>
1115
```
1216

1317
<b>Currently the default network is `costwo` but you can change that by providing a `NETWORK_ID` environment variable (i.e. `NETWORK_ID=flare`).</b>
@@ -53,9 +57,10 @@ These are the environment variables you can edit and their default values:
5357
| `NETWORK_ID` | `costwo` | The network id. The common ids are `flare \| costwo` |
5458
| `AUTOCONFIGURE_PUBLIC_IP` | `0` | Set to `1` to autoconfigure `PUBLIC_IP`, skipped if PUBLIC_IP is set |
5559
| `AUTOCONFIGURE_BOOTSTRAP` | `0` | Set to `1` to autoconfigure `BOOTSTRAP_IPS` and `BOOTSTRAP_IDS` |
56-
| `AUTOCONFIGURE_BOOTSTRAP_ENDPOINT` | `https://coston2.flare.network/ext/info` | Endpoint used for [bootstrapping](https://docs.avax.network/nodes/maintain/avalanchego-config-flags#bootstrapping) when `AUTOCONFIGURE_BOOTSTRAP` is enabled. Possible values are `https://coston2.flare.network/ext/info` or `https://flare.flare.network/ext/info`. |
60+
| `AUTOCONFIGURE_BOOTSTRAP_ENDPOINT` | `https://coston2-bootstrap.flare.network/ext/info` | Endpoint used for [bootstrapping](https://docs.avax.network/nodes/maintain/avalanchego-config-flags#bootstrapping) when `AUTOCONFIGURE_BOOTSTRAP` is enabled. Possible values are `https://coston2-bootstrap.flare.network/ext/info`, `https://flare-bootstrap.flare.network/ext/info`, `https://coston-bootstrap.flare.network/ext/info` or `https://songbird-bootstrap.flare.network/ext/info`. |
5761
| `AUTOCONFIGURE_FALLBACK_ENDPOINTS` | _(empty)_ | Comma-divided fallback bootstrap endpoints, used if `AUTOCONFIGURE_BOOTSTRAP_ENDPOINT` is not valid (not whitelisted / unreachable / etc), tested from first-to-last until one is valid |
5862
| `BOOTSTRAP_BEACON_CONNECTION_TIMEOUT` | `1m` | Set the duration value (eg. `45s` / `5m` / `1h`) for [--bootstrap-beacon-connection-timeout](https://docs.avax.network/nodes/maintain/avalanchego-config-flags#--bootstrap-beacon-connection-timeout-duration) AvalancheGo flag. |
63+
| `HTTP_ALLOWED_HOSTS` | `*` | Blocks RPC calls unless they originate from these hostnames. |
5964
| `EXTRA_ARGUMENTS` | | Extra arguments passed to flare binary |
6065

6166

@@ -73,13 +78,13 @@ The external API configuration is set to only respond to API calls so it offload
7378
"coreth-admin-api-enabled": false,
7479
"coreth-admin-api-dir": "",
7580
"eth-apis": [
76-
"public-eth",
77-
"public-eth-filter",
81+
"eth",
82+
"eth-filter",
7883
"net",
7984
"web3",
80-
"internal-public-eth",
81-
"internal-public-blockchain",
82-
"internal-public-transaction-pool"
85+
"internal-eth",
86+
"internal-blockchain",
87+
"internal-transaction"
8388
],
8489
}
8590
```
@@ -94,22 +99,20 @@ Similarly to the external API configuration, this one also responds to API calls
9499
"coreth-admin-api-enabled": false,
95100
"coreth-admin-api-dir": "",
96101
"eth-apis": [
97-
"public-eth",
98-
"public-eth-filter",
99-
"private-admin",
100-
"public-debug",
101-
"private-debug",
102+
"eth",
103+
"eth-filter",
104+
"admin",
105+
"debug",
102106
"net",
103107
"debug-tracer",
104108
"web3",
105-
"internal-public-eth",
106-
"internal-public-blockchain",
107-
"internal-public-transaction-pool",
108-
"internal-public-tx-pool",
109-
"internal-public-debug",
110-
"internal-private-debug",
111-
"internal-public-account",
112-
"internal-private-personal"
109+
"internal-eth",
110+
"internal-blockchain",
111+
"internal-transaction",
112+
"internal-tx-pool",
113+
"internal-debug",
114+
"internal-account",
115+
"internal-personal"
113116
],
114117
}
115118
```

0 commit comments

Comments
 (0)