Skip to content

Commit ba2c712

Browse files
committed
v2 dir
1 parent 7929621 commit ba2c712

File tree

123 files changed

+11914
-1
lines changed

Some content is hidden

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

123 files changed

+11914
-1
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Aggregator CI
2+
3+
on:
4+
push:
5+
paths:
6+
- 'v2/aggregator/**'
7+
pull_request:
8+
paths:
9+
- 'v2/aggregator/**'
10+
11+
defaults:
12+
run:
13+
working-directory: v2/aggregator
14+
15+
jobs:
16+
lint-and-test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
26+
with:
27+
go-version-file: v2/aggregator/go.mod
28+
29+
- name: Install just
30+
uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d # v2.0.0
31+
32+
- name: Install protoc
33+
run: |
34+
PROTOC_VERSION="32.0"
35+
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip"
36+
sudo unzip -o protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local bin/protoc
37+
sudo unzip -o protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local 'include/*'
38+
rm protoc-${PROTOC_VERSION}-linux-x86_64.zip
39+
protoc --version
40+
41+
- name: Install protoc-gen-go
42+
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
43+
44+
- name: Install protoc-gen-go-grpc
45+
run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
46+
47+
- name: Install buf
48+
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Install golangci-lint
53+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
54+
with:
55+
version: latest
56+
working-directory: v2/aggregator
57+
args: --help # Just install, don't run yet
58+
59+
- name: Run lint
60+
run: just lint
61+
62+
- name: Run proto-check
63+
run: just proto-check
64+
65+
- name: Run tests
66+
run: just test
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Devenv Tidy
2+
on:
3+
push:
4+
5+
defaults:
6+
run:
7+
working-directory: v2/build/devenv
8+
9+
jobs:
10+
devenv-tidy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Go with module caching
18+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
19+
with:
20+
go-version-file: v2/build/devenv/go.mod
21+
- name: Verify go.mod and go.sum
22+
run: |
23+
go mod tidy
24+
if ! git diff --exit-code -- go.mod go.sum; then
25+
echo "❌ go.mod or go.sum has uncommitted changes after go mod tidy"
26+
echo "Please run: go mod tidy"
27+
git diff -- go.mod go.sum
28+
exit 1
29+
fi
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: End-to-end CCV Test (EVM Testnets)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
defaults:
7+
run:
8+
working-directory: build/devenv
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e:
16+
permissions:
17+
id-token: write
18+
contents: read
19+
runs-on: ubuntu24.04-16cores-64GB
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
27+
- name: Install Just
28+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
29+
with:
30+
just-version: '1.40.0'
31+
- name: Build Docker images with Just
32+
run: just build-docker-dev-ci
33+
env:
34+
DOCKER_BUILDKIT: 1
35+
- name: List built images
36+
run: docker images
37+
- name: Set up Go with module caching
38+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
39+
with:
40+
go-version-file: build/devenv/go.mod
41+
cache: true
42+
- name: Cache Go modules
43+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
44+
with:
45+
path: |
46+
~/.cache/go-build
47+
~/go/pkg/mod
48+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
49+
restore-keys: |
50+
${{ runner.os }}-go-
51+
- name: Download Go dependencies
52+
run: |
53+
go mod download
54+
- name: Run CCV environment
55+
env:
56+
ETH_FUJI_PRIVATE_KEY: ${{ secrets.ETH_FUJI_PRIVATE_KEY }}
57+
run: |
58+
case "${{ inputs.network }}" in
59+
eth_fuji)
60+
PRIVATE_KEY=$ETH_FUJI_PRIVATE_KEY
61+
;;
62+
*)
63+
echo "Unknown network: ${{ inputs.network }}"
64+
exit 1
65+
;;
66+
esac
67+
cd cmd/ccv && go install . && cd -
68+
PRIVATE_KEY=${PRIVATE_KEY} ccv env.toml,env-fuji-fantom.toml
69+
- name: Run Soak Test
70+
working-directory: build/devenv/tests/e2e
71+
run: go test -timeout 2h -v -run TestSoak

.github/workflows/v2-e2e.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: End-to-end CCV Test
2+
3+
on:
4+
push:
5+
6+
defaults:
7+
run:
8+
working-directory: v2/build/devenv
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e:
16+
permissions:
17+
id-token: write
18+
contents: read
19+
runs-on: ubuntu24.04-16cores-64GB
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
27+
- name: Install Just
28+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
29+
with:
30+
just-version: '1.40.0'
31+
- name: Configure AWS credentials using OIDC
32+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
33+
with:
34+
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
35+
aws-region: us-east-1
36+
- name: Authenticate to ECR Public
37+
id: login-ecr-public
38+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
39+
with:
40+
registry-type: public
41+
- name: Build Docker images with Just
42+
run: just build-docker-dev-ci
43+
env:
44+
DOCKER_BUILDKIT: 1
45+
- name: List built images
46+
run: docker images
47+
- name: Set up Go with module caching
48+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
49+
with:
50+
go-version-file: v2/build/devenv/go.mod
51+
cache: true
52+
- name: Cache Go modules
53+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
54+
with:
55+
path: |
56+
~/.cache/go-build
57+
~/go/pkg/mod
58+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
59+
restore-keys: |
60+
${{ runner.os }}-go-
61+
- name: Download Go dependencies
62+
run: |
63+
go mod download
64+
- name: Run CCV environment
65+
run: |
66+
cd cmd/ccv && go install . && cd -
67+
ccv u env.toml

.github/workflows/v2-services.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Services CCV Tests
2+
3+
on:
4+
push:
5+
6+
defaults:
7+
run:
8+
working-directory: build/devenv
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e:
16+
permissions:
17+
id-token: write
18+
contents: read
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
27+
- name: Install Just
28+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
29+
with:
30+
just-version: '1.40.0'
31+
- name: Configure AWS credentials using OIDC
32+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
33+
with:
34+
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
35+
aws-region: us-east-1
36+
- name: Authenticate to ECR Public
37+
id: login-ecr-public
38+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
39+
with:
40+
registry-type: public
41+
- name: Build Docker images with Just
42+
run: just build-docker-dev-ci
43+
env:
44+
DOCKER_BUILDKIT: 1
45+
- name: List built images
46+
run: docker images
47+
- name: Set up Go with module caching
48+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
49+
with:
50+
go-version-file: build/devenv/go.mod
51+
cache: true
52+
- name: Cache Go modules
53+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
54+
with:
55+
path: |
56+
~/.cache/go-build
57+
~/go/pkg/mod
58+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
59+
restore-keys: |
60+
${{ runner.os }}-go-
61+
- name: Download Go dependencies
62+
run: |
63+
go mod download
64+
- name: Run CCV environment
65+
run: |
66+
go test -v -run TestService ./...

.tool-versions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
nodejs 20.13.1
2-
pnpm 10.6.5
2+
pnpm 10.6.5
3+
golang 1.24.6

v2/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Chainlink CCV
2+
3+
## Getting started
4+
5+
Run all the services in local environment, install [Nix](https://github.com/DeterminateSystems/nix-installer) and run
6+
```bash
7+
nix develop
8+
just clean-docker-dev # needed in case you have old JD image
9+
just build-docker-dev
10+
```
11+
Then enter the `ccv` shell and run `up`
12+
```bash
13+
ccv sh
14+
```

v2/aggregator/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp/

v2/aggregator/.golangci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: "2"
2+
run:
3+
allow-parallel-runners: true
4+
linters:
5+
enable:
6+
- containedctx
7+
- errcheck
8+
- errname
9+
- errorlint
10+
- exhaustive
11+
- fatcontext
12+
- ginkgolinter
13+
- gocritic
14+
- gosec
15+
- loggercheck
16+
- mirror
17+
- misspell
18+
- noctx
19+
- nolintlint
20+
- perfsprint
21+
- revive
22+
- rowserrcheck
23+
- spancheck
24+
- sqlclosecheck
25+
- testifylint
26+
- unconvert
27+
- whitespace
28+
settings:
29+
revive:
30+
rules:
31+
- name: var-naming
32+
disabled: true
33+
formatters:
34+
enable:
35+
- goimports

v2/aggregator/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:1.24.6-alpine AS builder
2+
WORKDIR /app
3+
COPY . .
4+
COPY go.mod go.sum ./
5+
RUN go mod download
6+
RUN CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/aggregator cmd/main.go
7+
8+
FROM alpine:latest
9+
RUN apk --no-cache add ca-certificates
10+
COPY --from=builder /bin/aggregator /bin/
11+
CMD ["/bin/aggregator"]

0 commit comments

Comments
 (0)