Install

Install Dependencies

sudo apt update
sudo apt dist-upgrade -y
sudo apt-get install git build-essential curl file nginx certbot python3-certbot-nginx jq -y

Setup

#Create a directory
sudo mkdir -p viper-network
cd viper-network

#Clone the Vipernet binaries repository
sudo git clone https://github.com/vipernet-xyz/viper-binaries
cd viper-binaries

#Copy binary
chmod +x $VIPER_BINAR
sudo cp $VIPER_BINARY /usr/local/bin/viper

Config

#Create account
viper wallet create-account

#Create a validator
viper servicers create-validator <account_address>

#Faucet token from the channel #🤑|req-tokens at 

#Adding Persistent Peers
echo $(viper util print-configs) | jq '.tendermint_config.P2P.PersistentPeers = "859674aa64c0ee20ebce8a50e69390698750a65f@mynode1.testnet.vipernet.xyz:26656,eec6c84a7ededa6ee2fa25e3da3ff821d965f94d@mynode2.testnet.vipernet.xyz:26656,81f4c53ccbb36e190f4fc5220727e25c3186bfeb@mynode3.testnet.vipernet.xyz:26656,d53f620caab13785d9db01515b01d6f21ab26d54@mynode4.testnet.vipernet.xyz:26656,e2b1dc002270c8883abad96520a2fe5982cb3013@mynode5.testnet.vipernet.xyz:26656"' | jq . > ~/.viper/config/configuration.json
#Recheck
cat ~/.viper/config/configuration.json | grep "PersistentPeers"

#Generate chains (set ID=0001, url=http://127.0.0.1:8082/)
viper util gen-chains
#Generate geozone (set value=0001 for global)
viper util gen-geozone

#Download state
cd ~/.viper
sudo git clone https://github.com/vishruthsk/data.git data
cd config
wget https://raw.githubusercontent.com/vipernet-xyz/genesis/main/testnet/genesis.json genesis.json

#Increase ulimit
ulimit -Sn 16384

Create Systemd Service

sudo tee /etc/systemd/system/viper.service > /dev/null << EOF
[Unit]
Description=viper service
After=network.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
User=viper
Group=sudo
ExecStart=/usr/local/bin/viper network start
ExecStop=/usr/local/bin/viper network stop

[Install]
WantedBy=default.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable viper.service
sudo systemctl start viper.service

SSL Configuration

HOSTNAME="your-domain"
sudo certbot --nginx --domain $HOSTNAME --register-unsafely-without-email --no-redirect --agree-tos

Nginx Configuration

sudo tee /etc/systemd/system/viper.service > /dev/null << EOF
server {
    add_header Access-Control-Allow-Origin "*";
    listen 80 ;
    listen [::]:80 ;
    listen 8081 ssl;
    listen [::]:8081 ssl;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name $HOSTNAME;

    location / {
        try_files $uri $uri/ =404;
    }

    listen [::]:443 ssl ipv6only=on;
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/$HOSTNAME/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/$HOSTNAME/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
    access_log /var/log/nginx/reverse-access.log;
    error_log /var/log/nginx/reverse-error.log;

    location ~* ^/v1/client/(dispatch|relay|sim|trigger) {
        proxy_pass http://127.0.0.1:8082;
        add_header Access-Control-Allow-Methods "POST, OPTIONS";
        allow all;
    }

    location = /v1 {
        add_header Access-Control-Allow-Methods "GET";
        proxy_pass http://127.0.0.1:8082;
        allow all;
    }

    location = /v1/query/height {
        add_header Access-Control-Allow-Methods "GET";
        proxy_pass http://127.0.0.1:8082;
        allow all;
    }
}
EOF
sudo systemctl stop nginx
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/viper /etc/nginx/sites-enabled/viper
sudo systemctl start nginx

Open port

80, 443, 8081, 26656

Stake

viper servicers stake self addr amount chainIDs geo_ID https://hostname:443 testnet

#Example
viper servicers stake self 0018d71b8838dc7c94d38dc7c94d291327e0 11000000000 0001 0001 https://vipertest.validator.wiki:443 testnet

Last updated