Deploying a Node

Here you will find instructions for the deployment of LACChain nodes using Ansible. By following this guide, your nodes will be executed from your local machine on your remote server. Your local machine and your remote server will communicate via ssh. The installation with ansible provided is compatible with Ubuntu and Centos7.

During the process of node deploying, you will be asked about the network in which you would like to deploy your nodes. In order for your node to get permissioned, you need to complete the permissioning process first. In order to understand better what are the types of networks available and the permissioning processes for each network, please read permissioning process.

Minimum System Requirements

Recommended hardware features for LACChain nodes:

Recommended Hardware

On ProTestnet

On Mainnet Omega

CPU

2 vCPUs

4 vCPUs compute optimized

RAM Memory

8 GB

16 GB

Hard Disk

250 GB SSD

375 GB SSD

IOPs

15,000 IOPS READ 5,000 IOPS WRITE

70,000 IOPS READ 50,000 IOPS WRITE

Operating System: Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04, Centos7, always 64 bits.

It is necessary to enable the following network ports in the machine in which we are going to deploy the node:

Port 60606: TCP/UDP – To establish communication p2p between nodes.

Port 4545: TCP – To establish RPC communication. (this port is used for applications that communicate with LACChain and may be leaked to the Internet)

Pre-requisites

Install Ansible

For this installation we will use Ansible. It is necessary to install Ansible on a local machine that will perform the installation of the node on a remote machineFollow these instructions to install ansible in your local machine:

				
					$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
				
			

Clone Repository

To configure and install a LACChain node, you must clone this git repository in your local machine:

				
					$ git clone https://github.com/LACNet-Networks/besu-networks
$ cd besu-networks/
				
			

Obtain SSH access to your remote machine

Make sure you have SSH access to the remote machine where you are going to deploy the LACChain node. This step will vary depending on your context (physical machine, cloud provider, etc.). This document assumes that you are able to log into your remote machine using the following command: 

				
					$ ssh remote_user@remote_host

				
			

Node Installation

Preparing installation of a new node

There are three types of LACChain nodes (validator, bootnode, and writer) that can be created in the LACChain networks orchestrated by LACNet at this moment. After cloning the repository in your local machine, create a copy of the “inventory.example" file and save it as “inventory". Edit this file to add a line for the remote server where you are creating the new node. You can do it with a graphical tool or inside the shell.

				
					$ cd besu-networks/
$ cp inventory.example inventory
$ vi inventory
[node]
192.168.10.72 node_ip=your.public.node.ip node_name=my_node_name node_email=your@email
				
			

Consider the following:

  • Place the new line below the [node] line. Do not replace existing lines.
  • The first element on the new line is the IP or hostname where you can reach your remote machine from your local machine.
  • The value of node_name is the name you want for your node in the network monitoring tool.
  • The value of node_email is the email address you want to register for your node in the network monitoring tool. It’s a good idea to provide the e-mail of the technical contact provided as part of the on-boarding process.

Deploying the new node

Run the following script:

				
					 $ ansible-playbook -i inventory --private-key=~/.ssh/id_rsa -u remote_user site-lacchain-node.yml
				
			

You will be asked about which kind of node are you deploying and in which of the LACChain Networks. For instance, if you want to deploy a writer node on Mainnet Omega, first type 2 for writer and then 0 for Mainnet Omega. For a boot in ProTestnet type 1 and then also 1.

				
					[0]:validator
[1]:boot
[2]:writer
Please, choose which type of node are you deploying:

[0]:mainnet-omega
[1]:pro-testnet
Please, choose in which network are you deploying:
				
			

Don’t forget to write down your node’s “enode” from the log by locating the line that looks like the following. Remember that you need to provide the enode to be permissioned, as indicated in the permissioning process.

 
				
					TASK [lacchain-validator-node : print enode key] ***********************************************
ok: [x.x.x.x] => {
    "msg": "enode://cb24877f329e0e3fff6c7d7b88d601b698a9df6efbe1d91ce77130f065342b523418b38cb3c92ea3bcca15344e68c7d85a696eb9f8c0152c51b9b7b74729064e@a.b.c.d:60606"
}
				
			

At the end of the installation, if everything worked a BESU service will be created managed by Systemctl with started status. After the installation has finished, you will have nginx installed on each instance chosen; it will be up and running and will allow secure and encrypted RPC connections (on the default 443 port). Certificates used to create the secure connections are self-signed; it is up to you decide another way to secure RPC connections or continue using the provided default service. Once you are permissioned, you can verify that you are connected to other nodes in the network by following the steps detailed in #issue33.

 

Node Configuration

Configuring the Besu node file

The default configuration should work for everyone. However, depending on your needs and technical knowledge you can modify your local node’s settings in /root/lacchain/config.toml, e.g. for RPC access or authentication. Please refer to the reference documentation.

Start up your node

Once your node is ready, you can start it up with this command in remote machine:

				
					<remote_machine>$ service pantheon start
				
			

Node Operation

If you need to restart the services, you can execute the following commands:

				
					<remote_machine>$ service pantheon restart
				
			

Updates

To update your node, first change the inventory file. Replace the ip address with your node ip address. :

				
					[node] #here put the role you are going to update
35.193.123.227 
				
			

Optionally you can choose the sha_commit of the version you want to update. It is only needed to specify the version:

				
					[node] #here put the role you are gong to update
35.193.123.227 besu_release_version='22.1.0'
				
			

Current Besu versions of LACChain nodes orchestrated by LACNet are obtained from here. Tested BESU versions are 21.1.6, 20.10.4, 1.5.3, 1.5.2, 1.4.4, 1.3.6.

 

Execute the following command to update the node:

				
					$ ansible-playbook -i inventory --private-key=~/.ssh/id_rsa -u remote_user site-lacchain-update-node.yml 
				
			

Checking your connection

Once you have been permissioned, you can check if your node is connected to the network properly. Check that the node has stablished the connections with the peers:

 
				
					$ sudo -i
$ curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' localhost:4545
				
			

You should get a result like this:

Now you can check if the node is syncing blocks by getting the log of the last 100 blocks:

				
					$ tail -100 /root/lacchain/logs/pantheon_info.log
				
			

You should get something like this:

If any of these two checks doesn’t work, try to restart the besu service:

				
					$ service pantheon restart
				
			

Contact

If you find any issue, you can open an issue on Github and contact us at [email protected]. If you already have a membership, you can also open a ticket.

Next Steps

Now that you have installed your writer node, you can follow our guides to deploy smart contracts, deploy private channels (using Ansibleusing Dockers, or using Kubernetes), deploy an IPFS node (using Ansible, using Dockers, or using Kubernetes), and deploy the Hyperledger Firefly stack.

Copyright 2022 © All rights Reserved. Designed by LACNet