Skip to content

Commit 27d2913

Browse files
authored
fix(makefile): load operator address correctly (#2113)
1 parent b7d720a commit 27d2913

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

Makefile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ else
1616
endif
1717

1818
CONFIG_FILE?=config-files/config.yaml
19-
export OPERATOR_ADDRESS ?= $(shell yq -r '.operator.address' $(CONFIG_FILE))
2019
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
2120

2221
OPERATOR_VERSION=v0.19.0
@@ -356,11 +355,16 @@ operator_set_eigen_sdk_go_version_error:
356355

357356
operator_full_registration: operator_get_eth operator_register_with_eigen_layer operator_mint_mock_tokens operator_deposit_into_mock_strategy operator_whitelist_devnet operator_register_with_aligned_layer ## Register the operator in EigenLayer and AlignedLayer. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, CONFIG_FILE
358357

359-
operator_full_registration_and_start: $(GET_SDK_VERSION) operator_full_registration operator_start ## Register the operator in EigenLayer and AlignedLayer, then start the Operator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, CONFIG_FILE
358+
operator_full_registration_and_start: ## Register the operator in EigenLayer and AlignedLayer, then start the Operator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, CONFIG_FILE
359+
@echo "Operator address: $$(yq -r '.operator.address' $$CONFIG_FILE)" && \
360+
$(MAKE) operator_full_registration CONFIG_FILE=$(CONFIG_FILE) && \
361+
$(MAKE) operator_start ENVIRONMENT=devnet CONFIG_FILE=$(CONFIG_FILE)
360362

361363
operator_full_registration_and_start_ethereum_package: ## Register the operator in EigenLayer and AlignedLayer, then start the Operator with Ethereum package config
362-
$(MAKE) operator_full_registration CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
363-
$(MAKE) operator_start ENVIRONMENT=devnet CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
364+
@export CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml && \
365+
echo "Operator address: $$(yq -r '.operator.address' $$CONFIG_FILE)" && \
366+
$(MAKE) operator_full_registration CONFIG_FILE=$$CONFIG_FILE && \
367+
$(MAKE) operator_start ENVIRONMENT=devnet CONFIG_FILE=$$CONFIG_FILE
364368

365369

366370
operator_build: deps ## Build the Operator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>
@@ -416,33 +420,39 @@ operator_generate_config:
416420

417421
operator_get_eth:
418422
@echo "Sending funds to operator address on devnet"
419-
@. ./scripts/fund_operator_devnet.sh
423+
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
424+
. ./scripts/fund_operator_devnet.sh
420425

421426
operator_register_with_eigen_layer:
422427
@echo "Registering operator with EigenLayer"
423428
@echo "" | eigenlayer operator register $(CONFIG_FILE)
424429

425430
operator_mint_mock_tokens:
426431
@echo "Minting tokens"
432+
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
427433
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 100000000000000000
428434

429435
operator_whitelist_devnet:
430436
@echo "Whitelisting operator"
431-
@echo "Operator address: $(OPERATOR_ADDRESS)"
432-
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/operator_whitelist.sh $(OPERATOR_ADDRESS)
437+
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
438+
echo "Operator address: $$OPERATOR_ADDRESS" && \
439+
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/operator_whitelist.sh $$OPERATOR_ADDRESS
433440

434441
operator_remove_from_whitelist_devnet:
435442
@echo "Removing operator"
436-
@echo "Operator address: $(OPERATOR_ADDRESS)"
437-
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/operator_remove_from_whitelist.sh $(OPERATOR_ADDRESS)
443+
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
444+
echo "Operator address: $$OPERATOR_ADDRESS" && \
445+
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/operator_remove_from_whitelist.sh $$OPERATOR_ADDRESS
438446

439447
operator_whitelist:
440-
@echo "Whitelisting operator $(OPERATOR_ADDRESS) on $(NETWORK)"
441-
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/operator_whitelist.sh $(OPERATOR_ADDRESS)
448+
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
449+
echo "Whitelisting operator $$OPERATOR_ADDRESS on $(NETWORK)" && \
450+
. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/operator_whitelist.sh $$OPERATOR_ADDRESS
442451

443452
operator_remove_from_whitelist:
444-
@echo "Removing operator $(OPERATOR_ADDRESS)"
445-
@. contracts/scripts/.env && . contracts/scripts/operator_remove_from_whitelist.sh $(OPERATOR_ADDRESS)
453+
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
454+
echo "Removing operator $$OPERATOR_ADDRESS" && \
455+
. contracts/scripts/.env && . contracts/scripts/operator_remove_from_whitelist.sh $$OPERATOR_ADDRESS
446456

447457
operator_deposit_into_mock_strategy:
448458
@echo "Depositing into mock strategy"

0 commit comments

Comments
 (0)