Create a Multichain Instance with Two Nodes

Posted By : Aman Sharma | 31-Oct-2022

Set up Multichain in the Local Machine

Objective: To set up Multichain Blockchain in the local machine

 

Tools required: Ubuntu, web browser, terminal

 

Steps to be followed:

  1. Downloading and installing Multichain in the Linux instance

 

Step 1: Downloading and Installing the Multichain in the Linux Instance

  1. Open a new terminal and move to the tmp folder by executing the following command:

cd /tmp

  1. Download the latest version of Multichain by using the following command:

wget https://www.multichain.com/download/multichain-2.0.7.tar.gz

 

  1. Extract the tar folder in the present directory using the following command:

tar -xvzf multichain-2.0.7.tar.gz


 

  1. Move the files in the extracted directory to the bin directory to make Multichain globally available by executing the following commands:

cd multichain-2.0.7

sudo mv multichaind multichain-cli multichain-util /usr/local/bin


 

  1. The Multichain installation is now complete and we can confirm this by executing the following command to check its version:

multichaind -version


 

Create a Multichain Instance with Two Nodes

Objective: To create a local Multichain instance with two nodes and connect them

 

Tools required: Ubuntu, web browser, terminal

 

Steps to be followed:

  1. Creating a new Multichain instance with two nodes

 

Step 1: Creating a New Multichain Instance with Two Nodes

  1. Open the Blockchain instance in your browser and select Blockchain Node 1

 

  1. To create a private instance of the Multichain Blockchain, execute the following command on Blockchain Node 1 in the lab:

multichain-util create <Name_of_Blockchain>


 

Note: Name the Blockchain relevant to its purpose and store it for further use.


 

  1. Open the new Blockchain’s parameter file to view the pre-configured parameters by executing the following command:

sudo cat ~/.multichain/<Name_of_Blockchain>/params.dat


 

  1. Execute the following command to activate the Multichain on the first node:

multichain <Name_of_Blockchain> -daemon


 

  1. Open another tab on your browser and launch the Blockchain Node 2 instance

 

 

  1. Open a terminal in the second node and execute the following command to connect to the Multichain instance:

multichain-cli <Name_of_Blockchain>@[IP_Address_of_Node1]:[Port_Number]


 

  1. Execute the following command in the first node to grant any node permission to connect to the Blockchain if not granted by default:

multichain-cli <Name_of_Blockchain> grant <Node_Address> connect, send, receive


 

  1. Execute the command in step 1.6 again to connect to the Multichain instance


 

Note: The two instances will be referred to as nodes. Blockchain Node 1 will be referred to as the first node and Blockchain Node 2 will be referred to as the second node. They must be opened in two browser tabs. Open another terminal in node 2 without closing the daemon in step 1.8 to execute the rest of the commands.


 


 


 

About Author

Author Image
Aman Sharma

Aman is an accomplished Backend developer with extensive industry experience, specializing in Odoo technology. He has a profound understanding and expertise in Python, Odoo ERP, Flask, MySQL, PostgreSQL, JavaScript, and payment gateway integration, particularly with Stripe. Aman's exceptional contributions to projects like Mymandi, Pando store, Markivia, DataInsite, and Tundra have been instrumental in driving the growth of his company. His strong analytical skills are pivotal in ensuring the success of his work, as he is able to identify and solve complex problems efficiently. Beyond his professional endeavors, he possesses a genuine passion for learning new technologies.

Request for Proposal

Name is required

Comment is required

Sending message..