Skip to content

Run rai_wallet_server.py

BitHaru edited this page Sep 14, 2020 · 8 revisions

It's a python script, work as wallet server and load balancer. The load balance feature is still in developing.

Hardware recommendations

  • 2GB RAM
  • Dual-Core CPU
  • 100 Mbps bandwidth (1TB or more of available monthly bandwidth)
  • SSD-based hard drive with 10GB+ of free space

Software requirements

  • linux: Ubuntu 18.04+, Debian 9+, Centos 8+
  • python: 3.6+

Prerequisites

1. screen

  • Ubuntu/Debian:
sudo apt install screen  
  • CentOS
dnf install screen

2. python libs

sudo pip3 install -U pip
sudo pip3 install -U python-dotenv
sudo pip3 install -U uvloop
sudo pip3 install -U aiohttp

Installation and Usage

1. Configure .env file

vi .env

#.env file begin
DEBUG=0

NODE_URL=http://127.0.0.1:7176

#Created by 'python3 rai_wallet_server.py -t' and replace it here
CALLBACK_TOKEN=7K29Sg-2Gp3e4kUE8f1Yiar4ROsLxF_FVwN0iWGDJVs

# the node IPs
CALLBACK_WHITELIST=127.0.0.1, 127.0.0.2, 127.0.0.3

# if use cloudflare.com CDN as frontend, set to 1
USE_CLOUDFLARE=0

2. Change node's config

vi ~/Raicoin/config.json

#enable rpc
#set callback_url to the format: http://127.0.0.1:7178/callback/{CALLBACK_TOKEN}  
#or https://your-raicoin-server.com/callback/{CALLBACK_TOKEN}
#stop and restart node to make change effective

3. Start rai_wallet_server.py

screen -S server
python3 rai_wallet_server.py --host 127.0.0.1 -p 7178
ctrl+a+d #to leave screen