构建多节点私链
一、概述
本教程介绍如何配置在多个主机上运行多个节点的EOSIO私链网络,即多主机多节点EOS私链网络,我们将在本地计算机上配置四个节点,并让它们互相通信,其中三个节点产快,一个节点非产快,主要会用到三个程序nodeos、keosd、cleos,以下是该私链网络结构图:
二、启动第一个节点
在第一个节点上,我们启动eos进程时启动钱包插件,在这个私有网络上我们使用这个节点上钱包。
第一个节点配置如下:
# The local IP and port to listen for incoming http connections; set blank to disable. (eosio::http_plugin)
http-server-address = 0.0.0.0:9800
# The actual host:port used to listen for incoming p2p connections. (eosio::net_plugin)
p2p-listen-endpoint = 0.0.0.0:9900
# The public endpoint of a peer node to connect to. Use multiple p2p-peer-address options as needed to compose a network. (eosio::net_plugin)
# p2p-peer-address =
p2p-peer-address = 193.112.127.146:9900
p2p-peer-address = 118.126.97.157:9900
p2p-peer-address = 111.230.210.23:9900
producer-name = eosio
# Timeout for unlocked wallet in seconds (default 900 (15 minutes)). Wallets will automatically lock after specified number of seconds of inactivity. Activity is defined as any wallet command e.g. list-wallets. (eosio::wallet_plugin)
unlock-timeout = 90000
# Plugin(s) to enable, may be specified multiple times
# plugin =
plugin = eosio::http_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::net_api_plugin
plugin = eosio::wallet_api_plugin
plugin = eosio::history_api_plugin
主要配置本节点rpc监听地址,p2p监听地址,p2p连接地址,bp名称,因为启动有钱包插件,配置了钱包锁定的超时时间,同时加载了需要使用的插件,我们在这个节点加载钱包插件。