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

docker-compose.yml

node.config.toml

prover.config.json

genesis.config.json

Deployment

  1. Start the databases (ignore this step if have database prepared in advance): state-db and prover-db

    1. docker-compose up -d cdk-validium-state-db docker-compose up -d cdk-validium-prover-db

  2. Refer to recover database from snapshot to restore the snapshot

  3. Start the sync service

    1. Put all config files under the work directory (4 files),start the prover first

      1. docker-compose up -d cdk-validium-prover

    2. Start the pool-db (It is only used as a startup dependency and does not occupy resources. Can be maintained locally):

      1. docker-compose up -d cdk-validium-pool-db

    3. Wait 5 secs, start the sync service

      1. docker-compose up -d cdk-validium-sync

  4. Start the json-rpc service (scalable, we recommend maintaining it separately from the sync service)

    1. Put all config files under the work directory (4 files),start the prover first

      1. docker-compose up -d cdk-validium-prover

    2. Start the pool-db (It is only used as a startup dependency and does not occupy resources. Can be maintained locally):

      1. docker-compose up -d cdk-validium-pool-db

    3. Wait 5 secs, start the json-rpc service

      1. docker-compose up -d cdk-validium-json-rpc

Follow-ups

  1. Check the synchronizing status:

    1. Run docker logs cdk-validium-sync --tail 50 to check the synchronizing status

    2. When it shows Trusted state fully synchronized, it means that you have caught up with the latest L2 data

  2. Send requests

    1. Visit the host:port of the json-rpc service (default as localhost:8123) to interact with your external node

Last updated