Server requirements
Minimum (VDS/DS):
16 CPU, 16 GB RAM, 128 GB SSD, Ubuntu 20.04
Recommended (VDS/DS):
32 CPU, 32 GB RAM, 128 GB SSD, Ubuntu 20.04
You can also use GPU for increased farming soon.
Installation
Update packages
sudo apt update && sudo apt upgrade -y
Install required packages
sudo apt install wget jq git build-essential pkg-config libssl-dev -y
Instal Rust
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/installers/rust.sh)
Rust version must be at least1.65.0
rustc --version
If not, then uninstall with the command below and install again
. < ( wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/installers/rust.sh ) \
-un
Clone the repository with the node
cd; git clone https://github.com/AleoHQ/snarkOS.git --depth 1
Go to the folder with snarkOS
cd snarkOS
Build the snarkOS binary
cargo build --release
Copy the binary file to the standard binary storage
mv $HOME/snarkOS/target/release/snarkos /usr/bin
Already have a wallet
Place a file called aleo_account.txt
, necessarily containing the string
Private key APrivateKey1___
On the path (the command displays the path)
echo $HOME/aleo_account.txt
No wallet yet
Create a wallet
snarkos account new > $HOME/aleo_account.txt
Make a backup copy of the wallet data file, saving it in a safe place (the command displays the path)
echo $HOME/aleo_account.txt
Do not show private key to anyone
Continuation
Add the wallet address to the system as a variable
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n aleo_wallet_address -v `grep -oPm1 "(?<=Address )([^%]+)(?=$)" $HOME/aleo_account.txt`
Add the private key of the wallet to the system as a variable
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n aleo_private_key -v `grep -oPm1 "(?<=Private Key )([^%]+)(?=$)" $HOME/aleo_account.txt`
Check adding variables to the system
echo $aleo_wallet_address $aleo_private_key
If one of them is missing, then they will return to the step with working with the wallet .
Open used ports
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/ports_opening.sh) 3033 4133
Create service file
printf "[Unit]
Description=Aleo Prover
After=network-online.target
[Service]
User=$USER
ExecStart=`which snarkos` start --nodisplay --prover $aleo_private_key
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/aleod.service
Run service file
sudo systemctl daemon-reload
sudo systemctl enable aleod
sudo systemctl restart aleod
Add a command to view the node log to the system as a variable
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n aleo_log -v "sudo journalctl -fn 100 -u aleod" -a
Make sure the node is running
aleo_log
Update
Manual
If the GitHub repository with the node (folder snarkOS) is not downloaded, then clone it
cd; git clone https://github.com/AleoHQ/snarkOS.git --depth 1
Update binaries
cd $HOME/snarkOS && \
git stash; \
git pull; \
cargo clean; \
cargo build --release; \
mv $HOME/snarkOS/target/release/snarkos /usr/bin; \
cd
Restart service file
sudo systemctl restart aleod
Removal
Don't stop
sudo systemctl stop aleod
Delete service file
sudo systemctl disable aleod
rm -rf /etc/systemd/system/aleod.service
sudo systemctl daemon-reload
Delete the project folder and the binary file
rm -rf $HOME/snarkOS /usr/bin/snarkos
Useful Commands
Available variables (remove echo when using)
echo $aleo_wallet_address
echo $aleo_private_key
View log
Prover
aleo_log sudo journalctl -fn 100 -u aleod
Automatic update script
sudo journalctl -fn 100 -u aleou
Restart the node
sudo systemctl restart aleod
Stop auto update script
sudo systemctl stop aleou
Top comments (0)