Skip to content

Commit

Permalink
Add all components for private network (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 authored Nov 19, 2024
1 parent 9214e2f commit 33735bc
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 206 deletions.
24 changes: 14 additions & 10 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
DOCKER_COMPOSE := docker compose -f docker-compose.yml
DOCKER_STATELESS_EXECUTOR := xlayer-executor
DOCKER_STATE_DB := xlayer-state-db
DOCKER_SEQ_SENDER := xlayer-seqs
DOCKER_AGGREGATOR := xlayer-agg
DOCKER_AGGREGATOR_DB := xlayer-agg-db
Expand All @@ -20,9 +19,9 @@ DOCKER_DATA_AVAILABILITY_DB := xlayer-da-db
DOCKER_POOL_DB := xlayer-pool-db
DOCKER_POOL_MANAGER := xlayer-pool-manager
DOCKER_SIGNER := xlayer-signer
DOCKER_DS := xlayer-ds

RUN_DOCKER_STATELESS_EXECUTOR := $(DOCKER_COMPOSE) up -d $(DOCKER_STATELESS_EXECUTOR)
RUN_DOCKER_STATE_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_STATE_DB)
RUN_DOCKER_SEQ_SENDER := $(DOCKER_COMPOSE) up -d $(DOCKER_SEQ_SENDER)
RUN_DOCKER_AGGREGATOR := $(DOCKER_COMPOSE) up -d $(DOCKER_AGGREGATOR)
RUN_DOCKER_AGGREGATOR_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_AGGREGATOR_DB)
Expand All @@ -42,6 +41,7 @@ RUN_DOCKER_DATA_AVAILABILITY_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_DATA_AVAILAB
RUN_DOCKER_POOL_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_POOL_DB)
RUN_DOCKER_POOL_MANAGER := $(DOCKER_COMPOSE) up -d $(DOCKER_POOL_MANAGER)
RUN_DOCKER_SIGNER := $(DOCKER_COMPOSE) up -d $(DOCKER_SIGNER)
RUN_DOCKER_DS := $(DOCKER_COMPOSE) up -d $(DOCKER_DS)

STOP := $(DOCKER_COMPOSE) down --remove-orphans; rm -rf sqlite

Expand All @@ -51,18 +51,18 @@ run: ## Runs a full node
$(RUN_DOCKER_L1_NETWORK)
$(RUN_DOCKER_DATA_AVAILABILITY_DB)
$(RUN_DOCKER_POOL_DB)
$(RUN_DOCKER_STATE_DB)
$(RUN_DOCKER_AGGREGATOR_DB)
sleep 3
$(RUN_DOCKER_DATA_AVAILABILITY)
$(RUN_DOCKER_APPROVE)
$(RUN_DOCKER_STATELESS_EXECUTOR)

# app services
$(RUN_DOCKER_STATELESS_EXECUTOR)
sleep 3
$(RUN_DOCKER_SEQ)
$(RUN_DOCKER_PROVER)
sleep 10
$(RUN_DOCKER_DS)
$(RUN_DOCKER_SIGNER)
$(RUN_DOCKER_SEQ_SENDER)
$(RUN_DOCKER_AGGREGATOR)
Expand All @@ -75,29 +75,30 @@ all: ## Runs a full node
$(RUN_DOCKER_L1_NETWORK)
$(RUN_DOCKER_DATA_AVAILABILITY_DB)
$(RUN_DOCKER_POOL_DB)
$(RUN_DOCKER_STATE_DB)
$(RUN_DOCKER_AGGREGATOR_DB)
$(RUN_DOCKER_BRIDGE_DB)
$(RUN_DOCKER_BRIDGE_REDIS)
$(RUN_DOCKER_BRIDGE_ZOOKEEPER)
$(RUN_DOCKER_BRIDGE_COIN_KAFKA)
sleep 3
$(RUN_DOCKER_DATA_AVAILABILITY)
$(RUN_DOCKER_APPROVE)
$(RUN_DOCKER_STATELESS_EXECUTOR)

# app services
#sleep 3
#$(RUN_DOCKER_STATELESS_EXECUTOR)
sleep 3
$(RUN_DOCKER_SEQ)
$(RUN_DOCKER_PROVER)
sleep 10
$(RUN_DOCKER_DS)
$(RUN_DOCKER_SIGNER)
$(RUN_DOCKER_SEQ_SENDER)
$(RUN_DOCKER_AGGREGATOR)
$(RUN_DOCKER_POOL_MANAGER)
$(RUN_DOCKER_RPC)

# bridge services
sleep 3
sleep 30
$(RUN_DOCKER_BRIDGE_SERVICE)
sleep 3
$(RUN_DOCKER_BRIDGE_UI)
Expand All @@ -109,9 +110,12 @@ stop: ## Stops all services
.PHONY: min-run
min-run: ## Runs a minimal node
$(RUN_DOCKER_L1_NETWORK)
sleep 3
$(RUN_DOCKER_STATELESS_EXECUTOR)
sleep 10
$(RUN_DOCKER_SEQ)
sleep 20
sleep 10
$(RUN_DOCKER_DS)
sleep 10
$(RUN_DOCKER_RPC)


Expand Down
247 changes: 127 additions & 120 deletions test/config/cdk.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Environment = "development" # "production" or "development"
Level = "info"
Outputs = ["stderr"]

[NetworkConfig.L1]
L1ChainID = 1337
PolAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
ZkEVMAddr = "0xeb173087729c88a47568AF87b17C653039377BA6"
RollupManagerAddr = "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
GlobalExitRootManagerAddr = "0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"

[Etherman]
URL="http://xlayer-mock-l1-network:8545"
ForkIDChunkSize=100
Expand Down Expand Up @@ -49,7 +56,7 @@ GetBatchWaitInterval = "10s"
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
StoragePath = "ethtxmanager.sqlite"
StoragePath = "tmp/cdk/ethtxmanager.sqlite"
ReadPendingL1Txs = false
SafeStatusL1NumberOfBlocks = 0
FinalizedStatusL1NumberOfBlocks = 0
Expand Down Expand Up @@ -124,7 +131,7 @@ SyncModeOnlyEnabled = false
Outputs = ["stderr"]
[Aggregator.Synchronizer.SQLDB]
DriverName = "sqlite3"
DataSource = "file:/tmp/cdk/aggregator_sync_db.sqlite"
DataSource = "/tmp/cdk/aggregator_sync_db.sqlite"
[Aggregator.Synchronizer.Synchronizer]
SyncInterval = "10s"
SyncChunkSize = 1000
Expand Down Expand Up @@ -153,13 +160,14 @@ SyncModeOnlyEnabled = false
NumRequests = 1000
Interval = "1s"
[ReorgDetectorL1]
DBPath = "/tmp/cdk/reorgdetectorl1"
DBPath = "/tmp/cdk/reorg_detector_l1.sqlite"

[ReorgDetectorL2]
DBPath = "/tmp/cdk/reorgdetectorl2"
# Only for AGGORACLE, RPC, AGGSENDER
#[ReorgDetectorL2]
#DBPath = "/tmp/cdk/reorg_detector_l2.sqlite"

[L1InfoTreeSync]
DBPath = "/tmp/cdk/L1InfoTreeSync.sqlite"
DBPath = "/tmp/cdk/l1_info_tree_sync.sqlite"
GlobalExitRootAddr="0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"
RollupManagerAddr = "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
SyncBlockChunkSize=10
Expand All @@ -168,123 +176,122 @@ URLRPCL1="http://xlayer-rpc:8545"
WaitForNewBlocksPeriod="100ms"
InitialBlock= 353

[AggOracle]
TargetChainType="EVM"
URLRPCL1=""
BlockFinality="FinalizedBlock"
WaitPeriodNextGER="100ms"
[AggOracle.EVMSender]
GlobalExitRootL2="0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa"
URLRPCL2=""
ChainIDL2=195
GasOffset=0
WaitPeriodMonitorTx="100ms"
SenderAddr="0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
[AggOracle.EVMSender.EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2s"
GetReceiptMaxTime = "250ms"
GetReceiptWaitInterval = "1s"
PrivateKeys = [
{Path = "/app/keystore/aggoracle.keystore", Password = "testonly"},
]
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
StoragePath = "/tmp/cdk/ethtxmanager-sequencesender.sqlite"
ReadPendingL1Txs = false
SafeStatusL1NumberOfBlocks = 5
FinalizedStatusL1NumberOfBlocks = 10
[AggOracle.EVMSender.EthTxManager.Etherman]
URL = "http://xlayer-mock-l1-network:8545"
MultiGasProvider = false
L1ChainID = 1337
HTTPHeaders = []
# Only for AGGORACLE, RPC, AGGSENDER
#[AggOracle]
#TargetChainType="EVM"
#URLRPCL1=""
#BlockFinality="FinalizedBlock"
#WaitPeriodNextGER="100ms"
# [AggOracle.EVMSender]
# GlobalExitRootL2="0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa"
# URLRPCL2=""
# ChainIDL2=195
# GasOffset=0
# WaitPeriodMonitorTx="100ms"
# SenderAddr="0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
# [AggOracle.EVMSender.EthTxManager]
# FrequencyToMonitorTxs = "1s"
# WaitTxToBeMined = "2s"
# GetReceiptMaxTime = "250ms"
# GetReceiptWaitInterval = "1s"
# PrivateKeys = [
# {Path = "/app/keystore/aggoracle.keystore", Password = "testonly"},
# ]
# ForcedGas = 0
# GasPriceMarginFactor = 1
# MaxGasPriceLimit = 0
# StoragePath = "/tmp/cdk/ethtxmanager-sequencesender.sqlite"
# ReadPendingL1Txs = false
# SafeStatusL1NumberOfBlocks = 5
# FinalizedStatusL1NumberOfBlocks = 10
# [AggOracle.EVMSender.EthTxManager.Etherman]
# URL = "http://xlayer-mock-l1-network:8545"
# MultiGasProvider = false
# L1ChainID = 1337
# HTTPHeaders = []

[RPC]
Host = "0.0.0.0"
Port = 5576
ReadTimeout = "2s"
WriteTimeout = "2s"
MaxRequestsPerIPAndSecond = 10

[ClaimSponsor]
DBPath = "/tmp/cdk/claimsopnsor.sqlite"
Enabled = true
SenderAddr = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
BridgeAddrL2 = "0x3a277Fa4E78cc1266F32E26c467F99A8eAEfF7c3"
MaxGas = 200000
RetryAfterErrorPeriod = "1s"
MaxRetryAttemptsAfterError = -1
WaitTxToBeMinedPeriod = "3s"
WaitOnEmptyQueue = "3s"
GasOffset = 0
[ClaimSponsor.EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2s"
GetReceiptMaxTime = "250ms"
GetReceiptWaitInterval = "1s"
PrivateKeys = [
{Path = "/app/keystore/claimsopnsor.keystore", Password = "testonly"},
]
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
StoragePath = "/tmp/cdk/ethtxmanager-claimsponsor.sqlite"
ReadPendingL1Txs = false
SafeStatusL1NumberOfBlocks = 5
FinalizedStatusL1NumberOfBlocks = 10
[ClaimSponsor.EthTxManager.Etherman]
URL = "http://xlayer-mock-l1-network:8545"
MultiGasProvider = false
L1ChainID = 1337
HTTPHeaders = []
# Only for RPC
#[RPC]
#Host = "0.0.0.0"
#Port = 5576
#ReadTimeout = "2s"
#WriteTimeout = "2s"
#MaxRequestsPerIPAndSecond = 10

[BridgeL1Sync]
DBPath = "/tmp/cdk/bridgel1sync.sqlite"
BlockFinality = "LatestBlock"
InitialBlockNum = 0
BridgeAddr = "0x3a277Fa4E78cc1266F32E26c467F99A8eAEfF7c3"
SyncBlockChunkSize = 100
RetryAfterErrorPeriod = "1s"
MaxRetryAttemptsAfterError = -1
WaitForNewBlocksPeriod = "3s"
OriginNetwork=0
# Only for RPC
#[ClaimSponsor]
#DBPath = "/tmp/cdk/claimsopnsor.sqlite"
#Enabled = true
#SenderAddr = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
#BridgeAddrL2 = "0x3a277Fa4E78cc1266F32E26c467F99A8eAEfF7c3"
#MaxGas = 200000
#RetryAfterErrorPeriod = "1s"
#MaxRetryAttemptsAfterError = -1
#WaitTxToBeMinedPeriod = "3s"
#WaitOnEmptyQueue = "3s"
#GasOffset = 0
# [ClaimSponsor.EthTxManager]
# FrequencyToMonitorTxs = "1s"
# WaitTxToBeMined = "2s"
# GetReceiptMaxTime = "250ms"
# GetReceiptWaitInterval = "1s"
# PrivateKeys = [
# {Path = "/app/keystore/claimsopnsor.keystore", Password = "testonly"},
# ]
# ForcedGas = 0
# GasPriceMarginFactor = 1
# MaxGasPriceLimit = 0
# StoragePath = "/tmp/cdk/ethtxmanager-claimsponsor.sqlite"
# ReadPendingL1Txs = false
# SafeStatusL1NumberOfBlocks = 5
# FinalizedStatusL1NumberOfBlocks = 10
# [ClaimSponsor.EthTxManager.Etherman]
# URL = "http://xlayer-mock-l1-network:8545"
# MultiGasProvider = false
# L1ChainID = 1337
# HTTPHeaders = []

[BridgeL2Sync]
DBPath = "/tmp/cdk/bridgel2sync.sqlite"
BlockFinality = "LatestBlock"
InitialBlockNum = 0
BridgeAddr = "0x3a277Fa4E78cc1266F32E26c467F99A8eAEfF7c3"
SyncBlockChunkSize = 100
RetryAfterErrorPeriod = "1s"
MaxRetryAttemptsAfterError = -1
WaitForNewBlocksPeriod = "3s"
OriginNetwork=1
# Only for RPC
#[BridgeL1Sync]
#DBPath = "/tmp/cdk/bridgel1sync.sqlite"
#BlockFinality = "LatestBlock"
#InitialBlockNum = 0
#BridgeAddr = "0x3a277Fa4E78cc1266F32E26c467F99A8eAEfF7c3"
#SyncBlockChunkSize = 100
#RetryAfterErrorPeriod = "1s"
#MaxRetryAttemptsAfterError = -1
#WaitForNewBlocksPeriod = "3s"
#OriginNetwork=0

[LastGERSync]
# MDBX database path
DBPath = "/tmp/cdk/lastgersync.sqlite"
BlockFinality = "LatestBlock"
InitialBlockNum = 0
GlobalExitRootL2Addr = "0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa"
RetryAfterErrorPeriod = "1s"
MaxRetryAttemptsAfterError = -1
WaitForNewBlocksPeriod = "1s"
DownloadBufferSize = 100
# For RPC and aggsender
#[BridgeL2Sync]
#DBPath = "/tmp/cdk/bridgel2sync.sqlite"
#BlockFinality = "LatestBlock"
#InitialBlockNum = 0
#BridgeAddr = "0x3a277Fa4E78cc1266F32E26c467F99A8eAEfF7c3"
#SyncBlockChunkSize = 100
#RetryAfterErrorPeriod = "1s"
#MaxRetryAttemptsAfterError = -1
#WaitForNewBlocksPeriod = "3s"
#OriginNetwork=1

[NetworkConfig.L1]
L1ChainID = 1337
PolAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
ZkEVMAddr = "0xeb173087729c88a47568AF87b17C653039377BA6"
RollupManagerAddr = "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
GlobalExitRootManagerAddr = "0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"
# Only for RPC
#[LastGERSync]
## MDBX database path
#DBPath = "/tmp/cdk/lastgersync.sqlite"
#BlockFinality = "LatestBlock"
#InitialBlockNum = 0
#GlobalExitRootL2Addr = "0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa"
#RetryAfterErrorPeriod = "1s"
#MaxRetryAttemptsAfterError = -1
#WaitForNewBlocksPeriod = "1s"
#DownloadBufferSize = 100

[AggSender]
StoragePath = "/tmp/cdk/aggsender.sqlite"
AggLayerURL = ""
AggsenderPrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}
BlockGetInterval = "2s"
URLRPCL2="http://xlayer-rpc:8545"
CheckSettledInterval = "2s"
SaveCertificatesToFiles = false
#[AggSender]
#StoragePath = "/tmp/cdk/aggsender.sqlite"
#AggLayerURL = ""
#AggsenderPrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}
#BlockGetInterval = "2s"
#URLRPCL2="http://xlayer-rpc:8545"
#CheckSettledInterval = "2s"
#SaveCertificatesToFiles = false
4 changes: 4 additions & 0 deletions test/config/ds-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Server = "xlayer-seq:6900"
Port = 7900
File = "/home/dsrelay/datarelay.bin"
Log = "info"
2 changes: 1 addition & 1 deletion test/config/test.erigon.rpc.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ http: true
private.api.addr: localhost:9091
zkevm.l2-chain-id: 195
zkevm.l2-sequencer-rpc-url: http://xlayer-seq:8545
zkevm.l2-datastreamer-url: xlayer-seq:6900
zkevm.l2-datastreamer-url: xlayer-ds:7900
zkevm.l1-chain-id: 1337
zkevm.l1-rpc-url: http://xlayer-mock-l1-network:8545

Expand Down
Loading

0 comments on commit 33735bc

Please sign in to comment.