Setting Up a BP Testnet Node on Telos Zero

In this guide, we'll walk you through the basic steps to set up a BP testnet node on Telos Zero, emphasizing the importance of security tailored to your specific setup. Whether you're new to Telos or looking to enhance your node's security, this article will provide the essential information you need to get started effectively and safely.

Part 1 - Preparation of BP Node

Step 1. Order a dedicated server (not a VPS, also don't use any virtualization or containerization). Recommended minimum configuration: 

CPU: 4 cores, each >= 3.8 GHz

RAM: 32 GB

Storage: 2048 GB SDD

Internet Connection: 100 Mb/s or higher

Step 2. Install Ubuntu server OS on your server.:

Ubuntu 22.04 Jammy

Step 3. Login to your server via SSH.

Step 4. Add user (change newuser to your user): 

sudo adduser newuser

Step 5. Add a user to sudo (change newuser to your user):

sudo usermod -aG sudo newuser

Step 6. Open a session with a new user (change newuser to your user):

su - newuser

Step 7. Create a /telos directory:

sudo mkdir /telos

Step 8. Create a /log/nodeos/ directory:

sudo mkdir /var/log/nodeos

Step 9. Provide access to a new user to /telos directory (change newuser to your user):

sudo chown newuser: /telos

Step 10. Provide access to a new user to /log/nodeos directory (change newuser to your user):

sudo chown newuser: /var/log/nodeos

Step 11. Install schedtool utility:

sudo apt install schedtool

Step 12. Create a testnet1 directory under nodes directory:

mkdir -p /telos/nodes/testnet1

Step 13. Go to /testnet1 directory:

cd /telos/nodes/testnet1

Step 14. Prepare a config.ini file:

curl -L https://api.github.com/repos/telosnetwork/node-template/tarball/master | tar -xvz --strip=1

echo >> config.ini

echo "#TESTNET PEERS:" >> config.ini

cat testnet/peers.ini >> config.ini

Step 15. Go to telos /directory 

cd /telos

Step 16. Download Antelope Leap version to install (check for the latest one here https://github.com/AntelopeIO/leap/releases/):

wget https://github.com/AntelopeIO/leap/releases/download/v4.0.6/leap_4.0.6-ubuntu22.04_amd64.deb

Step 17. Install Antelope Leap:

sudo apt install ./leap_4.0.6-ubuntu22.04_amd64.deb

Step 18. Create a directory for your version of Antelope Leap (change to the version you’ve downloaded):

sudo mkdir -p /telos/leap/4.0.6

Step 19. Copy required files:

sudo cp -a /usr/bin/nodeos /telos/leap/4.0.6

Step 20. Open a node config file:

nano /telos/nodes/testnet1/node_config

 Step 21. Find the entry and update your Antelope Leap location: 

BUILD_ROOT="/telos/leap/4.0.6"

Step 22. Update number of CPUs:

To determine how many cores you have, run cat /proc/cpuinfo | grep processor and then pick one that's not already configured on other nodes and set it in the node_config file instead of 0 (required amount):

CPU="0"

Step 23. Configure to write logs locally to the node's directory if you prefer instead of the system-wide /var/log/nodeos. Set the LOCALIZE_LOG flag to true in the node_config file:

LOCALIZE_LOG=true

Step 24. Check that your config.ini file is configured correctly (agent-name – your BP name; producer-name – your blockproducer (wallet) name; signature-provider a public key of your signature-provider):

nano /telos/nodes/testnet1/config.ini



Step 25. Automate time with NTPD:

sudo timedatectl set-ntp no

timedatectl

sudo apt update

sudo apt install ntp

ntpq -p



Step 26. Go to /testnet1 directory:

cd /telos/nodes/testnet1



Step 27. Start your testnet1 instance:

./start.sh --genesis-json ./testnet/genesis.json



Step 28. Configure your firewall to allow port 8888 from your proxy server, and port 9876 for P2P connection. Allow SSH port (default 22, if not changed) for SSH connection.

 

Part 2 - Preparation of Proxy to Point to Your Endpoint

Step 1. Order a dedicated server or cloud server



Step 2. Install Ubuntu server OS on your server.:

Ubuntu 22.04 Jammy



Step 3. Login to your server via SSH.



Step 4. Add user (change newuser to your user): 

sudo adduser newuser


Step 5. Add a user to sudo (change newuser to your user): 

sudo usermod -aG sudo newuser



Step 6. Open a session with a new user (change newuser to your user):

su - newuser



Step 7. Install NGINX:

sudo apt install nginx 



Step 8. Go to /sites-available/ folder:

cd /etc/nginx/sites-available/



Step 9. Create and open a bp.conf file:

sudo nano bp.conf



Step 10. Paste the following configuration into bp.conf file (change yourserverip to your BP node IP):

server {

    server_name testnet.yourserver.com;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header X-Forwarded-Port $server_port;

    location / {

         proxy_pass http://yourserverip:8888/;

    }

    listen 80;

}

Screenshot of code for your reference:



Step 11. Set a link between /sites-available/bp.conf and /sites-enabled/bp.conf:

sudo ln -s /etc/nginx/sites-available/bp.conf /etc/nginx/sites-enabled/bp.conf



Step 12. Test NGINX configuration:

sudo nginx -t



Step 13. Install snapd:

sudo apt-get install snapd



Step 14. Install certbot:

sudo snap install --classic certbot



Step 15. Set a link between certbot:

sudo ln -s /snap/bin/certbot /usr/bin/certbot



Step 16. Restart NGINX:

sudo systemctl reload nginx



Step 17. Apply certbot to your domain (change testnet.yourdomain.com to your actual domain for a BP access. domain or sub-domain need to point to your proxy IP via A entry on DNS):

sudo certbot --nginx -d testnet.yourdomain.com -d testnet.yourdomain.com



Step 18. Restart NGINX:

sudo systemctl reload nginx



Step 19. Test certbot:

sudo certbot renew --dry-run



Step 20. Configure your firewall to allow port 80 and 443 to access your proxy from the web. Allow communication from/to port 8888 to your BP. Allow SSH port (default 22, if not changed) for SSH connection. 



Step 21. Test that proxy is pointing to a BP and BP is working (bpip is your BP IP address):

curl http://bpip:8888/v1/chain/get_block -X POST -d '{"block_num_or_id":5}'




Part 3 - BP Node Registration on Testnet

Before registering the BP on the network, make sure you have waited long enough to synchronize your BP with a blockchain (approximately 4-7 days). To check it, open it in your browser (change testnetsubdomain.yourdomainname.com to your subdomain/domain):

https://testnetsubdomain.yourdomainname.com/v1/chain/get_info

If all is configured correctly, you will get a similar output:

If head_block_time is the same as the real-time, then your bp is synchronized and ready for registration.

Step 1. Keep in mind: 

a. Signature-provider is a key to sign blocks. 

b. Producer-name is a wallet other than signature-provider.

c. Producer-name wallet needs to be unlocked, but registration of a producer goes with the same public key as for a signature-provider.


Step 2. Create bp.json file and upload in the website root folder, example: testnet.yourdomainname.com/bp.json:

Example: https://mosaicblocks.com/bp.json


Step 3. For a testnet, register wallets here: https://app.telos.net/testnet/developers for both producer-name wallet and signature-provider.


Step 4. Login to your BP server via SSH.


Step 5. Open a session with a new user (change newuser to your user):

su - newuser


Step 6. Import producer-name wallet with the key of producer-name wallet (change <wallet_name> <privkey> to yours): 

cleos wallet import -n <wallet_name> <privkey>


Step 7. Unlock producer-name wallet (change <wallet_name>  to yours):: 

cleos wallet unlock -n <wallet_name>


Step 8. Register a BP node on testnet (Change Producer-name> <signature-provider-publickey> <https://testnet.yourdomain.com> <Producer-name> to yours):

cleos -u https://testnet.telos.net system regproducer <Producer-name> <signature-provider-publickey> <https://testnet.yourdomain.com> -p <Producer-name>


Step 9. Add your producer into rotation list manually here: https://app.telos.net/testnet/rotation


Step 10. Check testnet validators:

https://app-dev.telos.net/validators


We hope you find this guide helpful in setting up your Telos BP Node. In our next guide, we will walk you through additional Mainnet steps, including how to prepare for and claim rewards. To stay in the loop with all things Telos, be sure to connect with us on socials. Additionally, we recommend joining this Telegram chat to receive notifications if your BP is missing blocks: https://t.me/testnet_kickbot

Mosaic Blocks Socials:

X: https://x.com/MosaicBP

Youtube: https://www.youtube.com/@MosaicBlocks

Next
Next

Telos Overview