Building a Private Future with snarkOS: Your Guide to Aleo’s Decentralized Operating System
Building a Private Future with snarkOS: Your Guide to Aleo’s Decentralized Operating System
1. Overview
snarkOS is not your typical operating system; it’s a decentralized marvel designed for zero-knowledge applications. This code serves as the backbone of the Aleo network, a groundbreaking platform that verifies transactions and securely stores encrypted state applications in a publicly-verifiable manner.
2. Build Guide
2.1 Requirements
Before you embark on your journey with Aleo, make sure your system meets the minimum requirements:
- Operating System: 64-bit architectures only, updated for security.
- Clients: Ubuntu 22.04 (LTS), macOS Ventura or later, Windows 11 or later.
- Provers: Ubuntu 22.04 (LTS), macOS Ventura or later.
- Validators: Ubuntu 22.04 (LTS).
- CPU: 64-bit architectures only.
- Clients: 16 cores.
- Provers: 32 cores (64 cores preferred).
- Validators: 32 cores (64 cores preferred).
- RAM: DDR4 or better.
- Clients: 16GB of memory.
- Provers: 32GB of memory (64GB or larger preferred).
- Validators: 64GB of memory (128GB or larger preferred).
- Storage: PCIe Gen 3 x4, PCIe Gen 4 x2 NVME SSD, or better.
- Clients: 64GB of disk space.
- Provers: 128GB of disk space.
- Validators: 2TB of disk space (4TB or larger preferred).
- Network: Symmetric, commercial, always-on.
- Clients: 100Mbps of upload and download bandwidth.
- Provers: 250Mbps of upload and download bandwidth.
- Validators: 500Mbps of upload and download bandwidth.
- GPU:
- Clients: Not required at this time.
- Provers: CUDA-enabled GPU (optional).
- Validators: Not required at this time.
Please note that running a competitive Aleo Prover may require higher specifications than the minimum requirements mentioned.
2.2 Installation
To begin your Aleo journey, ensure you have Rust v1.66+ installed on your machine. You can find installation instructions here.
- Clone the snarkOS repository with this command:
git clone https://github.com/AleoHQ/snarkOS.git --depth 1
2. Move into the snarkOS directory:
cd snarkOS
3. For Ubuntu users, a convenient script to install dependencies is available. Run it from the snarkOS directory:
./build_ubuntu.sh
4. Finally, install snarkOS:
cargo install --path .
Make sure to open ports 4133/tcp and 3033/tcp on your router and OS firewall.
3. Run an Aleo Node
3a. Run an Aleo Client
Start by following the Build Guide instructions. Then, to launch a client node, use the following command from the snarkOS directory:
./run-client.sh
3b. Run an Aleo Prover
Begin by following the Build Guide instructions. Next, generate an Aleo account address:
snarkos account new
This command will display a new Aleo account in the terminal. Remember to save the account’s private key and view key for future use.
To initiate a proving node, run this command from the snarkOS directory:
./run-prover.sh
When prompted, enter your Aleo private key.
4. FAQs
1. My node is unable to compile.
- Ensure your machine has Rust v1.66+ installed (installation guide here).
- If large errors appear during compilation, try running
cargo clean
. - Make sure snarkOS is started using
./run-client.sh
or./run-prover.sh
.
2. My node is unable to connect to peers on the network.
- Ensure that ports 4133/tcp and 3033/tcp are open on your router and OS firewall.
- Confirm that snarkOS is started using
./run-client.sh
or./run-prover.sh
.
3. I can’t generate a new address.
- Before running the
snarkos account new
command, try sourcing~/.bashrc
. - Double-check the spelling of
snarkos
. Note that the directory is/snarkOS
, and the command issnarkos
.
5. Command Line Interface (CLI)
For advanced users looking to customize node settings, refer to the full list of options and flags available in the snarkOS CLI. You can view the full list of CLI flags and options with:
snarkos --help
6. Development Guide
6.1 Quick Start
To kickstart your development journey, follow these steps:
- In the first terminal, start the first validator:
cargo run --release -- start --nodisplay --dev 0 --validator
2. In the second terminal, start the second validator:
cargo run --release -- start --nodisplay --dev 1 --validator
3. In the third terminal, start the third validator:
cargo run --release -- start --nodisplay --dev 2 --validator
4. In the fourth terminal, start the fourth validator:
cargo run --release -- start --nodisplay --dev 3 --validator
You can extend this procedure to launch provers and clients as needed.
6.2 Operations
Initializing nodes sequentially is crucial. To initialize a node, use one of these options (replace <NODE_ID>
with a number starting from 0):
- Validator:
cargo run --release -- start --nodisplay --dev <NODE_ID> --validator
- Prover:
cargo run --release -- start --nodisplay --dev <NODE_ID> --prover
- Client (default if no type specified):
cargo run --release -- start --nodisplay --dev <NODE_ID> --client
- Clean up node storage with:
cargo run --release -- clean --dev <NODE_ID>
Explore the world of Aleo and snarkOS, where privacy meets innovation and decentralization!
For any further assistance, feel free to contact The Aleo Team at hello@aleo.org.