Skip to content

Commit

Permalink
chore(shadow-node): add Makefile to automate linea-tracer plugin rede…
Browse files Browse the repository at this point in the history
…ployment on the shadow node (#931)


Signed-off-by: Tsvetan Dimitrov <[email protected]>
  • Loading branch information
powerslider authored Aug 14, 2024
1 parent 44e2bd3 commit 2f59b91
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions Makefile
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'
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
releaseVersion=0.3.0-rc2
besuVersion=24.7-develop-c0029e6
besuArtifactGroup=io.consensys.linea-besu
distributionIdentifier=linea-arithmetization
distributionIdentifier=linea-tracer
distributionBaseUrl=https://artifacts.consensys.net/public/linea-besu/raw/names/linea-besu.tar.gz/versions/
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
Expand Down

0 comments on commit 2f59b91

Please sign in to comment.