Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
vcastellm committed Jan 25, 2024
1 parent 5d3ec2d commit b3b559a
Show file tree
Hide file tree
Showing 21 changed files with 100 additions and 100 deletions.
4 changes: 2 additions & 2 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ filename: "{{.InterfaceName | lower }}.generated.go"
mockname: "{{.InterfaceName}}"
outpkg: "mocks"
packages:
github.com/0xPolygon/beethoven/etherman:
github.com/0xPolygon/agglayer/etherman:
config:
interfaces:
IEthereumClient:
config:
mockname: EthereumClientMock
filename: etherman_client.generated.go
github.com/0xPolygon/beethoven/types:
github.com/0xPolygon/agglayer/types:
config:
interfaces:
IDB:
Expand Down
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,41 +54,41 @@ GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/dist
GOOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOENVVARS := GOBIN=$(GOBIN) CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(ARCH)
GOBINARY := beethoven
GOBINARY := agglayer
GOCMD := $(GOBASE)/cmd

LDFLAGS += -X 'github.com/0xPolygon/beethoven.Version=$(VERSION)'
LDFLAGS += -X 'github.com/0xPolygon/beethoven.GitRev=$(GITREV)'
LDFLAGS += -X 'github.com/0xPolygon/beethoven.GitBranch=$(GITBRANCH)'
LDFLAGS += -X 'github.com/0xPolygon/beethoven.BuildDate=$(DATE)'
LDFLAGS += -X 'github.com/0xPolygon/agglayer.Version=$(VERSION)'
LDFLAGS += -X 'github.com/0xPolygon/agglayer.GitRev=$(GITREV)'
LDFLAGS += -X 'github.com/0xPolygon/agglayer.GitBranch=$(GITBRANCH)'
LDFLAGS += -X 'github.com/0xPolygon/agglayer.BuildDate=$(DATE)'

.PHONY: build
build: ## Builds the binary locally into ./dist
$(GOENVVARS) go build -ldflags "all=$(LDFLAGS)" -o $(GOBIN)/$(GOBINARY) $(GOCMD)

.PHONY: build-docker
build-docker: ## Builds a docker image with the beethoven binary
docker compose -f ./docker/docker-compose.yaml build beethoven
build-docker: ## Builds a docker image with the agglayer binary
docker compose -f ./docker/docker-compose.yaml build agglayer

.PHONY: build-docker-nc
build-docker-nc: ## Builds a docker image with the beethoven binary - but without build cache
docker compose -f ./docker/docker-compose.yaml build --no-cache beethoven
build-docker-nc: ## Builds a docker image with the agglayer binary - but without build cache
docker compose -f ./docker/docker-compose.yaml build --no-cache agglayer

.PHONY: run-docker
run-docker: ## Builds and runs beethoven with the default list of required services such as l1 and zkevm node
run-docker: ## Builds and runs agglayer with the default list of required services such as l1 and zkevm node
docker compose -f ./docker/docker-compose.yaml up -d l1 zkevm-prover zkevm-node
docker compose -f ./docker/docker-compose.yaml up -d --build beethoven
docker compose -f ./docker/docker-compose.yaml up -d --build agglayer

.PHONY: run-docker-bo
run-docker-bo: ## Builds and runs beethoven only
docker compose -f ./docker/docker-compose.yaml up -d --build beethoven
run-docker-bo: ## Builds and runs agglayer only
docker compose -f ./docker/docker-compose.yaml up -d --build agglayer

.PHONY: stop-docker
stop-docker: ## Stops beethoven container and other side services without removing state
stop-docker: ## Stops agglayer container and other side services without removing state
docker compose -f ./docker/docker-compose.yaml stop

.PHONY: destroy-docker
destroy-docker: ## Stops and removes beethoven container and other side services
destroy-docker: ## Stops and removes agglayer container and other side services
docker compose -f ./docker/docker-compose.yaml down

.PHONY: install-linter
Expand All @@ -112,7 +112,7 @@ help: ## Prints the help

.PHONY: e2e-tests
e2e-tests: ## Runs E2E tests
go test -v -timeout=30m github.com/0xPolygon/beethoven/test
go test -v -timeout=30m github.com/0xPolygon/agglayer/test

.PHONY: unit-tests
unit-tests: ## Runs unit tests
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Beethoven
# agglayer

Beethoven is a web service that receives ZKPs from different CDK chains and checks the soundness of them before sending the ZKP to L1 for verification.
agglayer is a web service that receives ZKPs from different CDK chains and checks the soundness of them before sending the ZKP to L1 for verification.

To find out more about Polygon, visit the [official website](https://wiki.polygon.technology/docs/cdk/).

Expand All @@ -25,13 +25,13 @@ make run-docker

## Production setup

Currently only one instance of Beethoven can be running at the same time, so it should be automatically started in the case of failure using a containerized setup or an OS level service manager/monitoring system.
Currently only one instance of agglayer can be running at the same time, so it should be automatically started in the case of failure using a containerized setup or an OS level service manager/monitoring system.

### Installation

1. Clone the repo
```sh
git clone https://github.com/0xPolygon/beethoven.git
git clone https://github.com/0xPolygon/agglayer.git
```
3. Install Golang dependencies
```sh
Expand All @@ -43,7 +43,7 @@ Currently only one instance of Beethoven can be running at the same time, so it
* For each CDK chain it's necessary to configure it's corresponding RPC node, synced with the target CDK, this node is for checking the state root after executions of L2 batches.
* It's recommended to have a durable HA PostgresDB for storage, prefer AWS Aurora Postgres or Cloud SQL for postgres in GCP.
### Configuration of `beethoven.toml`
### Configuration of `agglayer.toml`
* Configure `[FullNodeRPCs]` to point to the corresponding L2 full node.
* Configure `[L1]` to point to the corresponding L1 chain.
* Configure the `[DB]` section with the managed database details.
Expand Down
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
"time"

"github.com/0xPolygon/beethoven/rpc/types"
"github.com/0xPolygon/beethoven/tx"
"github.com/0xPolygon/agglayer/rpc/types"
"github.com/0xPolygon/agglayer/tx"
"github.com/0xPolygonHermez/zkevm-node/ethtxmanager"
"github.com/0xPolygonHermez/zkevm-node/jsonrpc/client"
"github.com/ethereum/go-ethereum/common"
Expand Down
18 changes: 9 additions & 9 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import (
"go.opentelemetry.io/otel/exporters/prometheus"
"go.opentelemetry.io/otel/sdk/metric"

beethoven "github.com/0xPolygon/beethoven"
"github.com/0xPolygon/beethoven/config"
"github.com/0xPolygon/beethoven/db"
"github.com/0xPolygon/beethoven/etherman"
"github.com/0xPolygon/beethoven/interop"
"github.com/0xPolygon/beethoven/network"
"github.com/0xPolygon/beethoven/rpc"
agglayer "github.com/0xPolygon/agglayer"
"github.com/0xPolygon/agglayer/config"
"github.com/0xPolygon/agglayer/db"
"github.com/0xPolygon/agglayer/etherman"
"github.com/0xPolygon/agglayer/interop"
"github.com/0xPolygon/agglayer/network"
"github.com/0xPolygon/agglayer/rpc"
)

const appName = "cdk-beethoven"
const appName = "cdk-agglayer"

var (
configFileFlag = cli.StringFlag{
Expand All @@ -45,7 +45,7 @@ var (
func main() {
app := cli.NewApp()
app.Name = appName
app.Version = beethoven.Version
app.Version = agglayer.Version
app.Commands = []*cli.Command{
{
Name: "run",
Expand Down
8 changes: 4 additions & 4 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Level = "debug"
Outputs = ["stderr"]
[DB]
User = "beethoven_user"
Password = "beethoven_password"
Name = "beethoven_db"
Host = "beethoven-db"
User = "agglayer_user"
Password = "agglayer_password"
Name = "agglayer_db"
Host = "agglayer-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand Down
10 changes: 5 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CONTAINER FOR BUILDING BINARY
FROM golang:1.21 AS build

WORKDIR /go/src/github.com/0xPolygon/beethoven
WORKDIR /go/src/github.com/0xPolygon/agglayer

# Install tools
RUN go install github.com/gobuffalo/packr/v2/[email protected]
Expand All @@ -13,17 +13,17 @@ RUN go mod download
# Build binary
COPY . .

WORKDIR /go/src/github.com/0xPolygon/beethoven/db
WORKDIR /go/src/github.com/0xPolygon/agglayer/db
RUN packr2

WORKDIR /go/src/github.com/0xPolygon/beethoven
WORKDIR /go/src/github.com/0xPolygon/agglayer
RUN make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0

COPY --from=build /go/src/github.com/0xPolygon/beethoven/dist/beethoven /app/beethoven
COPY --from=build /go/src/github.com/0xPolygon/agglayer/dist/agglayer /app/agglayer

EXPOSE 8444

ENTRYPOINT ["/app/beethoven"]
ENTRYPOINT ["/app/agglayer"]
46 changes: 23 additions & 23 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
- '8545:8545'
- '8546:8546'
networks:
- beethoven-localnet
- agglayer-localnet

zkevm-state-db:
image: postgres:16.0-alpine
Expand All @@ -43,7 +43,7 @@ services:
volumes:
- ./data/zkevm/init_prover_db.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- beethoven-localnet
- agglayer-localnet

zkevm-pool-db:
image: postgres:16.0-alpine
Expand All @@ -61,7 +61,7 @@ services:
retries: 5
start_period: 10s
networks:
- beethoven-localnet
- agglayer-localnet

zkevm-prover:
image: hermeznetwork/zkevm-prover:v3.0.2
Expand All @@ -79,10 +79,10 @@ services:
volumes:
- ./data/zkevm/prover.json:/usr/src/app/config.json
networks:
- beethoven-localnet
- agglayer-localnet

zkevm-node:
image: hermeznetwork/cdk-validium-node:beethoven-v0.0.1
image: hermeznetwork/cdk-validium-node:agglayer-v0.0.1
command:
- "/bin/sh"
- "-c"
Expand All @@ -105,51 +105,51 @@ services:
- ./data/zkevm/node.toml:/app/config.toml
- ./data/zkevm/genesis.json:/app/genesis.json
networks:
- beethoven-localnet
- agglayer-localnet

beethoven-db:
agglayer-db:
image: postgres:16.0-alpine
ports:
- '5434:5432'
environment:
POSTGRES_USER: beethoven_user
POSTGRES_PASSWORD: beethoven_password
POSTGRES_DB: beethoven_db
POSTGRES_USER: agglayer_user
POSTGRES_PASSWORD: agglayer_password
POSTGRES_DB: agglayer_db
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "beethoven_db" ]
test: [ "CMD-SHELL", "pg_isready", "-d", "agglayer_db" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
networks:
- beethoven-localnet
- agglayer-localnet
restart: always

# beethoven requires L1 working and available. The config file "./data/beethoven/beethoven.toml"
# has "l1" (see above) service defined as L1 so make sure "l1" service is started before running beethoven.
# agglayer requires L1 working and available. The config file "./data/agglayer/agglayer.toml"
# has "l1" (see above) service defined as L1 so make sure "l1" service is started before running agglayer.
# Same point with "zkevm-node" service.
# In order to run "beethoven" attached to an external L1 and zkevm node, the config file should be
# In order to run "agglayer" attached to an external L1 and zkevm node, the config file should be
# updated accordingly.
beethoven:
image: beethoven:local
agglayer:
image: agglayer:local
build:
context: ../
dockerfile: ./docker/Dockerfile
command: [ 'run', '--cfg', '/config/beethoven.toml' ]
command: [ 'run', '--cfg', '/config/agglayer.toml' ]
depends_on:
beethoven-db:
agglayer-db:
condition: service_healthy
ports:
- '8444:8444'
- '2223:2223'
volumes:
- ./data/beethoven/beethoven.keystore:/pk/beethoven.keystore
- ./data/beethoven/beethoven.toml:/config/beethoven.toml
- ./data/agglayer/agglayer.keystore:/pk/agglayer.keystore
- ./data/agglayer/agglayer.toml:/config/agglayer.toml
networks:
- beethoven-localnet
- agglayer-localnet
restart: always

networks:
beethoven-localnet:
agglayer-localnet:
driver: bridge

4 changes: 2 additions & 2 deletions etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"math/big"
"time"

"github.com/0xPolygon/beethoven/config"
"github.com/0xPolygon/agglayer/config"

"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonrollupmanager"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonzkevm"
Expand All @@ -20,7 +20,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/jackc/pgx/v4"

"github.com/0xPolygon/beethoven/tx"
"github.com/0xPolygon/agglayer/tx"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions etherman/etherman_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"math/big"
"testing"

"github.com/0xPolygon/beethoven/config"
cdkTypes "github.com/0xPolygon/beethoven/rpc/types"
"github.com/0xPolygon/beethoven/tx"
"github.com/0xPolygon/agglayer/config"
cdkTypes "github.com/0xPolygon/agglayer/rpc/types"
"github.com/0xPolygon/agglayer/tx"
"github.com/ethereum/go-ethereum/crypto"

"github.com/0xPolygon/beethoven/mocks"
"github.com/0xPolygon/agglayer/mocks"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/0xPolygon/beethoven
module github.com/0xPolygon/agglayer

go 1.21

Expand Down
6 changes: 3 additions & 3 deletions interop/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"fmt"
"math/big"

"github.com/0xPolygon/beethoven/config"
"github.com/0xPolygon/beethoven/tx"
"github.com/0xPolygon/beethoven/types"
"github.com/0xPolygon/agglayer/config"
"github.com/0xPolygon/agglayer/tx"
"github.com/0xPolygon/agglayer/types"

jRPC "github.com/0xPolygon/cdk-data-availability/rpc"
"github.com/0xPolygonHermez/zkevm-node/jsonrpc/client"
Expand Down
6 changes: 3 additions & 3 deletions interop/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"github.com/0xPolygon/beethoven/config"
"github.com/0xPolygon/beethoven/mocks"
"github.com/0xPolygon/beethoven/tx"
"github.com/0xPolygon/agglayer/config"
"github.com/0xPolygon/agglayer/mocks"
"github.com/0xPolygon/agglayer/tx"
)

func TestNewExecutor(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion mocks/etherman.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3b559a

Please sign in to comment.