-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Layr-Labs/sm-poc
Port indexing from blocklake
- Loading branch information
Showing
98 changed files
with
17,671 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: build-container | ||
|
||
on: push | ||
|
||
jobs: | ||
# test: | ||
# runs-on: ubuntu-24.04 | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
# - name: Set up Go 1.22 | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: 1.22 | ||
# - name: Run tests | ||
# run: make ci-test | ||
build: | ||
# needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build, tag, and push docker image to Amazon ECR | ||
env: | ||
REGISTRY: "767397703211.dkr.ecr.us-east-1.amazonaws.com" | ||
REPOSITORY: ${{ github.event.repository.name }} | ||
IMAGE_TAG: ${{ github.sha }} | ||
PLATFORMS: "linux/amd64" | ||
run: | | ||
if [[ $GITHUB_REF == refs/heads/master ]]; then | ||
docker buildx build --platform $PLATFORMS -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -t $REGISTRY/$REPOSITORY:latest --push . | ||
else | ||
docker buildx build --platform $PLATFORMS -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --push . | ||
fi | ||
build-mainnet: | ||
# needs: test | ||
if: github.ref == 'refs/heads/master' | ||
environment: "mainnet" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build, tag, and push docker image to Amazon ECR | ||
env: | ||
REGISTRY: "471112646628.dkr.ecr.us-east-1.amazonaws.com" | ||
REPOSITORY: ${{ github.event.repository.name }} | ||
IMAGE_TAG: ${{ github.sha }} | ||
PLATFORMS: "linux/amd64" | ||
run: | | ||
if [[ $GITHUB_REF == refs/heads/master ]]; then | ||
docker buildx build --platform $PLATFORMS -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -t $REGISTRY/$REPOSITORY:latest --push . | ||
else | ||
docker buildx build --platform $PLATFORMS -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --push . | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.idea | ||
*.sw* | ||
*.terraform | ||
*.terraform* | ||
scripts/runLocal/runBackfillBlockIndexerWorker.sh | ||
scripts/runBackfillTransactionLogIndexerWorker.sh | ||
block-lake/preprod-values.yaml | ||
/bin | ||
./block-lake/preprod-values.yaml | ||
/scripts/runLocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM golang:1.22-bullseye as build | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y make postgresql-client | ||
|
||
RUN mkdir /build | ||
|
||
COPY . /build | ||
|
||
WORKDIR /build | ||
|
||
RUN make deps-linux | ||
|
||
RUN make build | ||
|
||
# FROM golang:1.22-bullseye as run | ||
# | ||
# RUN apt-get update | ||
# RUN apt-get install -y vim postgresql-client | ||
# | ||
# COPY --from=build /build/bin/cmd /bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
.PHONY: deps proto | ||
|
||
deps/go: | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
go get \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ | ||
google.golang.org/protobuf/cmd/protoc-gen-go \ | ||
google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ | ||
google.golang.org/protobuf/cmd/protoc-gen-go \ | ||
google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
go mod tidy | ||
|
||
deps-linux: deps/go | ||
BIN="/usr/local/bin" VERSION="1.32.2" && \ | ||
curl -sSL "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" -o "${BIN}/buf" && \ | ||
chmod +x "${BIN}/buf" | ||
|
||
deps: deps/go | ||
brew install bufbuild/buf/buf | ||
|
||
PROTO_OPTS=--proto_path=protos --go_out=paths=source_relative:protos | ||
|
||
proto: | ||
buf generate protos | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf bin || true | ||
|
||
.PHONY: build/cmd/sidecar | ||
build/cmd/sidecar: | ||
go build -o bin/cmd/sidecar cmd/sidecar/main.go | ||
|
||
.PHONY: build | ||
build: build/cmd/sidecar | ||
|
||
docker-buildx: | ||
docker-buildx build --platform linux/amd64 --push -t 767397703211.dkr.ecr.us-east-1.amazonaws.com/blocklake:$(shell date +%s) -t 767397703211.dkr.ecr.us-east-1.amazonaws.com/blocklake:latest . | ||
|
||
.PHONY: test | ||
test: | ||
./scripts/runTests.sh | ||
|
||
.PHONY: ci-test | ||
ci-test: deps test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Sample backfill requests | ||
|
||
*Contracts* | ||
|
||
```bash | ||
grpcurl -plaintext -d '{ | ||
"range": {"from": 1477020, "to": 1477020 } | ||
}' localhost:9999 eigenlayer.blocklake.api.v1.Backfiller/IndexContracts | ||
``` |
Oops, something went wrong.