snarkOS compatibility: running Aleo’s operating system on your platform
snarkOS, the decentralized operating system for zero-knowledge applications, forms the backbone of the Aleo network. It validates transactions and securely stores encrypted state applications in a publicly-verifiable manner.
Advantages of Aleo’s snarkOS:
- Privacy-first approach: snarkOS is designed with a strong emphasis on privacy, leveraging zk proofs to facilitate private transactions and data handling.
- Cost-effective operation: the system introduces cost-effectiveness by enabling off-chain packaging of information, resulting in reduced network or “gas” fees for users.
- Participatory economics: snarkOS incentivizes users with Aleo credits, fostering a participatory economic model. Users contribute to network security and earn rewards through staking, proof generation, and transaction validation.
- Security with zk proofs: enhanced security is achieved by incorporating zk proofs, ensuring the privacy and integrity of user data while benefiting from the security of AleoBFT.
Build guide
1. Requirements. Ensure your system meets the minimum requirements to run an Aleo node, including OS, CPU, RAM, storage, and network specifications. Prover machines demand higher specs.
2. Installation
- Install Rust v1.66+ on your machine.
- Clone the snarkOS Github repository:
git clone https://github.com/AleoHQ/snarkOS.git --depth 1
3. Move into the snarkOS directory:
cd snarkOS
4. For Ubuntu users, run the helper script to install dependencies:
./build_ubuntu.sh
5. Install snarkOS:
cargo install --path .
6. Ensure ports 4133/tcp and 3033/tcp are open on your router and OS firewall.
3. Run an Aleo Node
Run an Aleo client:
- Follow the Build guide instructions.
2. To start a client node, run:
./run-client.sh
Run an Aleo prover:
- Follow the Build Guide instructions.
- Generate an Aleo account address:
snarkos account new
3. Save the generated private key, view key, and address.
Private Key APrivateKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <-- Save Me And Use In The Next Step
View Key AViewKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <-- Save Me
Address aleo1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <-- Save Me
4. Start the proving node:
./run-prover.sh
5. Enter your Aleo private key when prompted.
Enter the Aleo Prover account private key:
APrivateKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Possible issues:
- Node Compilation Issues:
- Ensure Rust v1.66+ is installed.
- Try running
cargo clean
if errors persist. - Start snarkOS with
./run-client.sh
or./run-prover.sh
.
2. Node Connectivity Problems:
- Open ports 4133/tcp and 3033/tcp on your router and firewall.
- Start snarkOS with
./run-client.sh
or./run-prover.sh
.
3. Address Generation Problems:
- Run
source ~/.bashrc
beforesnarkos account new
. - Double-check the spelling of
snarkos
.
4. Command Line Interface
Explore the comprehensive list of options and flags available in the snarkOS CLI using:
snarkos --help
5. Development guide
Quick start. Initialize validators with:
cargo run --release -- start --nodisplay --dev <NODE_ID> --validator
Further, start up provers and clients using the same procedure.
Operations: Initialize nodes starting from 0, incrementing by 1 for each new node:
cargo run --release -- start --nodisplay --dev <NODE_ID> --validator
cargo run --release -- start --nodisplay --dev <NODE_ID> --prover
cargo run --release -- start --nodisplay --dev <NODE_ID> --client
cargo run --release -- start --nodisplay --dev <NODE_ID>
Local Devnet
1. Install tmux
Install tmux to run a local devnet.
2. Start a local Devnet
Run:
./devnet.sh
Follow the terminal instructions.
3. View a local Devnet
Switch Nodes (forward):
Ctrl+b n
Switch Nodes (backwards):
Ctrl+b p
Select a Node:
Ctrl+b w
Select a Node (manually):
Ctrl+b :select-window -t {NODE_ID}
4. Stop a local Devnet
Stop:
Ctrl+b :kill-session
Press Enter.
Clean Up: to clean up the node storage, run:
cargo run --release -- clean --dev <NODE_ID>
Uncover the potential of Aleo snarkOS and revolutionize your approach to zk apps! 🚀
Read more:
Prepared by Colliseum