Skip to content

Commit

Permalink
feat: add EigenLayer Onchain Exporter (#3)
Browse files Browse the repository at this point in the history
* feat: Add initial version of code

* chore: Add requirements.txt

* feat: Add Dockerfile

* ci: Add workflow to build and push Docker image

* feat: Serve original requested_at instead of time_difference

* feat: Sort blobs by requested_at

* feat: Stop updating redundant metrics

* fix: Cast FETCH_INTERVAL to int

* feat: Add docker-compose for testing purposes

* feat: implement eigenlayer onchain exporter

* chore: add gh cli to the devcontainer

* refactor: remove python files

* fix: Rename module

* doc: Update root command short description

* fix: Update README.md

Co-authored-by: Miguel Tenorio <[email protected]>

* doc: Add Labels section

* fix: Update README references

* fix: Update command usage

* feat: Update CI/CD workflow

* fix: Prometheus metric labels

* refactor: Log errors instead of stop the exporter

* feat: Add eigenda_exporter_up metric

* refactor: Remove RPC mutex

* feat: Use backoff for RPC calls

* feat: Add docker compose containers' names

* refactor: Configure log level as string

* refactor: Update config path default value

* feat: Update Viper configuration

* refactor: Update exprters shutting down process

* fix: Init the EigenDA exporter up metric at the creation time

* fix: Update docker compose volume

* doc: Update README

* refactor: Update confirmBatchInput TODO comment

* feat: Check RPC ChainID

* fix: Log Prometheus server error

* fix: Typo

* chore: Add checks and linters

* fix: Ethereum Mainnet chain id

* refactor: Update project structure and graceful exit

* test: Init E2E tests

* test: Add test cases

---------

Co-authored-by: AntiD2ta <[email protected]>
Co-authored-by: Miguel Tenorio <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 5242819 commit 5e762ef
Show file tree
Hide file tree
Showing 45 changed files with 5,714 additions and 422 deletions.
25 changes: 25 additions & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Apks
avsexporter
Buildx
cenkalti
CODEOWNERS
codespell
Confirmer
devcontainer
Eigen
eigenda
eigenlayer
ethclient
ethcommon
golangci
Holeksy
holesky
IBLS
markdownlint
Nethermind
promauto
promhttp
Pubkeys
Rpcs
stretchr
twinstake
1 change: 1 addition & 0 deletions .config/markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
line_length: false
38 changes: 14 additions & 24 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,29 @@
"build": {
"dockerfile": "Dockerfile"
},

// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
// "features": {},

"features": {
"ghcr.io/devcontainers/features/go:1": {
"version": "1.23.1"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/gvatsal60/dev-container-features/pre-commit:1": {}
},
// 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// 👇 Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo apt install -y graphviz",

// 👇 Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions":[
"ms-python.python",
"njpwerner.autodocstring",
"ms-python.vscode-pylance",
"amazonwebservices.aws-toolkit-vscode",
"vscode": {
"extensions": [
"golang.go",
"Gruntfuggly.todo-tree",
"streetsidesoftware.code-spell-checker",
"GitHub.copilot",
"ms-python.isort",
"redhat.vscode-yaml",
"hashicorp.terraform",
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint",
"eamodio.gitlens",
"github.vscode-github-actions"
"DavidAnson.vscode-markdownlint"
]
}
},
"features": {
}

}
// 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
20 changes: 20 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: golangci-lint
on:
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
60 changes: 0 additions & 60 deletions .github/workflows/publish-docker.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD pipeline

env:
DOCKER_REGISTRY: nethermind.jfrog.io

REPO_DEV: angkor-oci-local-dev
REPO_STAGING: angkor-oci-local-staging
REPO_PROD: angkor-oci-local-prod
IMAGE_NAME: eigenlayer-onchain-exporter


on:
push:
branches: [main]
workflow_dispatch:

permissions:
id-token: write
contents: write

jobs:
build_docker_image:
runs-on: ubuntu-latest
outputs:
DOCKER_IMAGE_NAME: ${{ env.IMAGE_NAME }}
DOCKER_IMAGE_TAG: ${{ steps.set_tag.outputs.DOCKER_IMAGE_TAG }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Define image tag
id: set_tag
run: |
export DOCKER_IMAGE_TAG=$(git describe --tags)
# This one is to be able to use the image tag in the next steps in this job
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_ENV
# This one is to be able to use the image tag in the next jobs
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to registry
run: |
docker login ${{ env.DOCKER_REGISTRY }} -u ${{ secrets.ARTIFACTORY_ANGKOR_USERNAME }} -p ${{ secrets.ARTIFACTORY_ANGKOR_TOKEN_CONTRIBUTOR }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
platforms: "linux/amd64"
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/${{ env.REPO_DEV }}/${{ env.IMAGE_NAME }}:latest
Loading

0 comments on commit 5e762ef

Please sign in to comment.