Deploy a node

This guide allows you to set up a local LACChain node for testing and development purposes. After completing the node deployment, you can also follow our complementary Getting Started guide to deploy a smart contract and Getting Started guide to send a transaction. This node is a local and isolated one, so you are not connected to the LACChain Networks. In order to deploy a node in the LACChain Networks, you can use our Installation Guide Using Ansible, our Installation Guide Using Dockers, and our Installation Guide Using Kubernettes. 

Requirements

Recommended hardware features for the LACChain node:

2 vCPUs

RAM memory 8Gb

Hard Disk 10GB

 

Clone Repository

To configure and deploy your node, you must clone this git repository in your machine.

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


				
			

Install Docker and Docker compose

Make sure you have Docker and Docker-compose installed on machine. If not, you can install them following the instructions to install docker and docker-compose.

Run your node

Execute the following command to run your containers:

				
					$ cd besu-networks/docker/compose/local/writer1
				
			

This node comes with all the smart contracts pre-deployed, so you have to give permissions in the data directory to your user so you can read, write, and execute in this directory. Depending on your docker version, run:

				
					$ sudo chmod -R 667 data
$ cd ..
$ docker-compose up -d  
				
			

Or:

				
					$ docker compose up -d
				
			

Run your local node + Firefly

Execute the following command to run your containers

				
					$ cd besu-networks/docker/compose/firefly/writer1
				
			

We have deployed all smart contracts previously, now you have to give permissions to data directory to your user can read write and execute in this directory.

				
					$ sudo chmod -R 667 data
$ cd ..
$ docker-compose up -d  

				
			

Or

				
					$ docker compose up -d
				
			

Depending on your docker version

Next, it is necessary to register your node identity, so execute the following command to register your node identity on smart contract:

				
					$ curl -X POST -H 'content-type:application/json' --data '{}' http://localhost:5000/api/v1/network/organizations/self\?confirm\=true
				
			

It could take a few seconds to register your identity. Result of this command should be similar like this:

				
					{┬źid┬╗:┬╗d16f0a0e-a24b-4596-9a01-fd6f103aad05ÔÇ│,┬╗did┬╗:┬╗did:firefly:org/XXXXXX┬╗,┬╗type┬╗:┬╗org┬╗,┬╗namespace┬╗:┬╗ff_system┬╗,┬╗name┬╗:┬╗XXXX┬╗,┬╗messages┬╗:{┬źclaim┬╗:┬╗8dbc7002-b647-40ea-abd3-43b12838c57d┬╗,┬╗verification┬╗:null,┬╗update┬╗:null},┬╗created┬╗:┬╗2022-06-16T22:39:28.674387388Z┬╗,┬╗updated┬╗:┬╗2022-06-16T22:39:28.67
				
			

Finally, we need to listen events related to token creation, so execute the following command to init token events:

				
					$ curl -X POST -H 'content-type:application/json' http://localhost:5108/api/v1/init
				
			

It is done! Now you can access using these urls:

Verify your node

Check if the node is syncing blocks by getting the log of the Besu containter. Depending on your docker version, run:

				
					$ docker-compose logs -f besu
				
			

Or:

				
					$ docker compose logs -f besu
				
			

You should get a log similar to the following:

Stop your node

If you want or need to stop your node, please execute one of the following commands depending on your docker version:

				
					$ docker-compose down
				
			

Or:

				
					$ docker compose down
				
			

Next steps

Now you can continue and deploy a first smart contract in your node following this guide.

Copyright 2022 ┬ę All rights Reserved. Designed by LACNet