This repository contains all the necessary resources for deploying VFlow nodes, including RPC, collator and boot nodes, on both the testnet and mainnet.
There are three types of nodes that can be deployed:
- rpc
- collator
- boot
All scripts in this repository prompt for selection of the node type and the network to deploy.
- docker
- docker compose
- jq
- gnu-sed for Darwin distribution
OPTIONAL steps before manually starting the project after running the ./scripts/init.sh script.
Run the init.sh script and follow the instructions to prepare the deployment for the first time.
This script will generate all necessary deployment files under the deployments directory and provide the command to start the project. However, it will not start the project automatically.
./scripts/init.shTo reduce the time required for a node's startup, daily snapshots of chain data are available for:
- Mainnet: https://bootstraps.zkverify.io/
- Testnet: https://bootstraps.zkverify.io/volta
Snapshots are available in two forms:
- Node snapshot
- Archive node snapshot
Each snapshot is a .tar.gz archive containing the db directory, intended to replace the db directory generated during the initial node run.
You will need to download both the zkVerify(relay chain) and the VFlow(para chain) snapshots.
To use a snapshot:
- Stop the running node:
./scripts/stop.sh
- Navigate to the VFlow node's data directory. This may require
sudopermissions. For an RPC node, the path is:- For testnet:
cd /var/lib/docker/volumes/vflow-testnet_node-data/_data/node/chains/vflow_testnet - For mainnet:
cd /var/lib/docker/volumes/vflow_node-data/_data/node/chains/vflow_mainnet
- For testnet:
- Note the owner and permissions of the existing
dbdirectory, then delete it. - Extract the downloaded VFlow snapshot and move its
dbdirectory into the current directory. - Ensure the new
dbdirectory has the same permissions as the original db directory. - Navigate to the zkVerify node's data directory. This may require
sudopermissions. For an RPC node, the path is:- For testnet:
cd /var/lib/docker/volumes/vflow-testnet_node-data/_data/node/zkv_relay/chains/zkv_testnet - For mainnet:
cd /var/lib/docker/volumes/vflow_node-data/_data/node/zkv_relay/chains/zkv_mainnet
- For testnet:
- Note the owner and permissions of the existing
dbdirectory, then delete it. - Extract the downloaded zkVerify snapshot and move its
dbdirectory into the current directory. - Ensure the new
dbdirectory has the same permissions as the original db directory. - Return to the project directory and start the node:
./scripts/start.sh- Verify the snapshot is working by checking the node's Docker logs to ensure the relay and para chains’ block heights start near their respective current heights and continue steadily increasing.
During the initial deployment depending on the node type, if prompted, the script will generate and store PARA_NODE_KEY and PARA_SECRET_PHRASE values in the .env file.
Alternatively, these secrets can be injected at runtime using a custom container entrypoint script to avoid keeping them in plaintext on disk.
Use the following steps to implement this approach:
- Delete values of PARA_NODE_KEY and PARA_SECRET_PHRASE under the
deployments/${NODE_TYPE}/${NETWORK}/.envPARA_NODE_KEY="" PARA_SECRET_PHRASE="" - Create entrypoint_secrets.sh file under
deployments/${NODE_TYPE}/${NETWORK}/directory. For example:#!/usr/bin/env sh set -eu # TODO: Implement logic to inject secrets into the environment # Run the application entrypoint echo "=== 🚀 Starting the application entrypoint now..." exec /app/entrypoint.sh "$@" - Modify
deployments/${NODE_TYPE}/${NETWORK}/docker-compose.ymlfile to mount and execute custom entrypoint scriptvolumes: - "node-data:/data:rw" - "./entrypoint_secrets.sh:/app/entrypoint_secrets.sh:rw" entrypoint: ["/app/entrypoint_secrets.sh"] - Start compose project using the command provided in the end of init.sh script execution.
To update the project to a new version (e.g., when a new release is available):
- Pull the latest changes from the repository.
- Run the update.sh script.
.env file, it is recommended to accept all changes, unless there is a specific reason not to.
./scripts/update.shRun the destroy.sh script to destroy the node stack and all the associated resources. The script will prompt for confirmation before removing any resources.
./scripts/destroy.shRun the start.sh script to start the node stack.
./scripts/start.shRun the stop.sh script to just stop the node stack.
./scripts/stop.shPlease refer to the CONTRIBUTING.md file for information on how to contribute to this project.
This project is licensed under the MIT License - see the LICENSE file for details.