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:
-
Downloading and installing Multichain in the Linux instance
Step 1: Downloading and Installing the Multichain in the Linux Instance
-
Open a new terminal and move to the tmp folder by executing the following command:
cd /tmp
-
Download the latest version of Multichain by using the following command:
wget https://www.multichain.com/download/multichain-2.0.7.tar.gz
-
Extract the tar folder in the present directory using the following command:
tar -xvzf multichain-2.0.7.tar.gz
-
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
-
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:
-
Creating a new Multichain instance with two nodes
Step 1: Creating a New Multichain Instance with Two Nodes
-
Open the Blockchain instance in your browser and select Blockchain Node 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.
-
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
-
Execute the following command to activate the Multichain on the first node:
multichain <Name_of_Blockchain> -daemon
-
Open another tab on your browser and launch the Blockchain Node 2 instance
-
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]
-
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
-
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.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
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.