本文将介绍在单机上创建3个EOS节点并组网成一个私有链。使用的EOS版本是截止到2018.8.1 github上下载的最新的EOS版本。先创建了2个节点的节点网络,然后在网络运行过程中动态的将第3个节点加入网络。

1 新建3个文件夹,准备好创世文件和配置文件

首先新建3个文件夹,命名为eostest1、eostest2、eostest3。每个文件夹都新建创世文件genesis.json和配置文件config.ini俩个文件。三个节点的genesis.json都相同,内容为:

{
  "initial_timestamp": "2018-03-01T12:00:00.000",
  "initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
  "initial_configuration": {
    "base_per_transaction_net_usage": 100,
    "base_per_transaction_cpu_usage": 500,
    "base_per_action_cpu_usage": 1000,
    "base_setcode_cpu_usage": 2097152,
    "per_signature_cpu_usage": 100000,
    "per_lock_net_usage": 32,
    "context_free_discount_cpu_usage_num": 20,
    "context_free_discount_cpu_usage_den": 100,
    "max_transaction_cpu_usage": 10485760,
    "max_transaction_net_usage": 104857,
    "max_block_cpu_usage": 104857600,
    "target_block_cpu_usage_pct": 1000,
    "max_block_net_usage": 1048576,
    "target_block_net_usage_pct": 1000,
    "max_transaction_lifetime": 3600,
    "max_transaction_exec_time": 0,
    "max_authority_depth": 6,
    "max_inline_depth": 4,
    "max_inline_action_size": 4096,
    "max_generated_transaction_count": 16
  },
  
  "initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000"
}

2 启动节点1

节点1的config.ini文件内容为:

genesis-json = genesis.json
block-log-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
unlock-timeout = 90000
bnet-endpoint = 0.0.0.0:4321
http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9876
p2p-server-address = localhost:9876
allowed-connection = any
#p2p-peer-address = localhost:9877
required-participation = true
signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
producer-name = eosio
plugin = eosio::producer_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::history_api_plugin
plugin = eosio::wallet_api_plugin
plugin = eosio::http_plugin
enable-stale-production = true

跟组网有关的配置选项如下:

  • http-server-address = 0.0.0.0:8888,这里设置四个0代表本地可以通过localhost或者127.0.0.1调用http接口,同时外部可以通过本机固定ip访问。
  • p2p-listen-endpoint = 0.0.0.0:9876,p2p网络本机监听端口,监听外部接入的p2p节点,这里的四个0的ip配置意义同上。
  • bnet-endpoint = 0.0.0.0:4321,bnet是使用一个非常简单的算法来同步两条区块链。主要工作是两条链上的确权,共识,广播,同步区块,保持默认配置即可。
  • p2p-peer-address = ip:port,对端p2p节点地址,可以设置多个。
  • producer-name = eosio,配置出块的账户采用eosio
  • enable-stale-production = true,意思是可以不经过确权直接出块,单节点时要配置为true,多节点出块由于需要各方确权共识,要配置为false。
  • signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 ,密钥对,公钥加私钥,对应eosio账户,这对秘钥是写死的,不可改变。

然后启动节点1并让它出块:

~/eostest1$ sudo nodeos --data-dir ./ --config-dir ./

节点1出块了:

ock 000008ff92443c48... #2303 @ 2018-08-02T08:04:29.500 signed by eosio [trxs: 0, lib: 2302, confirmed: 0]
2018-08-02T08:04:30.004 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000009003df3ea52... #2304 @ 2018-08-02T08:04:30.000 signed by eosio [trxs: 0, lib: 2303, confirmed: 0]
2018-08-02T08:04:30.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000009011d7c7964... #2305 @ 2018-08-02T08:04:30.500 signed by eosio [trxs: 0, lib: 2304, confirmed: 0]
2018-08-02T08:04:31.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000902d95972a8... #2306 @ 2018-08-02T08:04:31.000 signed by eosio [trxs: 0, lib: 2305, confirmed: 0]
2018-08-02T08:04:31.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000903a729bcd3... #2307 @ 2018-08-02T08:04:31.500 signed by eosio [trxs: 0, lib: 2306, confirmed: 0]
2018-08-02T08:04:32.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000904941f0066... #2308 @ 2018-08-02T08:04:32.000 signed by eosio [trxs: 0, lib: 2307, confirmed: 0]
2018-08-02T08:04:32.502 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000009055abbaf87... #2309 @ 2018-08-02T08:04:32.500 signed by eosio [trxs: 0, lib: 2308, confirmed: 0]
2018-08-02T08:04:33.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000906f72c854c... #2310 @ 2018-08-02T08:04:33.000 signed by eosio [trxs: 0, lib: 2309, confirmed: 0]
2018-08-02T08:04:33.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000090736ff763d... #2311 @ 2018-08-02T08:04:33.500 signed by eosio [trxs: 0, lib: 2310, confirmed: 0]

3 节点1的相关配置

首先创建默认钱包default并解锁它

:~/eos$ cleos wallet create
Error 3120001: Wallet already exists
Try to use different wallet name.

由于本机以前创建过default钱包,所以直接解锁它:

~/eos$ cleos wallet unlock
password: Unlocked: default

然后发布eosio.bios合约:

~/eos$ cleos set contract eosio build/contracts/eosio.bios/
Reading WAST/WASM from build/contracts/eosio.bios/eosio.bios.wasm...
Using already assembled WASM...
Publishing contract...
executed transaction: b0bb23671747f9d96f94961fb69d69675d788730e04f0746de79d53d2936f09e  3720 bytes  521 us
#         eosio <= eosio::setcode               {"account":"eosio","vmtype":0,"vmversion":0,"code":"0061736d0100000001621260037f7e7f0060057f7e7e7e7e...
#         eosio <= eosio::setabi                {"account":"eosio","abi":"0e656f73696f3a3a6162692f312e30050c6163636f756e745f6e616d65046e616d650f7065...
warning: transaction executed locally, but may not be confirmed by the network yet    ]

然后再创建inita、initb俩个账户:

~/eos$ eleos create account eosio inita EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
eleos: command not found
lzj@lzj-VirtualBox:~/eos$ cleos create account eosio inita EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
executed transaction: f542954a04bf97d8ea3ac1513c9467fd8ef81fbea8c97b65de6d22eb65bcede1  200 bytes  21427 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"inita","owner":{"threshold":1,"keys":[{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqc...
warning: transaction executed locally, but may not be confirmed by the network yet    ] 
~/eos$ cleos create account eosio initb EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
executed transaction: 6445c06d5c38d08652a4721dd35b8d6bdbaad0e213d4dcb461ed6341b1ba9b23  200 bytes  441 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"initb","owner":{"threshold":1,"keys":[{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqc...
warning: transaction executed locally, but may not be confirmed by the network yet    ] 

4 启动节点2

节点2的config.ini文件:

genesis-json = genesis.json
block-log-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
unlock-timeout = 90000
bnet-endpoint = 0.0.0.0:4321
http-server-address = 0.0.0.0:8889
p2p-listen-endpoint = 0.0.0.0:9877
p2p-server-address = localhost:9877
allowed-connection = any
p2p-peer-address = localhost:9876
required-participation = true
signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
producer-name = inita
plugin = eosio::producer_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::history_api_plugin
plugin = eosio::wallet_api_plugin
plugin = eosio::http_plugin
#enable-stale-production = true

节点2和的p2p连接设置项 p2p-peer-address = localhost:9876,这正是节点1的p2p服务地址,这将使得节点2可以连接上节点1并进行同步。producer-name = inita,节点2的出块账户设置为inita。#enable-stale-production = true,不允许节点2在不经确认直接出块的功能。

启动节点2:

~/eostest2$ sudo nodeos --data-dir ./ --config-dir ./

可以看到节点2连上了节点1并进行了同步,此时节点2还不能出块。

2018-08-02T08:01:43.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 96a92122ca98bc13... #1970 @ 2018-08-02T08:01:43.000 signed by eosio [trxs: 0, lib: 1969, conf: 0, latency: 5 ms]
2018-08-02T08:01:43.527 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 6373f6f4b1bceb05... #1971 @ 2018-08-02T08:01:43.500 signed by eosio [trxs: 0, lib: 1970, conf: 0, latency: 27 ms]
2018-08-02T08:01:44.013 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 4654fb223312982b... #1972 @ 2018-08-02T08:01:44.000 signed by eosio [trxs: 0, lib: 1971, conf: 0, latency: 13 ms]
2018-08-02T08:01:44.515 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 8be3654173638981... #1973 @ 2018-08-02T08:01:44.500 signed by eosio [trxs: 0, lib: 1972, conf: 0, latency: 15 ms]
2018-08-02T08:01:45.004 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 65d4bd970eff1a04... #1974 @ 2018-08-02T08:01:45.000 signed by eosio [trxs: 0, lib: 1973, conf: 0, latency: 4 ms]
2018-08-02T08:01:45.507 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block c4937888646ccf9a... #1975 @ 2018-08-02T08:01:45.500 signed by eosio [trxs: 0, lib: 1974, conf: 0, latency: 7 ms]
2018-08-02T08:01:46.004 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 8fce3667abc800b4... #1976 @ 2018-08-02T08:01:46.000 signed by eosio [trxs: 0, lib: 1975, conf: 0, latency: 4 ms]
2018-08-02T08:01:46.504 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block ff32f545bca236fc... #1977 @ 2018-08-02T08:01:46.500 signed by eosio [trxs: 0, lib: 1976, conf: 0, latency: 4 ms]
2018-08-02T08:01:47.002 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block ed17b01884389e15... #1978 @ 2018-08-02T08:01:47.000 signed by eosio [trxs: 0, lib: 1977, conf: 0, latency: 2 ms]

5 配置节点2可以出块

在节点1上执行命令:

~/eos$ cleos push action eosio setprods '{"schedule":[{"producer_name":"inita","block_signing_key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"}]}' -p eosio
executed transaction: d0f4b8a64fd10cc1828bde194ba973ac0cd1757507cc585b558312a6b1ba281c  136 bytes  25902 us
#         eosio <= eosio::setprods              {"schedule":[{"producer_name":"inita","block_signing_key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHu...
warning: transaction executed locally, but may not be confirmed by the network yet    ] 

此时可以看到节点2开始出块了:

2018-08-02T08:10:38.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be0385ff226... #3040 @ 2018-08-02T08:10:38.000 signed by inita [trxs: 0, lib: 3039, confirmed: 0]
2018-08-02T08:10:38.502 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be1ee3a9427... #3041 @ 2018-08-02T08:10:38.500 signed by inita [trxs: 0, lib: 3040, confirmed: 0]
2018-08-02T08:10:39.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be225022e7d... #3042 @ 2018-08-02T08:10:39.000 signed by inita [trxs: 0, lib: 3041, confirmed: 0]
2018-08-02T08:10:39.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be3e7736c37... #3043 @ 2018-08-02T08:10:39.500 signed by inita [trxs: 0, lib: 3042, confirmed: 0]
2018-08-02T08:10:40.003 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be48c5aef03... #3044 @ 2018-08-02T08:10:40.000 signed by inita [trxs: 0, lib: 3043, confirmed: 0]
2018-08-02T08:10:40.502 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be55a5294a6... #3045 @ 2018-08-02T08:10:40.500 signed by inita [trxs: 0, lib: 3044, confirmed: 0]
2018-08-02T08:10:41.000 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be632660e54... #3046 @ 2018-08-02T08:10:41.000 signed by inita [trxs: 0, lib: 3045, confirmed: 0]
2018-08-02T08:10:41.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00000be78c817685... #3047 @ 2018-08-02T08:10:41.500 signed by inita [trxs: 0, lib: 3046, confirmed: 0]

而节点1由出块者变成了同步者:

2018-08-02T08:11:19.003 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block eb906f9c9926cab4... #3122 @ 2018-08-02T08:11:19.000 signed by inita [trxs: 0, lib: 3121, conf: 0, latency: 3 ms]
2018-08-02T08:11:19.501 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 38768a9b75ba9721... #3123 @ 2018-08-02T08:11:19.500 signed by inita [trxs: 0, lib: 3122, conf: 0, latency: 1 ms]
2018-08-02T08:11:20.004 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 22a73d5f4bb58ecf... #3124 @ 2018-08-02T08:11:20.000 signed by inita [trxs: 0, lib: 3123, conf: 0, latency: 4 ms]
2018-08-02T08:11:20.502 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 50b2fd4cf9a6e7f9... #3125 @ 2018-08-02T08:11:20.500 signed by inita [trxs: 0, lib: 3124, conf: 0, latency: 3 ms]
2018-08-02T08:11:21.003 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 7e5e497eff5b4bee... #3126 @ 2018-08-02T08:11:21.000 signed by inita [trxs: 0, lib: 3125, conf: 0, latency: 3 ms]
2018-08-02T08:11:21.503 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 4f2c89100b1e50b5... #3127 @ 2018-08-02T08:11:21.500 signed by inita [trxs: 0, lib: 3126, conf: 0, latency: 3 ms]
2018-08-02T08:11:22.004 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block a664f282934ec13f... #3128 @ 2018-08-02T08:11:22.000 signed by inita [trxs: 0, lib: 3127, conf: 0, latency: 4 ms]
2018-08-02T08:11:22.504 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block bf04fc7d42b77568... #3129 @ 2018-08-02T08:11:22.500 signed by inita [trxs: 0, lib: 3128, conf: 0, latency: 4 ms]

6 节点3加入网络

节点3的config.ini文件:

genesis-json = genesis.json
block-log-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
unlock-timeout = 90000
bnet-endpoint = 0.0.0.0:4321
http-server-address = 0.0.0.0:8890
p2p-listen-endpoint = 0.0.0.0:9878
p2p-server-address = localhost:9878
allowed-connection = any
p2p-peer-address = localhost:9877
required-participation = true
signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
producer-name = initb
plugin = eosio::producer_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::history_api_plugin
plugin = eosio::wallet_api_plugin
plugin = eosio::http_plugin
#enable-stale-production = true

节点3的出块账户设置为initb,另外要注意的是节点3的p2p连接节点不能设置为节点1,因为此时节点1已经不是生产者了。节点3的连接节点应该设置为节点2的地址。

启动节点3:

~/eostest3$ sudo nodeos --data-dir ./ --config-dir ./

可以看到节点3此时同步了:

2018-08-02T08:18:04.007 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 57a583022617738c... #3932 @ 2018-08-02T08:18:04.000 signed by inita [trxs: 0, lib: 3931, conf: 0, latency: 7 ms]
2018-08-02T08:18:04.503 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block c6252e564c06e8c3... #3933 @ 2018-08-02T08:18:04.500 signed by inita [trxs: 0, lib: 3932, conf: 0, latency: 4 ms]
2018-08-02T08:18:05.007 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 0de403438f55d9f9... #3934 @ 2018-08-02T08:18:05.000 signed by inita [trxs: 0, lib: 3933, conf: 0, latency: 7 ms]
2018-08-02T08:18:05.504 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 1e51eec3382282ee... #3935 @ 2018-08-02T08:18:05.500 signed by inita [trxs: 0, lib: 3934, conf: 0, latency: 4 ms]
2018-08-02T08:18:06.014 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block f6c2a9a6a92232cb... #3936 @ 2018-08-02T08:18:06.000 signed by inita [trxs: 0, lib: 3935, conf: 0, latency: 14 ms]
2018-08-02T08:18:06.508 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block af0ec15a1dc2d195... #3937 @ 2018-08-02T08:18:06.500 signed by inita [trxs: 0, lib: 3936, conf: 0, latency: 8 ms]

为了让节点3成为出块者,需要执行命令:

~/eos$ cleos push action eosio setprods '{"schedule":[{"producer_name":"inita","block_signing_key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"},{"producer_name":"initb","block_signing_key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"}]}' -p eosio
executed transaction: cf63a12167b96fc75874205f8d1636048a0ae3732e5204df877749666ac2e643  184 bytes  610 us
#         eosio <= eosio::setprods              {"schedule":[{"producer_name":"inita","block_signing_key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHu...
warning: transaction executed locally, but may not be confirmed by the network yet    ] 
 latency: 2 ms]
2018-08-02T08:22:30.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000117029d36e39... #4464 @ 2018-08-02T08:22:30.000 signed by initb [trxs: 0, lib: 4451, confirmed: 12]
2018-08-02T08:22:30.503 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001171abd77476... #4465 @ 2018-08-02T08:22:30.500 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:31.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001172ba4ac59f... #4466 @ 2018-08-02T08:22:31.000 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:31.502 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001173e4dbf4b7... #4467 @ 2018-08-02T08:22:31.500 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:32.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001174feee3b3a... #4468 @ 2018-08-02T08:22:32.000 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:32.502 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001175d8cf4dc2... #4469 @ 2018-08-02T08:22:32.500 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:33.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011763c2e9e80... #4470 @ 2018-08-02T08:22:33.000 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:33.504 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001177b6d31c85... #4471 @ 2018-08-02T08:22:33.500 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:34.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001178b893cb76... #4472 @ 2018-08-02T08:22:34.000 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:34.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001179f2073c84... #4473 @ 2018-08-02T08:22:34.500 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:35.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000117a75f232d6... #4474 @ 2018-08-02T08:22:35.000 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:35.505 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000117b68ef841f... #4475 @ 2018-08-02T08:22:35.500 signed by initb [trxs: 0, lib: 4451, confirmed: 0]
2018-08-02T08:22:36.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block bcaf5ffd1f444372... #4476 @ 2018-08-02T08:22:36.000 signed by inita [trxs: 0, lib: 4463, conf: 12, latency: 5 ms]
2018-08-02T08:22:36.506 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 2ea1a075c77d7ac0... #4477 @ 2018-08-02T08:22:36.500 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 6 ms]
2018-08-02T08:22:37.002 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 1a1b1e49d616c4e9... #4478 @ 2018-08-02T08:22:37.000 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 2 ms]
2018-08-02T08:22:37.506 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 522fa27eddc38234... #4479 @ 2018-08-02T08:22:37.500 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 6 ms]
2018-08-02T08:22:38.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block d974eb3342c0e58f... #4480 @ 2018-08-02T08:22:38.000 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 5 ms]
2018-08-02T08:22:38.515 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 82bfd06876ffdeb8... #4481 @ 2018-08-02T08:22:38.500 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 15 ms]
2018-08-02T08:22:39.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 5ae954d3e207ee4b... #4482 @ 2018-08-02T08:22:39.000 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 5 ms]
2018-08-02T08:22:39.504 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 00e115a7af2ba1e2... #4483 @ 2018-08-02T08:22:39.500 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 4 ms]
2018-08-02T08:22:40.001 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 07884213d17d404b... #4484 @ 2018-08-02T08:22:40.000 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 1 ms]
2018-08-02T08:22:40.504 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 81843466dd73ca34... #4485 @ 2018-08-02T08:22:40.500 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 4 ms]
2018-08-02T08:22:41.002 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block b7810628be4c191d... #4486 @ 2018-08-02T08:22:41.000 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 3 ms]
2018-08-02T08:22:41.505 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 447c87d897ebc555... #4487 @ 2018-08-02T08:22:41.500 signed by inita [trxs: 0, lib: 4463, conf: 0, latency: 5 ms]
2018-08-02T08:22:42.000 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118892dd9bf3... #4488 @ 2018-08-02T08:22:42.000 signed by initb [trxs: 0, lib: 4475, confirmed: 12]
2018-08-02T08:22:42.502 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001189e319ec88... #4489 @ 2018-08-02T08:22:42.500 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:43.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118a646ca298... #4490 @ 2018-08-02T08:22:43.000 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:43.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118b4187399d... #4491 @ 2018-08-02T08:22:43.500 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:44.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118ce21f4f17... #4492 @ 2018-08-02T08:22:44.000 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:44.503 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118d0e4b4492... #4493 @ 2018-08-02T08:22:44.500 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:45.001 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118e86c6af8b... #4494 @ 2018-08-02T08:22:45.000 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:45.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 0000118f9a0f199b... #4495 @ 2018-08-02T08:22:45.500 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:46.000 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011908b375c97... #4496 @ 2018-08-02T08:22:46.000 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:46.500 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001191dddab366... #4497 @ 2018-08-02T08:22:46.500 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:47.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011924af82618... #4498 @ 2018-08-02T08:22:47.000 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:47.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 00001193775a418c... #4499 @ 2018-08-02T08:22:47.500 signed by initb [trxs: 0, lib: 4475, confirmed: 0]
2018-08-02T08:22:48.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block c776828f09414a07... #4500 @ 2018-08-02T08:22:48.000 signed by inita [trxs: 0, lib: 4487, conf: 12, latency: 5 ms]
2018-08-02T08:22:48.504 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 4c7dacab64768048... #4501 @ 2018-08-02T08:22:48.500 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 5 ms]
2018-08-02T08:22:49.012 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 9bd0962101a208d0... #4502 @ 2018-08-02T08:22:49.000 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 12 ms]
2018-08-02T08:22:49.501 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 158b31bdd6e4e157... #4503 @ 2018-08-02T08:22:49.500 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 1 ms]
2018-08-02T08:22:50.004 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 8d8197fd0fe48ab1... #4504 @ 2018-08-02T08:22:50.000 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 4 ms]
2018-08-02T08:22:50.507 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block fbedb1bb770cef5f... #4505 @ 2018-08-02T08:22:50.500 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 7 ms]
2018-08-02T08:22:51.007 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 151abd197a37c6a3... #4506 @ 2018-08-02T08:22:51.000 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 7 ms]
2018-08-02T08:22:51.509 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 4f842f812ff76476... #4507 @ 2018-08-02T08:22:51.500 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 9 ms]
2018-08-02T08:22:52.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 332bfd3479912f8b... #4508 @ 2018-08-02T08:22:52.000 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 5 ms]
2018-08-02T08:22:52.505 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 7fb87eb795a16e00... #4509 @ 2018-08-02T08:22:52.500 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 5 ms]
2018-08-02T08:22:53.005 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block 98ce47bcc16ee95f... #4510 @ 2018-08-02T08:22:53.000 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 5 ms]
2018-08-02T08:22:53.505 thread-0   producer_plugin.cpp:327       on_incoming_block    ] Received block d4107e04cfcb46ba... #4511 @ 2018-08-02T08:22:53.500 signed by inita [trxs: 0, lib: 4487, conf: 0, latency: 5 ms]
2018-08-02T08:22:54.000 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011a066fe2932... #4512 @ 2018-08-02T08:22:54.000 signed by initb [trxs: 0, lib: 4499, confirmed: 12]
2018-08-02T08:22:54.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011a1e4452b28... #4513 @ 2018-08-02T08:22:54.500 signed by initb [trxs: 0, lib: 4499, confirmed: 0]
2018-08-02T08:22:55.002 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011a20371ade7... #4514 @ 2018-08-02T08:22:55.000 signed by initb [trxs: 0, lib: 4499, confirmed: 0]
2018-08-02T08:22:55.501 thread-0   producer_plugin.cpp:1196      produce_block        ] Produced block 000011a3c6913d38... #4515 @ 2018-08-02T08:22:55.500 signed by initb [trxs: 0, lib: 4499, confirmed: 0]

可以看到此时节点1和节点2交替出块了,每个节点在轮到它出块时连续生产了12个块。

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐