Eostestnet single host multi-node

Source: Internet
Author: User

This tutorial describes how to set up a multi-node block chain configuration that runs on a single host . This is called a single host, Multi-node testnet. We will set up two nodes on the local computer and let them communicate with each other. The examples in this section depend on three command-line applications, NODEOS,KEOSD, and Cleos. The following figure describes the required test network configuration.


Open four terminal windows to perform the steps in this tutorial.

1, start the Electronic wallet manager

Cd/data/eos/build

root@node:/data/eos/build# keosd--http-server-address 127.0.0.1:8899


2. When the keosd is running correctly, the Wallet application opens the window when it is run and moves to the next terminal window. Create a default wallet. KEOSD will generate some state output in its window. We will continue to use the second window for subsequent Cleos commands.

Cd/data/eos/build

root@node:/data/eos/build# Cleos--wallet-port 8899 Wallet Create

3 . Start the first producer node on the third terminal window. This command will create a special producer named ' BIOS '. (I think it's called ' Eosio ')

root@node:/data/eos/build# Nodeos--enable-stale-production--producer-name eosio--plugin-- Plugin Eosio::net_api_plugin

4, start a second producer node. to start another node, you must first load the Eosio.bios contract. With this contract, you can directly control the resource allocations of other accounts and access other privileged API calls. (If the contract has already been loaded for the first time, this step can be skipped, and the following information will appear in the execution)

./cleos--wallet-port 8899 set contract Eosio. /.. /contracts/eosio.bios/



5, create an account named Inita to become a producer . To create this account, we need to generate the key to associate with the account and import it into our wallet.

root@node:/data/eos/build/programs/cleos# Cleos Create key

The Create Account command requires two public keys, one for the account owner key and the other for its active (active) key. In this example, the newly created public key will be used as the owner key and the active key two times. (I think the creation key should be executed two times to create an account here, because the process is the same when creating an account in EOD3.0)


6, switch to write a terminal window to open a second Nodeos instance. the output of this new node shows some activity, but until the last step of this tutorial, the report is stopped when the Inita account is registered as a producer account and activated. Here are some examples of output from the new boot node

root@node:/data/eos/build/programs/cleos# Nodeos--producer-name Inita--plugin eosio::chain_api_plugin Eosio::net_api_plugin--http-server-address 127.0.0.1:8889--p2p-listen-endpoint 127.0.0.1:_api_plugin-- Http-server-address 127.0.0.1:8889--p2p-listen-endpoint 127.0.0.1:9877--p2p-peer-address 127.0.0.1:9876-- C3pplwrwqxli8pwbykcvsmx\ ", \" 5jwfgrkbzbjm6ltetzc5vbh4rcvy6rjk2y939djhdhee1akosga\ "]onfig-dir node2--data-dir Node2--private-key [\ "eos6dwp4bnvhb6ukqqfbm5ek2b779xb3pplwrwqxli8pwbykcvsmx\", \ " 5jwfgrkbzbjm6ltetzc5vbh4rcvy6rjk2y939djhdhee1akosga\ "]

At this point, the second Nodeos is idle producer. To turn it into an active producer, the Inita needs to register as a producer of the BIOS node, and the BIOS node needs to perform an update to the producer plan operation.

Cleos--wallet-port 8899 Push action Eosio setprods "{\ version\": 1, \ "Producers\": [{\ producer_name\]: \ "Inita\", \ "Blo Ck_signing_key\ ": \" Eos6dwp4bnvhb6ukqqfbm5ek2b779xb3pplwrwqxli8pwbykcvsmx\ "}]}"-P eosio@active

To execute here, a two-node test network has been configured. You can see that the original node is no longer building blocks but is receiving them. You can verify this by running a command for each node with get info.

7, get information about the node

Get information about the first node

Cleos Get Info

Get information for the second node:

Cleos--port 8889 Get Info


Reference Links:

Testnet single host multi-node

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.