Skip to main content

Install from Source

1. Server preparation

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip pkg-config libssl-dev -y

2. Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

3. Binary and config

cd $HOME && git clone https://github.com/quantachain/quanta.git
cd quanta && git pull
grep '^version' Cargo.toml
cargo build --release

4. Set mode and peers

sed -i -e 's/^mode = .*/mode = "pruned"/' -e 's|^bootstrap_nodes = .*|bootstrap_nodes = ["34.87.128.33:8333"]|' quanta.toml

Check mode and peers:

grep -E '^(mode|bootstrap_nodes)' quanta.toml

5. Generate Your Validator Wallet

./target/release/quanta-wallet new-raw --file validator.qua
caution

Backup validator.qua and your password immediately.

6. Export Your Genesis Validator JSON

./target/release/quanta-wallet export-validator \
--wallet validator.qua \
--out validator.json

7. Check your wallet

cd $HOME/quanta && ./target/release/quanta-wallet info  --file validator.qua

7.1 Stake

./target/release/quanta-wallet stake --wallet validator.qua --amount 100000

8. Create service file

sudo bash -c 'mkdir -p /etc/quanta && cat >/etc/quanta/quanta.env <<EOF
QUANTA_WALLET_PASSWORD=your_pass_wallet
EOF

cat >/etc/systemd/system/quanta-validator.service <<EOF
[Unit]
Description=Quanta Validator
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/root/quanta

EnvironmentFile=/etc/quanta/quanta.env

ExecStart=/root/quanta/target/release/quanta start --validator-wallet /root/quanta/validator.qua

Restart=always
RestartSec=5
LimitNOFILE=65535

StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
EOF

chmod 600 /etc/quanta/quanta.env
systemctl daemon-reload
systemctl enable quanta-validator'

9. Pass Config

Change your_pass_wallet

nano /etc/quanta/quanta.env

10. Start node

systemctl start quanta-validator
systemctl status quanta-validator

11. Check logs

sudo journalctl -fu quanta-validator -o cat

12. Back Up Your Validator Wallet

Download and securely store the validator.qua file.

13. Delete Node

sudo systemctl stop quanta-validator
sudo systemctl disable quanta-validator
sudo systemctl daemon-reload
rm -rf /etc/systemd/system/quanta-validator.service
rm -rf $HOME/quanta