Docker 快速开始
预构建镜像已发布在 DockerHub,适用于 amd64。若需其他架构(如 Apple Silicon),请参阅 使用二进制运行。
Prerequisites
开始前请安装:
- Docker,
- Docker Compose (v2),
jqtool,gnu-sedtool (macOS only).
In order to check Docker and Docker Compose availability, open a terminal and type:
docker --version
then type:
docker compose version
如有错误,请参考官方 Docker 与 Docker Compose 安装指南。
备注
后续默认具备基础 Docker 知识。如不熟悉,可一边操作一边查阅资料。
To check your machine for jq tool availability, open a terminal and type:
jq --version
若 jq 不可用,可安装:
- Linux: command
sudo apt install jq, - macOS: command
brew install jq, - Windows: download it from the official GitHub release page, rename the executable as
jq.exeand save it in a directory that's part of your system'sPATH(e.g.C:\Windows\System32orC:\Windows).
检查 gnu-sed(macOS):
gsed --version
If the command results in an error, you can install gnu-sed with:
brew install gsed
查看 releases 获取最新 tag latest_tag,克隆:
git clone --branch latest_tag https://github.com/zkVerify/compose-zkverify-simplified.git
或直接下载 压缩包 并解压。
Recommendation: use the latest tag
建议使用最新 tag 运行最新软件,可在 releases 查看(如将 latest_tag 替换为具体版本)。
该仓库包含准备环境所需的脚本与资源。
Basic Items
仓库内的 scripts/init.sh 是主要工具,引导收集配置并生成所需文件。
For Windows users
运行 scripts/init.sh 前建议:
- Make sure Docker engine is running (e.g. verifying it from Docker Desktop),
- Make sure you can run
.shscripts on your machine- The suggested option is to install Git
- Then you can just double click on
init.shor use Git Bash tool.
以下是运行节点所需的基础项:
- The Docker image
zkverify/relay-node:- zkVerify 已打包成镜像,跨平台一致运行。
- 推荐 tag 为
latest,或在 DockerHub 选择其他。 - 若本地无镜像,Docker Compose 会自动拉取。
- 也可用
hl-node.Dockerfile自行构建。
- Docker Compose file:
- 通用模板用于启动节点。
- 由
init.sh自动生成。
.envfile:- 节点配置文件,由
init.sh自动生成。
- 节点配置文件,由
- Secret files:
secret_phrase.dat:12 词助记词,用于生成出块/终结所需密钥(仅验证人)。node_key.dat:随机 256 位数,签名 P2P 消息并标识节点(peer-id)。- 均由
init.sh自动生成。