Skip to content

Commit

Permalink
Update snarkOS README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Aug 18, 2020
1 parent 57fef6a commit 1b7ab0e
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 20 deletions.
82 changes: 68 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<a href="https://codecov.io/gh/AleoHQ/snarkOS"><img src="https://codecov.io/gh/AleoHQ/snarkOS/branch/master/graph/badge.svg?token=cck8tS9HpO"/></a>
</p>

__snarkOS__ is a decentralized operating system for private applications.

## <a name='TableofContents'></a>Table of Contents

* [1. Overview](#1-overview)
Expand All @@ -19,7 +17,8 @@ __snarkOS__ is a decentralized operating system for private applications.

## 1. Overview

\[WIP\]
__snarkOS__ is a decentralized operating system for private applications. It forms the backbone of [Aleo](https://aleo.org/) and
enables developers to checkpoint and finalize application state in a publicly-verifiable manner.

## 2. Build Guide

Expand Down Expand Up @@ -71,18 +70,30 @@ This will generate an executable under the `./target/release` directory. To run
./target/release/snarkos
```

### 2.3b Run by Docker
### 2.3b Run with Docker

#### Docker build
```bash
docker build -t snarkos:latest .
(or docker-compose build)
```
or
```bash
docker-compose build
```

#### Docker run
docker run -d -p 4130:4130 --name snarkos snarkos
(or docker-compose up)
``` bash
docker run -d -p 4131:4131 --name snarkos snarkos
```
or
```bash
docker-compose up
```

## 3. Usage Guide

### Connecting to the Aleo network

To start a client node, run:
```
snarkos
Expand All @@ -93,21 +104,64 @@ To start a mining node, run:
snarkos --is-miner
```

#### How to guard RPC endpoints
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.

### 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 <ip> Specify a node ip address to connect to on startup
-i, --ip <ip> Specify the ip of your node
--max-peers <max-peers> Specify the maximum number of peers the node can connect to
--mempool-interval <mempool-interval> Specify the frequency in seconds the node should fetch a sync node's mempool
--min-peers <min-peers> Specify the minimum number of peers the node should connect to
--miner-address <miner-address> Specify the address that will receive miner rewards
--network <network-id> Specify the network id (default = 1) of the node
-d, --path <path> Specify the node's storage path
-p, --port <port> Specify the port the node is run on
--rpc-password <rpc-password> Specify a password for rpc authentication
--rpc-port <rpc-port> Specify the port the json rpc server is run on
--rpc-username <rpc-username> Specify a username for rpc authentication
```
./target/release/snarkOS --rpc-username <Username> --rpc-password <Password>

#### Examples

##### Guard RPC endpoints
```
snarkos --rpc-username <Username> --rpc-password <Password>
```

#### How to manually connect to a peer on the network
##### Manually connect to a peer on the network
```
./target/release/snarkOS --connect "<IP ADDRESS>"
snarkos --connect "<IP ADDRESS>"
```

### Interfacing with a running node
### 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.

By default, snarkOS runs a JSON-RPC server to allow external interfacing with the Aleo network. Additional information can be found [here](aleo/documentation/autogen/testnet/rpc/rpc_server/00_configurations.md)
## 4. Interfacing with a running node

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](rpc/README.md)

## 4. License
## 5. License

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](./LICENSE.md)
2 changes: 1 addition & 1 deletion snarkOS/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub trait CLI {

App::new(Self::NAME)
.about(Self::ABOUT)
.version("0.1.0")
.version("1.0.0")
.settings(&[
AppSettings::ColoredHelp,
// AppSettings::DisableHelpSubcommand,
Expand Down
2 changes: 1 addition & 1 deletion snarkOS/parameters/flag.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Global

pub const NO_JSONRPC: &str = "[no-jsonrpc] --no-jsonrpc 'Run the node without running the json rpc'";
pub const NO_JSONRPC: &str = "[no-jsonrpc] --no-jsonrpc 'Run the node without running the json rpc server'";

pub const IS_BOOTNODE: &str =
"[is-bootnode] --is-bootnode 'Run the node as a bootnode (IP is hard coded in the protocol)'";
Expand Down
8 changes: 4 additions & 4 deletions snarkOS/parameters/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub const PATH: OptionType = (
pub const IP: OptionType = ("[ip] -i --ip=[ip] 'Specify the ip of your node'", &[], &[], &[]);

pub const PORT: OptionType = (
"[port] -p --port=[port] 'Run the node on a specified port'",
"[port] -p --port=[port] 'Specify the port the node is run on'",
&[],
&[],
&[],
Expand All @@ -36,7 +36,7 @@ pub const MINER_ADDRESS: OptionType = (
);

pub const MEMPOOL_INTERVAL: OptionType = (
"[mempool-interval] --mempool-interval=[mempool-interval] 'Specify the frequency in seconds x 10 the node should fetch the mempool from sync node'",
"[mempool-interval] --mempool-interval=[mempool-interval] 'Specify the frequency in seconds the node should fetch a sync node's mempool'",
&[],
&[],
&[],
Expand All @@ -57,14 +57,14 @@ pub const MAX_PEERS: OptionType = (
);

pub const NETWORK: OptionType = (
"[network] --network=[network-id] 'Run the node on a specified network id (default = 0)'",
"[network] --network=[network-id] 'Specify the network id (default = 1) of the node'",
&[],
&[],
&[],
);

pub const RPC_PORT: OptionType = (
"[rpc-port] --rpc-port=[rpc-port] 'Run the rpc server on a specified port'",
"[rpc-port] --rpc-port=[rpc-port] 'Specify the port the json rpc server is run on'",
&["no_jsonrpc"],
&[],
&[],
Expand Down

0 comments on commit 1b7ab0e

Please sign in to comment.