snarkOS是一个用于零知识应用程序的去中心化操作系统。此代码构成了 Aleo 网络的骨干,该网络以可公开验证的方式验证交易并存储加密状态应用程序。
以下是运行 Aleo 节点的最低要求:
请注意,要运行具有竞争力的 Aleo 证明器,机器需要的不仅仅是这些要求。
在开始之前,请确保你的机器已安装。安装 Rust 的说明可以在这里找到。
Rust v1.65+
首先克隆这个 Github 存储库:
git clone https://github.com/AleoHQ/snarkOS.git --depth 1
接下来,进入目录:
snarkOS
cd snarkOS
[对于 Ubuntu 用户]可以使用用于安装依赖项的帮助程序脚本。从目录中,运行:
snarkOS
./build_ubuntu.sh
最后,安装:
snarkOS
cargo install --path .
首先按照构建指南中的说明进行操作。
接下来,要从目录中启动客户机节点,请运行:
snarkOS
./run-client.sh
首先按照构建指南中的说明进行操作。
接下来,生成一个 Aleo 帐户地址:
snarkos account new
这将在终端中输出一个新的 Aleo 帐户。
请记得保存账号私钥和查看密钥。下面是一个示例输出:
Attention - Remember to store this account private key and view key. Private Key APrivateKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <-- Save Me And Use In The Next Step View Key AViewKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <-- Save Me Address aleo1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <-- Save Me
接下来,要从目录中启动证明节点,请运行:
snarkOS
./run-prover.sh
出现提示时,输入你的 Aleo 私钥:
Enter the Aleo Prover account private key: APrivateKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rust v1.65+
cargo clean
snarkOS
./run-client.sh
./run-prover.sh
4133/tcp
3033/tcp
snarkOS
./run-client.sh
./run-prover.sh
snarkos account new
source ~/.bashrc
snarkos
/snarkOS
snarkos
要使用自定义设置运行节点,请参阅 CLI 中可用的选项和标志的完整列表。
snarkOS
CLI 标志和选项的完整列表可以通过以下方式查看:
snarkos --help
snarkOS The Aleo Team <hello@aleo.org> USAGE: snarkos [OPTIONS] <SUBCOMMAND> OPTIONS: -h, --help Print help information -v, --verbosity <VERBOSITY> Specify the verbosity [options: 0, 1, 2, 3] [default: 2] SUBCOMMANDS: account Commands to manage Aleo accounts clean Cleans the snarkOS node storage help Print this message or the help of the given subcommand(s) start Starts the snarkOS node update Update snarkOS
以下是该命令的选项:
snarkos start
snarkos-start Starts the snarkOS node USAGE: snarkos start [OPTIONS] OPTIONS: --beacon <BEACON> Specify this as a beacon, with the given account private key for this node --client <CLIENT> Specify this as a client, with an optional account private key for this node --connect <CONNECT> Specify the IP address and port of a peer to connect to [default: ] --dev <DEV> Enables development mode, specify a unique ID for this node -h, --help Print help information --logfile <LOGFILE> Specify the path to the file where logs will be stored [default: /tmp/snarkos.log] --network <NETWORK> Specify the network of this node [default: 3] --node <NODE> Specify the IP address and port for the node server [default: 0.0.0.0:4133] --nodisplay If the flag is set, the node will not render the display --norest If the flag is set, the node will not initialize the REST server --prover <PROVER> Specify this as a prover, with the given account private key for this node --rest <REST> Specify the IP address and port for the REST server [default: 0.0.0.0:3033] --validator <VALIDATOR> Specify this as a validator, with the given account private key for this node --verbosity <VERBOSITY> Specify the verbosity of the node [options: 0, 1, 2, 3] [default: 2]
在一个终端中, 通过运行以下命令启动信标:
cargo run --release -- start --nodisplay --dev 0 --beacon ""
在第二个终端中,运行:
cargo run --release -- start --nodisplay --dev 1 --prover ""
可以重复此过程以启动更多节点。
对于每个新节点,初始化从 开始并递增的节点非常重要。
0
1
以下是初始化节点的选项列表(替换为以 开头的数字):
XX
0
cargo run --release -- start --nodisplay --dev XX --beacon "" cargo run --release -- start --nodisplay --dev XX --validator "" cargo run --release -- start --nodisplay --dev XX --prover "" cargo run --release -- start --nodisplay --dev XX --client "" cargo run --release -- start --nodisplay --dev XX
如果未指定节点类型,则节点将默认为 。
--client
要清理节点存储,请运行:
cargo run --release -- clean --dev XX
我们欢迎所有对 的贡献。有关贡献条款,请参阅许可证。
snarkOS