VIPER
Viper Node Setup Guide
Welcome to the Viper Node Setup Guide! This comprehensive walkthrough will assist you in configuring your server to run a Viper node, enabling you to participate in the network.
Hardware Requirements
4 CPUs (or vCPUs)
8 GB RAM
100 GB DiskPrerequisites
Configure your DNS if you have a domain.
Login with SSH
replace mynode.vipernet.xyz with your own DNS name or IP address
Set Hostname
Open the
/etc/hostnamefile with thenanoeditor:
nano /etc/hostnameChange the localhost value to your Hostname, e.g., mynode.vipernet.xyz
Save the file and exit the editor (press
Ctrl+O,Enter,Ctrl+X).Reboot the server:
rebootCreate New User
Create a new user named
viperand add it to thesudogroup:
useradd -m -g sudo -s /bin/bash viper && passwd viperSwitch to the new user:
su - viperInstall Dependencies
sudo apt updatesudo apt dist-upgrade -ysudo apt-get install git build-essential curl file nginx certbot python3-certbot-nginx jq -yViper Setup
Create a directory for the Vipernet network:
sudo mkdir -p viper-networkcd viper-networkClone the Vipernet binaries repository:
sudo git clone https://github.com/vipernet-xyz/viper-binariescd viper-binariesCopy the binary to
/usr/local/bin/viper(replace$YOUR_ARCH_TYPE_BINARYwith the actual file name, e.g.,viper_linux_amd64):
sudo cp $YOUR_ARCH_TYPE_BINARY /usr/local/bin/viperViper Configuration
Create a new account:
viper wallet create-accountCreate a validator (replace
addresswith the address obtained from the previous command):
viper servicers create-validator addressFund your account by requesting test tokens from the
#🤑|req-tokenschannel at Viper Network Discord server and wait till the tx gets included in the block (It may take a couple of mintues for the amount to reflect)Update the Tendermint configuration:
echo $(viper util print-configs) | jq '.tendermint_config.P2P.Seeds = "6304da172fce20a6039a6eb5c9154cb8056c0ed6@testnet-seed1.vipernet.xyz:26656"' | jq . > ~/.viper/config/configuration.jsonGenerate chains (enter the
chain IDand theURLof the non-native chain node when prompted):
viper util gen-chainsEnter the ID of the Viper network:
0001Enter the URL of the network identifier.
http://127.0.0.1:8082/Enter y if you want to add non-native chains (Enter "n" for now)
For Non-Native Chains:
When prompted, enter the chain ID. This is a unique identifier for the blockchain network you want to service through the Viper node. For example, if you want to service the Ethereum network, you would enter the chain ID of Etherereum.
Next, when prompted, enter the URL of the non-native chain node you wish to service through the Viper node. This should be the RPC endpoint of the blockchain node you want to connect to.
Repeat steps 2 and 3 for each additional non-native chain you want to service through the Viper node.
Once you have entered all the required chain IDs and URLs, the command will generate the necessary configuration files for those chains within the Viper node.
Generate the geozone (enter the
geo IDwhen prompted):
viper util gen-geozoneChange to the
~/.viper/configdirectory:
cd ~/.viper/configDownload the genesis file:
wget https://raw.githubusercontent.com/vipernet-xyz/genesis/main/testnet/genesis.json genesis.jsonIncrease ulimit
ulimit -Sn 16384Create Systemd Service
Create a systemd service file for the Vipernet node:
sudo nano /etc/systemd/system/viper.serviceCopy and paste the following content into the file:
[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.targetSave the file and exit the editor (press
Ctrl+O,Enter,Ctrl+X).Reload the systemd daemon:
sudo systemctl daemon-reloadEnable and start the
viper.serviceservice:
sudo systemctl enable viper.servicesudo systemctl start viper.serviceSSL Configuration
Obtain an SSL certificate using Certbot (replace
$HOSTNAMEwith your actual hostname):
sudo certbot --nginx --domain $HOSTNAME --register-unsafely-without-email --no-redirect --agree-tosNginx Configuration
Open the Nginx configuration file:
sudo nano /etc/nginx/sites-available/viperCopy and paste the following content into the file (replace
$HOSTNAMEwith your actual hostname):
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;
}
}Save the file and exit the editor (press
Ctrl+O,Enter,Ctrl+X).Stop the Nginx service:
sudo systemctl stop nginxRemove the default Nginx configuration:
sudo rm /etc/nginx/sites-enabled/defaultCreate a symbolic link to the new Vipernet configuration:
sudo ln -s /etc/nginx/sites-available/viper /etc/nginx/sites-enabled/viperStart the Nginx service:
sudo systemctl start nginxUFW Configuration
Enable UFW:
sudo ufw enableDeny incoming traffic by default:
sudo ufw default denyAllow SSH:
sudo ufw allow sshAllow HTTP:
sudo ufw allow 80Allow HTTPS:
sudo ufw allow 443Allow Vipernet-specific port (8081):
sudo ufw allow 8081Allow Vipernet-specific port (26656):
sudo ufw allow 26656Stake
Stake your validator (replace addr, amount, chainIDs(comma seperated; for, e.g., 0001,0002,0003) and https://hostname:443 with your own values). When staking, you need to specify the amount in the smallest unit of VIPR, which is uVIPR. 1 VIPR is equal to 1,000,000 uVIPR. The minimum stake amount required is 10,000 VIPR, but it's recommended to stake around 11,000 VIPR.
viper servicers stake self addr amount chainIDs https://hostname:443 testnetNote: Replace hostname with your actual hostname
Last updated