Nano

The Nano module requires access to a server running rai_node. Below are instructions to setup this onto a low-end VPS.

At the moment you need about 5 GB Disk space and 1 GB RAM. This requirement may increase overtime.

(Replace ::ffff:127.0.0.1 with the IP address of your server running Parity)
(Replace 127.0.0.1 with the IP address of your HTTP server running Billic)
 
useradd -m rai 
chmod 0700 /home/rai
apt update && apt-get install -y xz-utils

sudo -u rai bash -c "cd;curl -0 https://github.com/clemahieu/nano/releases/download/V9.0/rai_node.xz -o rai_node.xz;tar xf rai_node.xz;rm -f rai_node.xz"
echo '[Unit] Description=Nano Node
[Service]
ExecStart=/home/rai/rai_node/rai_node --daemon
User=rai

[Install]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8403:3412244]
-A INPUT ! -s 127.0.0.1 -p tcp -m tcp --dport 8545 -j DROP
COMMIT' > /etc/iptables.up.rules
echo '#!/bin/sh
/sbin/iptables-restore < /etc/iptables.up.rules' > /etc/network/if-pre-up.d/iptables
chmod +x /etc/network/if-pre-up.d/iptables
/etc/network/if-pre-up.d/iptables
systemctl daemon-reload 
systemctl enable parity
systemctl start parity
systemctl status parity
WantedBy=multi-user.target' > /etc/systemd/system/rai.service
echo '*filter
:INPUT ACCEPT [12415:5240682]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8403:3412244]
-A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 7076 -j ACCEPT
-A INPUT ! -s 127.0.0.1/32 -p tcp -m tcp --dport 7076 -j DROP
COMMIT' > /etc/iptables.up.rules
echo '#!/bin/sh
/sbin/iptables-restore < /etc/iptables.up.rules' > /etc/network/if-pre-up.d/iptables

chmod +x /etc/network/if-pre-up.d/iptables
/etc/network/if-pre-up.d/iptables
systemctl daemon-reload
systemctl enable rai
systemctl start rai
sleep 5
sed -i -E 's/"address": "(.*)",/"address": "::ffff:127.0.0.1",/g' /home/rai/RaiBlocks/config.json


 !!! WARNING !!!  The startup script includes firewall rules which are intended to deny access to your Nano API to every IP except your server. Make sure these are in place, or you may have your XRB stolen. Make sure you can't access port 7076 from anywhere on the internet. It should also be noted that if you use a shared web server, it is possible for ANY website or user on your server to access your Rai Node server.

Next, we need to create a wallet.

curl http://127.0.0.1:7076/ -X POST -d '{"action": "wallet_create"}'
 

Take note of the wallet address that is generated, you need to put that into the Billic settings.





Next: API
Previous: Configuring Payment Gateway Modules
Powered By Billic