-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(shadow-node): add Makefile to automate linea-tracer plugin rede…
…ployment on the shadow node (#931) Signed-off-by: Tsvetan Dimitrov <[email protected]>
- Loading branch information
1 parent
44e2bd3
commit 2f59b91
Showing
2 changed files
with
28 additions
and
1 deletion.
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,27 @@ | ||
PROJECT_NAME := "linea-tracer" | ||
VERSION := $(shell cat gradle.properties | grep releaseVersion | cut -d "=" -f 2) | ||
|
||
SHADOW_NODE_ROOT := "/home/ec2-user/shadow-node" | ||
|
||
DIST_NAME := "$(PROJECT_NAME)-$(VERSION)" | ||
DIST_JAR_PATH := "arithmetization/build/libs/$(DIST_NAME).jar" | ||
BESU_PLUGINS_PATH := "$(SHADOW_NODE_ROOT)/linea-besu/plugins" | ||
ZKEVM_BIN_VERSIONED_NAME := $(shell echo zkevm.bin-$(shell git -C zkevm-constraints rev-parse --short HEAD)) | ||
ZKEVM_BIN_VERSIONED_PATH := "zkevm-constraints/$(ZKEVM_BIN_VERSIONED_NAME)" | ||
ZKEVM_BIN_ORIGINAL_PATH := "zkevm-constraints/zkevm.bin" | ||
|
||
ACCOUNT_FRAGMENT_FILE_PATH := "arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/AccountFragment.java" | ||
|
||
# call this target with -> make node_address=<node_address> shadow-node-deploy | ||
shadow-node-deploy: | ||
@sed -i -e 's/this\.existsInfinity = /\/\/ this\.existsInfinity = /g' $(ACCOUNT_FRAGMENT_FILE_PATH) | ||
@echo ">>>>>>>>>>> Building $(DIST_NAME) plugin jar file..." | ||
./gradlew --no-daemon clean jar | ||
@echo ">>>>>>>>>>> Copying $(DIST_NAME).jar to $(BESU_PLUGINS_PATH) on shadow node server..." | ||
@scp -r "$(DIST_JAR_PATH)" "$(node_address):$(BESU_PLUGINS_PATH)" | ||
@sed -i -e 's/\/\/ this\.existsInfinity = /this\.existsInfinity = /g' $(ACCOUNT_FRAGMENT_FILE_PATH) | ||
@echo ">>>>>>>>>>> Building zkevm.bin..." | ||
@make -C zkevm-constraints zkevm.bin -B && cp "$(ZKEVM_BIN_ORIGINAL_PATH)" "$(ZKEVM_BIN_VERSIONED_PATH)" | ||
@scp -r "$(ZKEVM_BIN_VERSIONED_PATH)" "$(node_address):$(SHADOW_NODE_ROOT)" | ||
@ssh -t "$(node_address)" \ | ||
'cd $(SHADOW_NODE_ROOT); ln -sf $(ZKEVM_BIN_VERSIONED_NAME) zkevm.bin; find $(BESU_PLUGINS_PATH) ! -name $(DIST_NAME).jar -type f -exec rm -f {} +; zsh -l' |
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