Skip to content

Commit fa2947e

Browse files
author
tazhate
committed
chainplane v0.2.0 — Kubernetes operator for blockchain full nodes
A Kubernetes operator for deploying and managing blockchain full nodes across 102 supported chains, with chain-specific health monitoring, MinIO snapshot bootstrapping and an admission webhook enforcing minimum resource requirements. API: chains.chainplane.io/v1alpha2 (kind: ChainInstance, ChainVersionCatalog). Licensed under the Apache License 2.0.
0 parents  commit fa2947e

359 files changed

Lines changed: 56009 additions & 0 deletions

File tree

Some content is hidden

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

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Kubebuilder DevContainer",
3+
"image": "docker.io/golang:1.23",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
6+
"ghcr.io/devcontainers/features/git:1": {}
7+
},
8+
9+
"runArgs": ["--network=host"],
10+
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"terminal.integrated.shell.linux": "/bin/bash"
15+
},
16+
"extensions": [
17+
"ms-kubernetes-tools.vscode-kubernetes-tools",
18+
"ms-azuretools.vscode-docker"
19+
]
20+
}
21+
},
22+
23+
"onCreateCommand": "bash .devcontainer/post-install.sh"
24+
}
25+

.devcontainer/post-install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -x
3+
4+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
5+
chmod +x ./kind
6+
mv ./kind /usr/local/bin/kind
7+
8+
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/linux/amd64
9+
chmod +x kubebuilder
10+
mv kubebuilder /usr/local/bin/
11+
12+
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
13+
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
14+
chmod +x kubectl
15+
mv kubectl /usr/local/bin/kubectl
16+
17+
docker network create -d=bridge --subnet=172.19.0.0/24 kind
18+
19+
kind version
20+
kubebuilder version
21+
docker --version
22+
go version
23+
kubectl version --client

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore build and test binaries.
3+
bin/

.github/workflows/helm.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Helm
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
helm:
9+
name: Run on Ubuntu
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone the code
13+
uses: actions/checkout@v4
14+
15+
- name: Install Helm
16+
uses: azure/setup-helm@v4
17+
18+
- name: Run helm lint
19+
run: helm lint charts/chainplane
20+
21+
- name: Run helm template
22+
run: helm template chainplane charts/chainplane

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
lint:
9+
name: Run on Ubuntu
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone the code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
20+
- name: Run linter
21+
uses: golangci/golangci-lint-action@v7
22+
with:
23+
version: v2.11.4

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
name: Build and Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: "1.25"
26+
27+
- name: Sanity check
28+
run: go build ./... && go vet ./...
29+
30+
- name: Login to GitHub Container Registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v3
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Build and push multi-arch image
44+
uses: docker/build-push-action@v5
45+
with:
46+
context: .
47+
platforms: linux/amd64,linux/arm64
48+
push: true
49+
tags: |
50+
ghcr.io/tazhate/chainplane:${{ github.ref_name }}
51+
ghcr.io/tazhate/chainplane:latest
52+
53+
- name: Package and push Helm chart to GHCR
54+
run: |
55+
VERSION=${GITHUB_REF_NAME#v}
56+
helm package charts/chainplane --version ${VERSION}
57+
helm push chainplane-${VERSION}.tgz oci://ghcr.io/tazhate/charts
58+
59+
- name: Create GitHub Release
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
generate_release_notes: true
63+
files: chainplane-*.tgz

.github/workflows/test-e2e.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test-e2e:
9+
name: Run on Ubuntu
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone the code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
20+
- name: Install the latest version of kind
21+
run: |
22+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
23+
chmod +x ./kind
24+
sudo mv ./kind /usr/local/bin/kind
25+
26+
- name: Verify kind installation
27+
run: kind version
28+
29+
- name: Create kind cluster
30+
run: kind create cluster
31+
32+
- name: Running Test e2e
33+
run: |
34+
go mod tidy
35+
make test-e2e

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
name: Run on Ubuntu
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone the code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
20+
- name: Install setup-envtest
21+
run: go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
22+
23+
- name: Running Tests
24+
run: |
25+
go mod tidy
26+
K8S_VERSION=$(go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $3}')
27+
KUBEBUILDER_ASSETS="$($(go env GOPATH)/bin/setup-envtest use ${K8S_VERSION} --bin-dir $(pwd)/bin/k8s -p path)"
28+
export KUBEBUILDER_ASSETS
29+
go test $(go list ./... | grep -v /e2e) -coverprofile cover.out
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Update node image versions
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * 1' # каждый понедельник 08:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-versions:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version-file: go.mod
21+
cache: true
22+
23+
- name: Check for version updates
24+
run: go run ./cmd/versioncheck --update
25+
env:
26+
# Optional: set to avoid Docker Hub anonymous rate limits (600 req/h)
27+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Verify build after update
30+
run: go build ./...
31+
32+
- name: Run linter
33+
uses: golangci/golangci-lint-action@v7
34+
with:
35+
version: v2.11.4
36+
37+
- name: Run tests
38+
run: go test ./internal/adapters/... ./internal/registry/... ./api/...
39+
40+
- name: Create PR
41+
id: cpr
42+
uses: peter-evans/create-pull-request@v7
43+
with:
44+
token: ${{ secrets.GH_PAT }}
45+
commit-message: |
46+
chore: update blockchain node default images
47+
48+
Ran cmd/versioncheck against upstream registries.
49+
Updated internal/adapters/versions_gen.go.
50+
title: 'chore: update node images'
51+
body: |
52+
## Automated image version update
53+
54+
`cmd/versioncheck` found newer stable tags in upstream registries and updated
55+
`internal/adapters/versions_gen.go`.
56+
57+
Pre-releases (alpha/beta/rc), nightly and floating tags (latest, canary)
58+
are automatically skipped.
59+
60+
Build, lint and tests passed. Safe to auto-merge.
61+
branch: chore/update-node-images
62+
delete-branch: true
63+
labels: dependencies
64+
65+
- name: Enable auto-merge
66+
if: steps.cpr.outputs.pull-request-number
67+
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"
68+
env:
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
bin/*
8+
Dockerfile.cross
9+
10+
# Test binary, built with `go test -c`
11+
*.test
12+
13+
# Output of the go coverage tool, specifically when used with LiteIDE
14+
*.out
15+
16+
# Go workspace file
17+
go.work
18+
19+
# Kubernetes Generated files - skip generated files, except for vendored files
20+
!vendor/**/zz_generated.*
21+
22+
# editor and IDE paraphernalia
23+
.idea
24+
.vscode
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# Claude Code
30+
.claude/
31+
.beads/
32+
33+
# Build artifacts
34+
/bin/
35+
cover.out
36+
37+
# Distribution artifacts
38+
/dist/
39+
40+
# Test binaries
41+
testbin/
42+
43+
# Compiled binaries (use bin/ for build artifacts)
44+
versioncheck
45+
46+
# Logo lives in assets/, not in repo root
47+
/logo.png

0 commit comments

Comments
 (0)