diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 970dd7c4..404d0427 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -6,7 +6,7 @@ on: - master pull_request: -jobs: +jobs: Test: name: Integration Test runs-on: ubuntu-latest @@ -14,8 +14,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21' - + go-version: "1.21" + # we use forge right now as part of integration test, so need to install it first - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 @@ -24,6 +24,7 @@ jobs: - name: Install forge dependencies run: forge install working-directory: ./contracts - + - name: Create ENV file + run: cp sample.aggregator.env .env - name: Test - run: make tests-integration \ No newline at end of file + run: make tests-integration diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 28ff49ae..2d256a46 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -6,7 +6,7 @@ on: - master pull_request: -jobs: +jobs: Test: name: Unit Test runs-on: ubuntu-latest @@ -14,6 +14,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: "1.21" + - name: Set up environment variables + run: cp sample.aggregator.env .env - name: Test - run: make tests-unit \ No newline at end of file + run: make tests-unit diff --git a/Makefile b/Makefile index 597fe643..0a3317bb 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +# This imports the environment variables from the .env file +include .env +export $(shell sed 's/=.*//' .env) ############################# HELP MESSAGE ############################# # Make sure the help command stays first, so that it's printed by default when `make` is called without arguments .PHONY: help tests @@ -84,7 +87,7 @@ start-aggregator: ## start-aggregator-holesky: go run aggregator/cmd/main.go --config config-files/holesky/aggregator.yaml \ --anzen-deployment ${HOLESKY_FILES_DIR}/anzen_avs_deployment_output.json \ - --ecdsa-private-key ${AGGREGATOR_ECDSA_PRIV_KEY} \ + --ecdsa-private-key ${ECDSA_PRIVATE_KEY} \ 2>&1 | zap-pretty diff --git a/aggregator.docker-compose.yml b/aggregator.docker-compose.yml index 240b8d76..e49727ea 100644 --- a/aggregator.docker-compose.yml +++ b/aggregator.docker-compose.yml @@ -19,3 +19,5 @@ services: - ${ECDSA_PRIVATE_KEY} env_file: - .env + network_mode: "bridge" + diff --git a/config-files/holesky/sample.aggregator.yaml b/config-files/holesky/sample.aggregator.yaml index ae195a2c..5ae8ee90 100644 --- a/config-files/holesky/sample.aggregator.yaml +++ b/config-files/holesky/sample.aggregator.yaml @@ -5,3 +5,4 @@ eth_ws_url: your_eth_holesky_ws_url # address which the aggregator listens on for operator signed messages aggregator_server_ip_port_address: localhost:8090 +# use 0.0.0.0:8090 if you want to expose the aggregator to the network diff --git a/operator.docker-compose.yml b/operator.docker-compose.yml new file mode 100644 index 00000000..451763d1 --- /dev/null +++ b/operator.docker-compose.yml @@ -0,0 +1,17 @@ +version: "3" + +services: + operator: + image: ghcr.io/hydrogen-labs/anzen-avs/operator/cmd/main.go:latest + container_name: anzen-operator + volumes: + - ./:/anzen/ + working_dir: /anzen + restart: always + command: + - --config + - config-files/holesky/operator.yaml + - --anzen-deployment + - contracts/script/output/17000/anzen_avs_deployment_output.json + network_mode: "bridge" + diff --git a/operator/cmd/main.go b/operator/cmd/main.go index f463b210..1e0cafde 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -21,7 +21,7 @@ func main() { app.Flags = []cli.Flag{config.ConfigFileFlag, config.AnzenDeploymentFileFlag} app.Name = "anzen-operator" app.Usage = "Anzen Operator" - app.Description = "Service that reads numbers onchain, squares, signs, and sends them to the aggregator." + app.Description = "Service that reads AVS economic secuirty metrics posted onchain, verifies, signs, and sends them to the aggregator." app.Action = operatorMain err := app.Run(os.Args) diff --git a/operator/registration.go b/operator/registration.go index bc506c60..47534c51 100644 --- a/operator/registration.go +++ b/operator/registration.go @@ -101,6 +101,7 @@ func (o *Operator) RegisterOperatorWithAvs( // TODO: make these configurable quorumNumbers := eigenSdkTypes.QuorumNums{eigenSdkTypes.QuorumNum(0)} socket := "Not Needed" + // Salt this salt if reused will cause this operation to fail operatorToAvsRegistrationSigSalt := [32]byte{125} curBlockNum, err := o.ethClient.BlockNumber(context.Background()) if err != nil { diff --git a/sample.aggregator.env b/sample.aggregator.env index 24e20d0c..e4ca9c7a 100644 --- a/sample.aggregator.env +++ b/sample.aggregator.env @@ -1 +1 @@ -ECDSA_PRIVATE_KEY=your_private_key_here +ECDSA_PRIVATE_KEY="0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"