Skip to content

Commit

Permalink
deploy sovereign contracts for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed Jan 9, 2025
1 parent 7bee3bf commit 0e6c325
Show file tree
Hide file tree
Showing 12 changed files with 4,579 additions and 114 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN cd /src && make build
# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0
COPY --from=build /src/dist/zkevm-bridge /app/zkevm-bridge
COPY --from=build /src/dist/test-deploy-claimcompressor /app/test-deploy-claimcompressor
COPY --from=build /src/dist/test-deploy-tool /app/test-deploy-tool
COPY --from=build /src/dist/zkevm-autoclaimer /app/zkevm-autoclaimer
COPY --from=build /src/test/vectors /app/test/vectors
EXPOSE 8080
Expand Down
26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DOCKER_COMPOSE_BRIDGE_V1TOV2 := zkevm-bridge-service-v1tov2
DOCKER_COMPOSE_BRIDGE_1 := zkevm-bridge-service-1
DOCKER_COMPOSE_BRIDGE_2 := zkevm-bridge-service-2
DOCKER_COMPOSE_BRIDGE_3 := zkevm-bridge-service-3
DOCKER_COMPOSE_BRIDGE_SOVEREIGN_CHAIN := zkevm-bridge-service-sovereign-chain

RUN_STATE_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_STATE_DB)
RUN_POOL_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_POOL_DB)
Expand All @@ -50,6 +51,7 @@ RUN_BRIDGE_1 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_1)
RUN_BRIDGE_2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_2)
RUN_BRIDGE_3 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_3)
RUN_BRIDGE_V1TOV2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_V1TOV2)
RUN_BRIDGE_SOVEREIGN_CHAIN := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_SOVEREIGN_CHAIN)

STOP_NODE_DB := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_NODE_DB) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_NODE_DB)
STOP_BRIDGE_DB := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_DB) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_DB)
Expand All @@ -71,6 +73,7 @@ STOP_BRIDGE_1 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_1) && $(DOCKER_C
STOP_BRIDGE_2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_2)
STOP_BRIDGE_3 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_3) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_3)
STOP_BRIDGE_V1TOV2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_V1TOV2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_V1TOV2)
STOP_BRIDGE_SOVEREIGN_CHAIN := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_SOVEREIGN_CHAIN) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_SOVEREIGN_CHAIN)
STOP := $(DOCKER_COMPOSE) down --remove-orphans

LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-bridge-service.Version=$(VERSION)'
Expand All @@ -83,8 +86,8 @@ GO_BIN := $(GO_BASE)/dist
GO_ENV_VARS := GO_BIN=$(GO_BIN)
GO_BINARY := zkevm-bridge
GO_CMD := $(GO_BASE)/cmd
GO_DEPLOY_SCRIPT := $(GO_BASE)/test/scripts/deployclaimcompressor
GO_DEPLOY_SCRIPT_BINARY := test-deploy-claimcompressor
GO_DEPLOY_SCRIPT := $(GO_BASE)/test/scripts/deploytool
GO_DEPLOY_SCRIPT_BINARY := test-deploy-tool
GO_DEPLOY_AUTOCLAIMER := $(GO_BASE)/autoclaimservice
GO_DEPLOY_AUTOCLAIMER_BINARY := zkevm-autoclaimer

Expand Down Expand Up @@ -295,6 +298,14 @@ run-bridge-v1tov2: ## Runs the bridge service
stop-bridge-v1tov2: ## Stops the bridge service
$(STOP_BRIDGE_V1TOV2)

.PHONY: run-bridge-sovereign-chain
run-bridge-sovereign-chain: ## Runs the bridge service
$(RUN_BRIDGE_SOVEREIGN_CHAIN)

.PHONY: stop-bridge-sovereign-chain
stop-bridge-sovereign-chain: ## Stops the bridge service
$(STOP_BRIDGE_SOVEREIGN_CHAIN)

.PHONY: stop
stop: ## Stops all services
$(STOP)
Expand Down Expand Up @@ -386,6 +397,17 @@ run-v1tov2: stop ## runs all services
$(RUN_AGGREGATOR_V1TOV2)
$(RUN_BRIDGE_V1TOV2)

.PHONY: run-sovereign-chain
run-sovereign-chain: ## runs all services
$(RUN_DBS)
$(RUN_L1_NETWORK)
sleep 5
$(RUN_ZKPROVER)
sleep 3
$(RUN_NODE)
sleep 7
$(RUN_BRIDGE_SOVEREIGN_CHAIN)

.PHONY: update-external-dependencies
update-external-dependencies: ## Updates external dependencies like images, test vectors or proto files
go run ./scripts/cmd/... updatedeps
Expand Down
40 changes: 37 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ services:
command:
- "/bin/sh"
- "-c"
- "/app/test-deploy-claimcompressor deploy --url \"http://zkevm-node:8123\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
- "/app/test-deploy-tool deployClaimCompressor --url \"http://zkevm-node:8123\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
/app/zkevm-bridge run --cfg /app/config.toml"

zkevm-bridge-service-v1tov2:
Expand Down Expand Up @@ -485,6 +485,40 @@ services:
command:
- "/bin/sh"
- "-c"
- "/app/test-deploy-claimcompressor deploy --url \"http://zkevm-node-1:8123\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
/app/test-deploy-claimcompressor deploy --url \"http://zkevm-node-2:8124\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
- "/app/test-deploy-tool deployClaimCompressor --url \"http://zkevm-node-1:8123\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
/app/test-deploy-tool deployClaimCompressor --url \"http://zkevm-node-2:8124\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
/app/zkevm-bridge run --cfg /app/config.toml"

zkevm-bridge-service-sovereign-chain:
container_name: zkevm-bridge-service-sovereign-chain
image: zkevm-bridge-service
ports:
- 8080:8080
- 9090:9090
environment:
- ZKEVM_BRIDGE_SYNCDB_USER=test_user
- ZKEVM_BRIDGE_SYNCDB_PASSWORD=test_password
- ZKEVM_BRIDGE_SYNCDB_NAME=test_db
- ZKEVM_BRIDGE_SYNCDB_HOST=zkevm-bridge-db
- ZKEVM_BRIDGE_SYNCDB_PORT=5432
- ZKEVM_BRIDGE_BRIDGESERVER_DB_USER=test_user
- ZKEVM_BRIDGE_BRIDGESERVER_DB_PASSWORD=test_password
- ZKEVM_BRIDGE_BRIDGESERVER_DB_NAME=test_db
- ZKEVM_BRIDGE_BRIDGESERVER_DB_HOST=zkevm-bridge-db
- ZKEVM_BRIDGE_BRIDGESERVER_DB_PORT=5432
- ZKEVM_BRIDGE_CLAIMTXMANAGER_GROUPINGCLAIMS_ENABLED=${ZKEVM_BRIDGE_CLAIMTXMANAGER_GROUPINGCLAIMS_ENABLED}
- ZKEVM_BRIDGE_NETWORKCONFIG_SOVEREIGNCHAINS=true
- ZKEVM_BRIDGE_NETWORKCONFIG_L2POLYGONZKEVMGLOBALEXITROOTADDRESSES=0x712516e61C8B383dF4A63CFe83d7701Bce54B03e
- ZKEVM_BRIDGE_NETWORKCONFIG_L2POLYGONBRIDGEADDRESSES=0x71C95911E9a5D330f4D621842EC243EE1343292e

volumes:
- ./test/test.keystore.claimtx:/pk/keystore.claimtxmanager
- ./test/test.keystore.aggregator:/pk/keystore.aggregator
- ./config/config.local.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
- "/app/test-deploy-tool deployClaimCompressor --url \"http://zkevm-node:8123\" --bridgeAddress \"0xFe12ABaa190Ef0c8638Ee0ba9F828BF41368Ca0E\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
/app/test-deploy-tool sendETH --url \"http://zkevm-node:8123\" --destAddress \"0x70997970c51812dc3a010c7d01b50e0d17dc79c8\" --walletFile /pk/keystore.claimtxmanager --password \"testonly\" &&
/app/test-deploy-tool deploySovereignChainSMC --url \"http://zkevm-node:8123\" --walletFile /pk/keystore.aggregator --password \"testonly\" &&
/app/zkevm-bridge run --cfg /app/config.toml"
Loading

0 comments on commit 0e6c325

Please sign in to comment.