External-node Deployment
Preparation
Overall Structure
Database: state-db, prover-db (or hash-db)
Services:
prover, sync, json-rpc
Recommend requirements for services:
Set 1: CPU 8-cores, RAM 16G (sync + prover becomes a set)
Set 2: CPU 8-cores, RAM 16G * n (json-rpc + prover becomes a set)
Prover: zkevm virtual machine, is required by sync and json-rpc services
Sync: synchronizer service, depends on a prover instance, retrieve L2 data from L1 and trusted node. Only a single instance can be run at the same time.
Json-rpc: json-rpc service, depends on a prover instance, provides the entrance for outside requests. Multiple instances can be run simultaneously.
It is recommended that each sync/json-rpc instance connects to a standalone prover instance as a pod for maintenance.
Database(Postgres)
Requires:
state-db
prover-db (or hash-db)
Configurations
docker-compose.yml
node.config.toml
prover.config.json
genesis.config.json
Deployment
Start the databases (ignore this step if have database prepared in advance): state-db and prover-db
docker-compose up -d cdk-validium-state-dbdocker-compose up -d cdk-validium-prover-db
Refer to recover database from snapshot to restore the snapshot
Start the sync service
Put all config files under the work directory (4 files),start the prover first
docker-compose up -d cdk-validium-prover
Start the pool-db (It is only used as a startup dependency and does not occupy resources. Can be maintained locally):
docker-compose up -d cdk-validium-pool-db
Wait 5 secs, start the sync service
docker-compose up -d cdk-validium-sync
Start the json-rpc service (scalable, we recommend maintaining it separately from the sync service)
Put all config files under the work directory (4 files),start the prover first
docker-compose up -d cdk-validium-prover
Start the pool-db (It is only used as a startup dependency and does not occupy resources. Can be maintained locally):
docker-compose up -d cdk-validium-pool-db
Wait 5 secs, start the json-rpc service
docker-compose up -d cdk-validium-json-rpc
Follow-ups
Check the synchronizing status:
Run
docker logs cdk-validium-sync --tail 50to check the synchronizing statusWhen it shows
Trusted state fully synchronized, it means that you have caught up with the latest L2 data
Send requests
Visit the host:port of the
json-rpc service(default as localhost:8123) to interact with your external node
Last updated