Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HW requirements, node start commands, and node shell scripts #2

Closed
wants to merge 107 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
5675515
Make REST server port configurable and optional in dev mode
christianwwwwwwww Apr 17, 2024
99f1517
use direct Option type in rest ip parsing
christianwwwwwwww Apr 17, 2024
5ce9cfe
update tests to handle rest config as Option
christianwwwwwwww Apr 17, 2024
bae6b98
update clap test to verify option rest ip
christianwwwwwwww Apr 17, 2024
7653bfd
syntax fix
christianwwwwwwww Apr 17, 2024
91f4ac7
ensure default rest ip
christianwwwwwwww Apr 18, 2024
746228e
add unit tests
christianwwwwwwww Apr 18, 2024
cd1fafe
test no rest flag
christianwwwwwwww Apr 29, 2024
6ce9e3a
reconfigure unit tests
christianwwwwwwww Apr 30, 2024
f83f52a
Fix node start not respecting --bft unless in dev mode
Meshiest May 24, 2024
3b1ca16
Update header image link
zosorock May 24, 2024
7192fef
hw specs and script start command
kpandl May 24, 2024
80f722b
Update README.md
kpandl Jun 3, 2024
2b0a2fb
Update README.md
kpandl Jun 3, 2024
a225af1
Update README.md
kpandl Jun 3, 2024
e0ec38a
Update README.md
kpandl Jun 3, 2024
4397f14
Update README.md
kpandl Jun 3, 2024
a615c7c
Update README.md
kpandl Jun 3, 2024
49c4d74
Update README.md
kpandl Jun 3, 2024
e22a75d
Apply suggestions from code review
kpandl Jun 3, 2024
723b541
fix typo and core client script
kpandl Jun 3, 2024
1053924
update validator machine checks
kpandl Jun 5, 2024
767944d
Revert "Revert "Merge pull request #3257 from AleoNet/feat/bound-requ…
vicsn Jun 5, 2024
efc5d91
Merge --rest and --node changes from #3221 per @vicsn's request: http…
Meshiest Jun 5, 2024
acc9405
GiB instead of GB for RAM
kpandl Jun 6, 2024
a563f1e
update min RAM in GiB
kpandl Jun 6, 2024
a4c905e
fix: block sync on big blocks
joske May 31, 2024
f5d8ddb
fix: async handling for BlockRequest and BlockResponse
joske Jun 3, 2024
7158a9f
feat: update the last_seen on every message
joske Jun 4, 2024
ffa664b
chore: update lock file
joske May 31, 2024
45428df
fix: review comment
joske Jun 4, 2024
060c7e3
fix: remove obsolete block requests
joske May 29, 2024
e2595c4
Revert "Revert "Merge pull request #3266 from AleoNet/optimize/clear-…
vicsn Jun 6, 2024
1dbcd48
Revert "Revert "Merge pull request #3262 from AleoNet/update/devnet-s…
vicsn Jun 6, 2024
431bbc2
Revert "Revert "Merge pull request #3256 from AleoNet/fix/is-syncing-…
vicsn Jun 6, 2024
8d86453
Update snarkVM rev to a122c73 for the restrictions list feature
howardwu Jun 6, 2024
c5b5c7a
Revert "Revert "Merge pull request #3253 from niklaslong/perf/rest""
vicsn Jun 7, 2024
29ed225
Adds a restrictions ID check into handshake protocols
howardwu Jun 8, 2024
3603f9c
WIP
d0cd Jun 8, 2024
c46e7e4
Remove incomplete new unit test
vicsn Jun 8, 2024
5a7677c
Update new Solution API in test
vicsn Jun 7, 2024
67238c6
Update tests to take into account new request redundancy
vicsn Jun 8, 2024
e266827
Revert "Revert "Merge pull request #3254 from niklaslong/fix/cache""
vicsn Jun 8, 2024
686ead1
Merge remote-tracking branch 'hq/feat/optional-rest-ip' into fix-bft-…
Meshiest Jun 8, 2024
1b5e740
Update handshake.rs
howardwu Jun 8, 2024
b530cbd
Fix and cleanup
d0cd Jun 9, 2024
696407c
Cleanup
d0cd Jun 10, 2024
3fec1d8
Cleanup error
d0cd Jun 10, 2024
579507e
Hotfix: add default restrictions id to tests
vicsn Jun 10, 2024
5e4235f
Fix tests
vicsn Jun 10, 2024
0774ee1
Update gitignore
d0cd Jun 10, 2024
1491411
Update CircleCI resource classes
zosorock Jun 10, 2024
ff10008
Merge pull request #3308 from zosorock/upd/ci
zosorock Jun 10, 2024
372f8cd
Merge pull request #3295 from ProvableHQ/fix/is-syncing-check
zosorock Jun 11, 2024
0d903fe
Merge pull request #3298 from ProvableHQ/perf/rest
zosorock Jun 11, 2024
e0aff72
Merge pull request #3300 from ProvableHQ/update_test_for_solution_api…
zosorock Jun 11, 2024
ef5307c
Merge pull request #3301 from ProvableHQ/feat/bound-requests
zosorock Jun 11, 2024
b0335f6
Merge pull request #3302 from ProvableHQ/optimize/clear-solutions
zosorock Jun 11, 2024
c3078a1
Merge pull request #3296 from ProvableHQ/update/devnet-scripts
zosorock Jun 11, 2024
23abf12
Merge pull request #3303 from ProvableHQ/fix/sync-cleanup
zosorock Jun 11, 2024
db28e57
Merge pull request #3304 from ProvableHQ/fix/big-block-deser
zosorock Jun 11, 2024
6fc8cd2
Merge pull request #3305 from ProvableHQ/fix/cache
zosorock Jun 11, 2024
2891dae
Merge pull request #3306 from ProvableHQ/feat/restrictions-list
zosorock Jun 11, 2024
cd73c74
Merge pull request #3271 from monadicus/fix-bft-bind
zosorock Jun 11, 2024
3ed6ec6
Update snarkVM rev to latest AleoNet/mainnet-staging
vicsn Jun 11, 2024
523899c
Remove newly introduced broken and incomplete test
vicsn Jun 11, 2024
d7f0951
Merge remote-tracking branch 'foundation/mainnet-staging' into feat/l…
d0cd Jun 11, 2024
60a3364
Update dep
d0cd Jun 12, 2024
e17d1a8
Remove history from devnet script
d0cd Jun 12, 2024
5e1524d
Update snarkVM rev
vicsn Jun 12, 2024
cf83035
Merge pull request #3309 from ProvableHQ/fix_tests
zosorock Jun 12, 2024
d03ba82
Use updates
d0cd Jun 13, 2024
fdb8fbe
Update rev
d0cd Jun 13, 2024
18adb8c
Update rev
d0cd Jun 14, 2024
059ec2a
Update Cargo.lock
d0cd Jun 14, 2024
96c8433
Merge remote-tracking branch 'foundation/mainnet-staging' into feat/l…
d0cd Jun 14, 2024
505601a
fix(tcp): fix outbound tcp requests not respecting --node
Meshiest Jun 15, 2024
115d0f5
CI resource class changes
zosorock Jun 17, 2024
5d095ed
resource adjustments
zosorock Jun 17, 2024
c4d725f
Merge pull request #3310 from ProvableHQ/feat/log-credits-mappings
apruden2008 Jun 17, 2024
5e9b0f1
image url update and ci fix
zosorock Jun 17, 2024
3b231e1
CI resource adjustment
zosorock Jun 18, 2024
67b11b4
fix(sync): fix client sync mutex deadlock and client block request stall
Meshiest Jun 19, 2024
fea092c
Merge pull request #3321 from monadicus/fix-client-stall
zosorock Jun 21, 2024
5d4de02
Merge pull request #3318 from monadicus/fix-tcp-connect-bind
zosorock Jun 21, 2024
b66d41e
mediumnize all of them!
zosorock Jun 21, 2024
1dcda54
updating links
zosorock Jun 22, 2024
2e551cf
resizing resources
zosorock Jun 22, 2024
5c7c900
Merge branch 'mainnet-staging' into fix/readme-header-img
zosorock Jun 22, 2024
47cf2b5
fine-tune resource class
zosorock Jun 22, 2024
3978495
resource adjustment
zosorock Jun 23, 2024
dab8a07
modify runner
zosorock Jun 23, 2024
2830993
Merge pull request #3323 from AleoNet/fix/readme-header-img
zosorock Jun 23, 2024
44ae011
snarkVM rev bump for Canary v0.3.0 release
zosorock Jun 23, 2024
09aa62b
Merge pull request #3325 from AleoNet/canary/v0.3.0
zosorock Jun 23, 2024
3579199
Fix
d0cd Jun 24, 2024
94318f5
Use large resource for node-router CI
d0cd Jun 24, 2024
1a5a2d5
bump snarkVM rev to d170a9f
zosorock Jun 26, 2024
bd45fc7
Merge pull request #3333 from zosorock/testnet-beta/v0.3.0
zosorock Jun 26, 2024
2fc1eb5
Merge remote-tracking branch 'aleonet/mainnet-staging' into fix/snark…
vicsn Jun 26, 2024
878624d
Merge pull request #3329 from ProvableHQ/fix/snarkvm-history-rev
zosorock Jun 26, 2024
7ea2222
update README formatting
kpandl Jul 1, 2024
a72232b
fix typo
kpandl Jul 1, 2024
197cfb1
update README - add or larger preferred
kpandl Jul 1, 2024
988f8ec
validators as peers
kpandl Jul 5, 2024
4a1b4e6
double quotes
kpandl Jul 5, 2024
b183b26
Merge branch 'mainnet-staging' into mainnet-staging
kpandl Jul 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 81 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,37 @@ which verifies transactions and stores the encrypted state applications in a pub

## 2. Build Guide

### 2.1 Requirements
### 2.1 Definitions

The following are **minimum** requirements to run an Aleo node:
The following snarkOS node types exist in the Aleo network:
- **Validator**: Validator nodes participate in consensus and must be started with an account that is bonded into the committee.
- **Client**: Clients do not participate in consensus but maintain a ledger. They are capable of providing information about the network as well as accepting solutions and transactions and communicating them to their peers. All clients run the same software, however, for the purposes of configuration management, this document defines two types of clients:
- Core Client: Client node connected directly to a validator node.
- Outer Client: Client node connected only to other clients or prover nodes.
- **Prover**: Prover nodes are dedicated to solving the Aleo puzzle. They do not participate in consensus or maintain a copy of the ledger.

### 2.2 Requirements

The following are the requirements to run an Aleo node:
- **OS**: 64-bit architectures only, latest up-to-date 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)
- **CPU**: 64-bit architectures only, Latest Intel Xeon or Better
- Clients: 24-cores (32-cores or larger preferred)
- Validators: 64-cores (128-cores or larger 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)
- Clients: 128GiB of memory (192GiB or larger preferred)
- Validators: 256GiB of memory (384GiB 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)
- Clients: 2TB of disk space (4TB or larger preferred)
- Validators: 4TB of disk space (6TB or larger preferred)
- **Network**: Symmetric, commercial, always-on
- Clients: 100Mbps of upload **and** download bandwidth
- Provers: 250Mbps of upload **and** download bandwidth
- Clients: 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 in order to run an Aleo Prover that is **competitive**, the machine will need more than these requirements.
No explicit recommendations are made for proving nodes as proving hardware may be highly variable. If interested in running Aleo Provers nodes, please refer to resources published by the Aleo community.

### 2.2 Installation
### 2.3 Installation

Before beginning, please ensure your machine has `Rust v1.66+` installed. Instructions to [install Rust can be found here.](https://www.rust-lang.org/tools/install)

Expand All @@ -93,19 +93,76 @@ cargo install --locked --path .
```

Please ensure ports `4130/tcp` and `3030/tcp` are open on your router and OS firewall.
### 2.4 Port Configuration

#### 2.4.1 For Core Clients

| Port | Protocol | Allow/Deny | Source | Explanation |
|----------|----------|------------|------------------------------|------------------------------------------------------------|
| 4130/tcp | TCP | Allow | All IPv4/IPv6 | TCP traffic to peers |

#### 2.4.2 For Outer Clients

| Port | Protocol | Allow/Deny | Source | Explanation |
|----------|----------|------------|------------------------------|------------------------------------------------------------|
| 3030/tcp | TCP | Allow | All IPv4/IPv6 | REST server |
| 4130/tcp | TCP | Allow | All IPv4/IPv6 | TCP traffic to peers |

#### 2.4.3 For Validators

| Port | Protocol | Allow/Deny | Source | Explanation |
|----------|----------|------------|------------------------------|------------------------------------------------------------|
| 4130/tcp | TCP | Allow | All IPv4/IPv6 | TCP traffic to peers |
| 5000/tcp | TCP | Allow | Trusted Validator IPs | TCP traffic between validators for BFT communication |
| 3000/tcp | TCP | Allow | Internal VPC or VPN | Metrics dashboard, should only be open within an internal VPC or VPN |
| 3030/tcp | TCP | Deny | All IPv4/IPv6 | REST server. This should **always** be disabled for validators |
| 9000/tcp | TCP | Allow | Internal VPC or VPN | Metrics export, should only be open within an internal VPC or VPN |
| 9090/tcp | TCP | Allow | Internal VPC or VPN | Prometheus metrics, should only be open within an internal VPC or VPN |

## 3. Run an Aleo Node

## 3.1 Run an Aleo Client

Start by following the instructions in the [Build Guide](#2-build-guide).
The guide below provides information on running `core` and `outer` clients (as defined in Section 2.2.) Aleo community members running validators are recommended to run 1-3 `core` clients as their exclusive peers. This will ensure network traffic from the public internet is verified prior to reaching the validator.

Any client **not** connected directly to a validator can be considered an `outer` client.

### 3.1.1 Run an Aleo Core Client

The following command is recommended when starting a client node that is connected to a validator:
`snarkos start --client --nodisplay --node 0.0.0.0:4130 --peers “validator_ip:4130,core_client_ip_1:4130,core_client_ip_2:4130,core_client_ip3:4130,outer_client_ip_1:4130,...” --verbosity 1 --norest`

To start a core client node, you can also run the following command from the `snarkOS` directory:
```
./run-core-client.sh
```

### 3.1.2 Run an Aleo Outer Client

The following command is recommended when starting a client node that is NOT connected to a validator:
`snarkos start --client --nodisplay --node 0.0.0.0:4130 --peers “core_client_ip_1:4130,core_client_ip_2:4130,core_client_ip3:4130,outer_client_ip_1:4130,...” --verbosity 1 --rest 0.0.0.0:3030`

To start an outer client node, you can also run the following command from the `snarkOS` directory:
```
./run-outer-client.sh
```

## 3.2 Run an Aleo Validator

Start by following the instructions in the [Build Guide](#2-build-guide).

The following command is recommended when starting a validator node:
`snarkos start --validator --nodisplay --bft 0.0.0.0:5000 --node 0.0.0.0:4130 --peers “core_client_ip_1:4130,core_client_ip_2:4130,...” --validators “validator_ip_1:5000,validator_ip_2:5000,...” --verbosity 1 --norest --private-key-file ~/snarkOS/privatekey`

Instead of specifying a private key file (`--private-key-file` flag), the private key can also be defined explicitly (`--private-key` flag).

Next, to start a client node, from the `snarkOS` directory, run:
To start a validator, you can also run the following command from the `snarkOS` directory:
```
./run-client.sh
./run-validator.sh
```

## 3.2 Run an Aleo Prover
## 3.3 Run an Aleo Prover

Start by following the instructions in the [Build Guide](#2-build-guide).

Expand Down
4 changes: 2 additions & 2 deletions cli/src/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ pub(crate) fn check_validator_machine(node_type: NodeType) {
// Retrieve the number of cores.
let num_cores = num_cpus::get();
// Enforce the minimum number of cores.
let min_num_cores = 32;
let min_num_cores = 64;
if num_cores < min_num_cores {
let message = format!("⚠️ The number of cores ({num_cores} cores) on this machine is insufficient for a validator (minimum {min_num_cores} cores)\n");
println!("{}", message.yellow().bold());
}
// Enforce the minimum amount of RAM.
if let Ok(ram) = crate::helpers::detect_ram_memory() {
let min_ram = 60;
let min_ram = 256;
if ram < min_ram {
let message = format!("⚠️ The amount of RAM ({ram} GiB) on this machine is insufficient for a validator (minimum {min_ram} GiB)\n");
println!("{}", message.yellow().bold());
Expand Down
40 changes: 0 additions & 40 deletions run-client.sh

This file was deleted.

48 changes: 48 additions & 0 deletions run-core-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# USAGE examples:
# CLI with env vars: PEERS=“validator_ip:4130,core_client_ip_1:4130,core_client_ip_2:4130,core_client_ip_3:4130,outer_client_ip_1:4130,... ./run-core-client.sh
# CLI with prompts for vars: ./run-core-client.sh

# If the env var PEERS is not set, prompt for it
if [ -z "${PEERS}" ]
then
read -r -p "Enter the peers (comma-separated) (e.g., “validator_ip:4130,core_client_ip_1:4130,core_client_ip_2:4130,core_client_ip_3:4130,outer_client_ip_1:4130,...): "
PEERS=$REPLY
fi

if [ "${PEERS}" == "" ]
then
echo "Missing peers."
exit 1
fi

COMMAND='cargo run --release -- start --nodisplay --client --node 0.0.0.0:4130 --peers ${PEERS} --verbosity 1 --norest'

for word in $*;
do
COMMAND="${COMMAND} ${word}"
done

function exit_node()
{
echo "Exiting..."
kill $!
exit
}

trap exit_node SIGINT

echo "Checking for updates..."
git stash
rm Cargo.lock
STATUS=$(git pull)

if [ "$STATUS" != "Already up to date." ]; then
echo "Updated code found, cleaning the project"
cargo clean
fi

echo "Running an Aleo Core Client node..."
$COMMAND &
wait
48 changes: 48 additions & 0 deletions run-outer-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# USAGE examples:
# CLI with env vars: PEERS=core_client_ip_1:4130,core_client_ip_2:4130,core_client_ip_3:4130,outer_client_ip_1:4130,... ./run-outer-client.sh
# CLI with prompts for vars: ./run-outer-client.sh

# If the env var PEERS is not set, prompt for it
if [ -z "${PEERS}" ]
then
read -r -p "Enter the peers (comma-separated) (e.g., core_client_ip_1:4130,core_client_ip_2:4130,core_client_ip_3:4130,outer_client_ip_1:4130,...): "
PEERS=$REPLY
fi

if [ "${PEERS}" == "" ]
then
echo "Missing peers."
exit 1
fi

COMMAND='cargo run --release -- start --nodisplay --client --node 0.0.0.0:4130 --peers ${PEERS} --verbosity 1 --rest 0.0.0.0:3030'

for word in $*;
do
COMMAND="${COMMAND} ${word}"
done

function exit_node()
{
echo "Exiting..."
kill $!
exit
}

trap exit_node SIGINT

echo "Checking for updates..."
git stash
rm Cargo.lock
STATUS=$(git pull)

if [ "$STATUS" != "Already up to date." ]; then
echo "Updated code found, cleaning the project"
cargo clean
fi

echo "Running an Aleo Outer Client node..."
$COMMAND &
wait
25 changes: 10 additions & 15 deletions run-prover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,15 @@ function exit_node()

trap exit_node SIGINT

echo "Running an Aleo Prover node..."
$COMMAND &

while :
do
echo "Checking for updates..."
git stash
STATUS=$(git pull)
echo "Checking for updates..."
git stash
STATUS=$(git pull)

if [ "$STATUS" != "Already up to date." ]; then
echo "Updated code found, rebuilding and relaunching prover"
cargo clean
kill -INT $!; sleep 2; $COMMAND &
fi
if [ "$STATUS" != "Already up to date." ]; then
echo "Updated code found, cleaning the project"
cargo clean
fi

sleep 1800;
done
echo "Running an Aleo Prover node..."
$COMMAND &
wait
Loading