snarkOS

Table of Contents

1. Overview

snarkOS is a decentralized operating system for private applications. It forms the backbone of Aleo and enables applications to verify and store state in a publicly verifiable manner.

2. Build Guide

2.1 Install Rust

We recommend installing Rust using rustup. You can install rustup as follows:

2.2a Build from Crates.io

We recommend installing snarkOS this way. In your terminal, run:

bash cargo install snarkos

Now to use snarkOS, in your terminal, run: bash snarkos

2.2b Build from Source Code

Alternatively, you can install snarkOS by building from the source code as follows:

```bash

Download the source code

git clone https://github.com/AleoHQ/snarkOS cd snarkOS

Build in release mode

$ cargo build --release ```

This will generate an executable under the ./target/release directory. To run snarkOS, run the following command: bash ./target/release/snarkos

2.2c Build with Docker

Docker build

bash docker build -t snarkos:latest . or bash docker-compose build

Docker run

bash docker run -d -p 4131:4131 --name snarkos snarkos or bash docker-compose up

3. Usage Guide

3.1 Connecting to the Aleo network

To start a client node, run: snarkos

To start a mining node, run: snarkos --is-miner

To run a node with custom settings, refer to the full list of options and flags available in the CLI or simply modify the snarkOS configuration file.

3.2 Command Line Interface

Full list of CLI flags and options can be viewed with snarkos --help:

``` snarkOS 1.0.0 Run an Aleo node (include -h for more options)

USAGE: snarkos [FLAGS] [OPTIONS]

FLAGS: -h, --help Prints help information --is-bootnode Run the node as a bootnode (IP is hard coded in the protocol) --is-miner Start mining blocks from this node --no-jsonrpc Run the node without running the json rpc server -q, --quiet Do not show any logging in the console

OPTIONS: --connect Specify a node ip address to connect to on startup -i, --ip Specify the ip of your node --max-peers Specify the maximum number of peers the node can connect to --mempool-interval Specify the frequency in seconds the node should fetch a sync node's mempool --min-peers Specify the minimum number of peers the node should connect to --miner-address Specify the address that will receive miner rewards --network Specify the network id (default = 1) of the node -d, --path Specify the node's storage path -p, --port Specify the port the node is run on --rpc-password Specify a password for rpc authentication --rpc-port Specify the port the json rpc server is run on --rpc-username Specify a username for rpc authentication ```

Examples

Guard RPC endpoints

snarkos --rpc-username <Username> --rpc-password <Password>

Manually connect to a peer on the network

snarkos --connect "<IP ADDRESS>"

3.3 Configuration File

A snarkOS.toml file is generated in the ~/.snarkOS/ directory when the node is initialized for the time. Updating this snarkOS.toml file allows node operators to specify default settings for the node without having to specify additional information in the CLI.

4. JSON-RPC Interface

By default, snarkOS runs a JSON-RPC server to allow external interfacing with the Aleo network. Documentation of the RPC endpoints can be found here

5. Additional Information

For additional information, please refer to the official Aleo documentation page.

6. License

License: GPL v3