简介
本文重点介绍EOS配置文件config.ini
的各项的解释及其作用。
EOS,可以理解为Enterprise Operation System,即为商用分布式应用设计的一款区块链操作系统。EOS是引入的一种新的区块链架构,旨在实现分布式应用的性能扩展。注意,它并不是像比特币和以太坊那样的货币,而是基于EOS软件项目之上发布的代币,被称为区块链3.0。百度百科
本文使用的EOS是2018年8月23日在Git中下载master版本;源码版本差异过大的可能本文不适用。
本地单节点EOS网络
使用以下命令启动自己的单节点EOS网络:
$ cd /data/eos/build/programs/nodeos
$ ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
执行后效果如下:
2018-08-27T03:07:00.801 thread-0 chain_plugin.cpp:315 plugin_initialize ] initializing chain plugin
2018-08-27T03:07:00.801 thread-0 chain_plugin.cpp:553 plugin_initialize ] Starting up fresh blockchain with default genesis state.
2018-08-27T03:07:03.147 thread-0 http_plugin.cpp:344 plugin_initialize ] configured http to listen on 127.0.0.1:8888
2018-08-27T03:07:03.147 thread-0 net_plugin.cpp:2898 plugin_initialize ] Initialize net plugin
2018-08-27T03:07:03.147 thread-0 net_plugin.cpp:2924 plugin_initialize ] host: 0.0.0.0 port: 9876
2018-08-27T03:07:03.148 thread-0 net_plugin.cpp:2995 plugin_initialize ] my node_id is 795ecc02a1aae9b7b27abfaa69dc57fcb2a3104c00df82be2e40f53a773a46c8
2018-08-27T03:07:03.148 thread-0 main.cpp:105 main ] nodeos version v1.2.2-dirty
2018-08-27T03:07:03.148 thread-0 main.cpp:106 main ] eosio root is /root/.local/share
2018-08-27T03:07:03.148 thread-0 controller.cpp:1379 startup ] No head block in fork db, perhaps we need to replay
2018-08-27T03:07:03.148 thread-0 controller.cpp:372 initialize_fork_db ] Initializing new blockchain with genesis state
2018-08-27T03:07:03.193 thread-0 chain_plugin.cpp:645 plugin_startup ] starting chain in read/write mode
2018-08-27T03:07:03.193 thread-0 chain_plugin.cpp:649 plugin_startup ] Blockchain started; head block is #1, genesis timestamp is 2018-06-01T12:00:00.000
2018-08-27T03:07:03.193 thread-0 http_plugin.cpp:401 plugin_startup ] start listening for http requests
2018-08-27T03:07:03.195 thread-0 chain_api_plugin.cpp:77 plugin_startup ] starting chain_api_plugin
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/abi_bin_to_json
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/abi_json_to_bin
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_abi
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_account
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_block
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_block_header_state
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_code
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_currency_balance
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_currency_stats
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_info
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_producer_schedule
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_producers
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_raw_code_and_abi
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_required_keys
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_scheduled_transactions
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_table_rows
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/get_transaction_id
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/push_block
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/push_transaction
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/chain/push_transactions
2018-08-27T03:07:03.195 thread-0 history_api_plugin.cpp:38 plugin_startup ] starting history_api_plugin
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/history/get_actions
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/history/get_controlled_accounts
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/history/get_key_accounts
2018-08-27T03:07:03.195 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/history/get_transaction
2018-08-27T03:07:03.196 thread-0 net_plugin.cpp:3014 plugin_startup ] starting listener, max clients is 25
2018-08-27T03:07:03.196 thread-0 producer_plugin.cpp:650 plugin_startup ] producer plugin: plugin_startup() begin
2018-08-27T03:07:03.196 thread-0 producer_plugin.cpp:672 plugin_startup ] Launching block production for 1 producers at 2018-08-27T03:07:03.196.
2018-08-27T03:07:03.197 thread-0 producer_plugin.cpp:684 plugin_startup ] producer plugin: plugin_startup() end
2018-08-27T03:07:03.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000029bd37286... #2 @ 2018-08-27T03:07:03.500 signed by eosio [trxs: 0, lib: 0, confirmed: 0]
2018-08-27T03:07:04.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000347401ed2... #3 @ 2018-08-27T03:07:04.000 signed by eosio [trxs: 0, lib: 2, confirmed: 0]
2018-08-27T03:07:04.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000004eacd3493... #4 @ 2018-08-27T03:07:04.500 signed by eosio [trxs: 0, lib: 3, confirmed: 0]
2018-08-27T03:07:05.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000005e4b17c88... #5 @ 2018-08-27T03:07:05.000 signed by eosio [trxs: 0, lib: 4, confirmed: 0]
2018-08-27T03:07:05.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000006c067569b... #6 @ 2018-08-27T03:07:05.500 signed by eosio [trxs: 0, lib: 5, confirmed: 0]
2018-08-27T03:07:06.005 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000071cc7d700... #7 @ 2018-08-27T03:07:06.000 signed by eosio [trxs: 0, lib: 6, confirmed: 0]
2018-08-27T03:07:06.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000082a168966... #8 @ 2018-08-27T03:07:06.500 signed by eosio [trxs: 0, lib: 7, confirmed: 0]
2018-08-27T03:07:07.008 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000957eed237... #9 @ 2018-08-27T03:07:07.000 signed by eosio [trxs: 0, lib: 8, confirmed: 0]
2018-08-27T03:07:07.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000a678fa222... #10 @ 2018-08-27T03:07:07.500 signed by eosio [trxs: 0, lib: 9, confirmed: 0]
2018-08-27T03:07:08.005 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000bb17ce1dd... #11 @ 2018-08-27T03:07:08.000 signed by eosio [trxs: 0, lib: 10, confirmed: 0]
2018-08-27T03:07:08.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000c30e1a3ae... #12 @ 2018-08-27T03:07:08.500 signed by eosio [trxs: 0, lib: 11, confirmed: 0]
2018-08-27T03:07:09.008 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000d2495a9aa... #13 @ 2018-08-27T03:07:09.000 signed by eosio [trxs: 0, lib: 12, confirmed: 0]
2018-08-27T03:07:09.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000e9806def3... #14 @ 2018-08-27T03:07:09.500 signed by eosio [trxs: 0, lib: 13, confirmed: 0]
2018-08-27T03:07:10.010 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000000f3711a81e... #15 @ 2018-08-27T03:07:10.000 signed by eosio [trxs: 0, lib: 14, confirmed: 0]
2018-08-27T03:07:10.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000010368131cb... #16 @ 2018-08-27T03:07:10.500 signed by eosio [trxs: 0, lib: 15, confirmed: 0]
2018-08-27T03:07:11.002 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000118af476e1... #17 @ 2018-08-27T03:07:11.000 signed by eosio [trxs: 0, lib: 16, confirmed: 0]
2018-08-27T03:07:11.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000012c9a346f6... #18 @ 2018-08-27T03:07:11.500 signed by eosio [trxs: 0, lib: 17, confirmed: 0]
2018-08-27T03:07:12.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000132f5c326a... #19 @ 2018-08-27T03:07:12.000 signed by eosio [trxs: 0, lib: 18, confirmed: 0]
2018-08-27T03:07:12.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001463ae8d27... #20 @ 2018-08-27T03:07:12.500 signed by eosio [trxs: 0, lib: 19, confirmed: 0]
2018-08-27T03:07:13.002 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000159138640d... #21 @ 2018-08-27T03:07:13.000 signed by eosio [trxs: 0, lib: 20, confirmed: 0]
2018-08-27T03:07:13.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000016662ed2c6... #22 @ 2018-08-27T03:07:13.500 signed by eosio [trxs: 0, lib: 21, confirmed: 0]
2018-08-27T03:07:14.001 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000176b570530... #23 @ 2018-08-27T03:07:14.000 signed by eosio [trxs: 0, lib: 22, confirmed: 0]
2018-08-27T03:07:14.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000018a6d1044b... #24 @ 2018-08-27T03:07:14.500 signed by eosio [trxs: 0, lib: 23, confirmed: 0]
2018-08-27T03:07:15.002 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000019c41eb328... #25 @ 2018-08-27T03:07:15.000 signed by eosio [trxs: 0, lib: 24, confirmed: 0]
2018-08-27T03:07:15.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001ac1c41ed0... #26 @ 2018-08-27T03:07:15.500 signed by eosio [trxs: 0, lib: 25, confirmed: 0]
2018-08-27T03:07:16.005 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001b4638673d... #27 @ 2018-08-27T03:07:16.000 signed by eosio [trxs: 0, lib: 26, confirmed: 0]
2018-08-27T03:07:16.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001c0e8fbfc6... #28 @ 2018-08-27T03:07:16.500 signed by eosio [trxs: 0, lib: 27, confirmed: 0]
2018-08-27T03:07:17.008 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001d37c59f7c... #29 @ 2018-08-27T03:07:17.000 signed by eosio [trxs: 0, lib: 28, confirmed: 0]
2018-08-27T03:07:17.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001ee58c6f6c... #30 @ 2018-08-27T03:07:17.500 signed by eosio [trxs: 0, lib: 29, confirmed: 0]
2018-08-27T03:07:18.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000001fcf3569c3... #31 @ 2018-08-27T03:07:18.000 signed by eosio [trxs: 0, lib: 30, confirmed: 0]
2018-08-27T03:07:18.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000020889ec8b0... #32 @ 2018-08-27T03:07:18.500 signed by eosio [trxs: 0, lib: 31, confirmed: 0]
2018-08-27T03:07:19.002 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000212c5cb4d2... #33 @ 2018-08-27T03:07:19.000 signed by eosio [trxs: 0, lib: 32, confirmed: 0]
2018-08-27T03:07:19.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000022a86c5a2b... #34 @ 2018-08-27T03:07:19.500 signed by eosio [trxs: 0, lib: 33, confirmed: 0]
2018-08-27T03:07:20.001 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000239e98273c... #35 @ 2018-08-27T03:07:20.000 signed by eosio [trxs: 0, lib: 34, confirmed: 0]
2018-08-27T03:07:20.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000024f13f4c6f... #36 @ 2018-08-27T03:07:20.500 signed by eosio [trxs: 0, lib: 35, confirmed: 0]
2018-08-27T03:07:21.003 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000025d0643de7... #37 @ 2018-08-27T03:07:21.000 signed by eosio [trxs: 0, lib: 36, confirmed: 0]
2018-08-27T03:07:21.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000026471c07dd... #38 @ 2018-08-27T03:07:21.500 signed by eosio [trxs: 0, lib: 37, confirmed: 0]
2018-08-27T03:07:22.002 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000027bbc8a26c... #39 @ 2018-08-27T03:07:22.000 signed by eosio [trxs: 0, lib: 38, confirmed: 0]
2018-08-27T03:07:22.504 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000028545abc49... #40 @ 2018-08-27T03:07:22.500 signed by eosio [trxs: 0, lib: 39, confirmed: 0]
2018-08-27T03:07:23.005 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000029269ff8fb... #41 @ 2018-08-27T03:07:23.000 signed by eosio [trxs: 0, lib: 40, confirmed: 0]
2018-08-27T03:07:23.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000002a8c80ee28... #42 @ 2018-08-27T03:07:23.500 signed by eosio [trxs: 0, lib: 41, confirmed: 0]
2018-08-27T03:07:24.009 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000002b5d10f873... #43 @ 2018-08-27T03:07:24.000 signed by eosio [trxs: 0, lib: 42, confirmed: 0]
2018-08-27T03:07:24.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000002cc0f82c37... #44 @ 2018-08-27T03:07:24.500 signed by eosio [trxs: 0, lib: 43, confirmed: 0]
2018-08-27T03:07:25.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000002d130d1aea... #45 @ 2018-08-27T03:07:25.000 signed by eosio [trxs: 0, lib: 44, confirmed: 0]
2018-08-27T03:07:25.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000002e234a5030... #46 @ 2018-08-27T03:07:25.500 signed by eosio [trxs: 0, lib: 45, confirmed: 0]
2018-08-27T03:07:26.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000002f88074d47... #47 @ 2018-08-27T03:07:26.000 signed by eosio [trxs: 0, lib: 46, confirmed: 0]
2018-08-27T03:07:26.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000304f9580d1... #48 @ 2018-08-27T03:07:26.500 signed by eosio [trxs: 0, lib: 47, confirmed: 0]
2018-08-27T03:07:27.007 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000315365aeb3... #49 @ 2018-08-27T03:07:27.000 signed by eosio [trxs: 0, lib: 48, confirmed: 0]
2018-08-27T03:07:27.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000326777579f... #50 @ 2018-08-27T03:07:27.500 signed by eosio [trxs: 0, lib: 49, confirmed: 0]
2018-08-27T03:07:28.007 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 0000003362af4829... #51 @ 2018-08-27T03:07:28.000 signed by eosio [trxs: 0, lib: 50, confirmed: 0]
2018-08-27T03:07:28.502 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000034f53e8c38... #52 @ 2018-08-27T03:07:28.500 signed by eosio [trxs: 0, lib: 51, confirmed: 0]
2018-08-27T03:07:29.007 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 00000035565b4de4... #53 @ 2018-08-27T03:07:29.000 signed by eosio [trxs: 0, lib: 52, confirmed: 0]
2018-08-27T03:07:29.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000000362ac51690... #54 @ 2018-08-27T03:07:29.500 signed by eosio [trxs: 0, lib: 53, confirmed: 0]
^C2018-08-27T03:07:29.562 thread-0 net_plugin.cpp:3046 plugin_shutdown ] shutdown..
2018-08-27T03:07:29.562 thread-0 net_plugin.cpp:3049 plugin_shutdown ] close acceptor
2018-08-27T03:07:29.562 thread-0 net_plugin.cpp:3052 plugin_shutdown ] close 0 connections
2018-08-27T03:07:29.562 thread-0 net_plugin.cpp:3060 plugin_shutdown ] exit shutdown
执行上命令后会在~/.local/share/eosio/nodeos/config
目录下创建配置文件config.ini
。
config.ini
以下为config.ini
文件内配置项的说明:
# the endpoint upon which to listen for incoming connections (eosio::bnet_plugin)
# 监听进来的连接
bnet-endpoint = 0.0.0.0:4321
# this peer will request only irreversible blocks from other nodes (eosio::bnet_plugin)
# 此peer将只从其他节点请求不可逆块。
bnet-follow-irreversible = 0
# the number of threads to use to process network messages (eosio::bnet_plugin)
# 用于处理网络消息的线程数
# bnet-threads =
# remote endpoint of other node to connect to; Use multiple bnet-connect options as needed to compose a network (eosio::bnet_plugin)
# 需要连接的其他远程端口,可以配置多个bnet-connect组成网络。
# bnet-connect =
# this peer will request no pending transactions from other nodes (eosio::bnet_plugin)
# 此peer将不会请求其他节点未确定的交易。
bnet-no-trx = false
# The string used to format peers when logging messages about them. Variables are escaped with ${<variable name>}.
# 定义peer网络下日志的格式。
# Available Variables:
# _name self-reported name
#
# _id self-reported ID (Public Key)
#
# _ip remote IP address of peer
#
# _port remote port number of peer
#
# _lip local IP address connected to peer
#
# _lport local port number connected to peer
#
# (eosio::bnet_plugin)
bnet-peer-log-format = ["${_name}" ${_ip}:${_port}]
# the location of the blocks directory (absolute path or relative to application data dir) (eosio::chain_plugin)
# 指定区块的目录
blocks-dir = "blocks"
# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints. (eosio::chain_plugin)
# 是一对区块高度+区块id,用来作为检查点。默认注释掉,不设置检查点。
# checkpoint =
# Override default WASM runtime (eosio::chain_plugin)
# 重写默认的WASM runtime。
# wasm-runtime =
# Override default maximum ABI serialization time allowed in ms (eosio::chain_plugin)
# ABI最大序列化时间
abi-serializer-max-time-ms = 15000
# Maximum size (in MiB) of the chain state database (eosio::chain_plugin)
# stateDB的最大空间MiB。
chain-state-db-size-mb = 1024
# Safely shut down node when free space remaining in the chain state database drops below this size (in MiB). (eosio::chain_plugin)
# 当stateDB的剩余可用空间小于配置大小时,安全的关闭节点。
chain-state-db-guard-size-mb = 128
# Maximum size (in MiB) of the reversible blocks database (eosio::chain_plugin)
# 可逆块DB的最大值。
reversible-blocks-db-size-mb = 340
# Safely shut down node when free space remaining in the reverseible blocks database drops below this size (in MiB). (eosio::chain_plugin)
# 当可逆块DB剩余可用空间小于此值时,安全的关闭节点。
reversible-blocks-db-guard-size-mb = 2
# print contract's output to console (eosio::chain_plugin)
# 将合约中的输出发送到控制台。
contracts-console = false
# Account added to actor whitelist (may specify multiple times) (eosio::chain_plugin)
# 参与者白名单。
# actor-whitelist =
# Account added to actor blacklist (may specify multiple times) (eosio::chain_plugin)
# 参与者黑名单。
# actor-blacklist =
# Contract account added to contract whitelist (may specify multiple times) (eosio::chain_plugin)
# 合约白名单。
# contract-whitelist =
# Contract account added to contract blacklist (may specify multiple times) (eosio::chain_plugin)
# 合约黑名单。
# contract-blacklist =
# Action (in the form code::action) added to action blacklist (may specify multiple times) (eosio::chain_plugin)
# Action黑名单。
# action-blacklist =
# Public key added to blacklist of keys that should not be included in authorities (may specify multiple times) (eosio::chain_plugin)
# 公钥黑名单。
# key-blacklist =
# Database read mode ("speculative", "head", or "read-only").
# 三种DB读取的模式
# In "speculative" mode database contains changes done up to the head block plus changes made by transactions not yet included to the blockchain.
# "speculative"模式下数据库将会包含最新区块(最新区块不一定是不可逆区块)与尚未确认的交易信息
# In "head" mode database contains changes done up to the current head block.
# "head"模式下数据库包含直到当前最新块的更改
# In "read-only" mode database contains incoming block changes but no speculative transaction processing.
# "read-only"模式下数据库包含传入块的更改但不包含speculative交易处理
# (eosio::chain_plugin)
read-mode = speculative
# Chain validation mode ("full" or "light").
# 链的确认模式
# In "full" mode all incoming blocks will be fully validated.
# "full"模式将传入的块进行完整验证。
# In "light" mode all incoming blocks headers will be fully validated; transactions in those validated blocks will be trusted
# "light"模式将传入的块头进行完整验证;这些块中的交易将被信任。
# (eosio::chain_plugin)
validation-mode = full
# Track actions which match receiver:action:actor. Actor may be blank to include all. Action and Actor both blank allows all from Recieiver. Receiver may not be blank. (eosio::history_plugin)
# 必须使用receiver:action:actor此种格式的值;actor可以为空,表示包含所有;receiver,action可不为空。此项表示按照指定的格式筛选跟踪指定的Action。此项会影响到transaction的查询。
# filter-on =
# Do not track actions which match receiver:action:actor. Action and Actor both blank excludes all from Reciever. Actor blank excludes all from reciever:action. Receiver may not be blank. (eosio::history_plugin)
# 与filter-on相反,按照指定的格式筛选不跟踪指定的Action。
# filter-out =
# PEM encoded trusted root certificate (or path to file containing one) used to validate any TLS connections made. (may specify multiple times)
# PEM编码的可信证书(或包含一个文件的路径)用于验证所有TLS连接。
# (eosio::http_client_plugin)
# https-client-root-cert =
# true: validate that the peer certificates are valid and trusted, false: ignore cert errors (eosio::http_client_plugin)
# true:验证在peer证书是否有效;false:忽略证书错误。
https-client-validate-peers = 1
# The local IP and port to listen for incoming http connections; set blank to disable. (eosio::http_plugin)
# 指定本地IP端口监听来自HTTP的连接;不填写则禁用。
http-server-address = 127.0.0.1:8888
# The local IP and port to listen for incoming https connections; leave blank to disable. (eosio::http_plugin)
# 指定本地IP端口监听来自HTTPS的连接;不填写则禁用。
# https-server-address =
# Filename with the certificate chain to present on https connections. PEM format. Required for https. (eosio::http_plugin)
# https-certificate-chain-file =
# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
# https-private-key-file =
# Specify the Access-Control-Allow-Origin to be returned on each request. (eosio::http_plugin)
# CORS"跨域资源共享"(Cross-origin resource sharing)
# 与CORS请求相关的字段,都以Access-Control-开头
# access-control-allow-origin =
# Specify the Access-Control-Allow-Headers to be returned on each request. (eosio::http_plugin)
# 同属于CORS"跨域资源共享"
# access-control-allow-headers =
# Specify the Access-Control-Max-Age to be returned on each request. (eosio::http_plugin)
# 同属于CORS"跨域资源共享"
# access-control-max-age =
# Specify if Access-Control-Allow-Credentials: true should be returned on each request. (eosio::http_plugin)
# 同属于CORS"跨域资源共享"
access-control-allow-credentials = false
# The maximum body size in bytes allowed for incoming RPC requests (eosio::http_plugin)
# 允许传入RPC请求的最大字节大小
max-body-size = 1048576
# Append the error log to HTTP responses (eosio::http_plugin)
# 在HTTP Resposes中追加错误日志。
verbose-http-errors = false
# If set to false, then any incoming "Host" header is considered valid (eosio::http_plugin)
# 如果设置为false,则任何传入的“Host”头均认为是有效的。
http-validate-host = 1
# Additionaly acceptable values for the "Host" header of incoming HTTP requests, can be specified multiple times. Includes http/s_server_address by default. (eosio::http_plugin)
# 允许特定的http"host"请求,默认会加入http/s_server_address的值。与http-validate-host结合使用。
# http-alias =
# The maximum number of pending login requests (eosio::login_plugin)
# 挂起的登录请求的最大数量。
max-login-requests = 1000000
# The maximum timeout for pending login requests (in seconds) (eosio::login_plugin)
# 登录请求的超时时间(以秒为单位)
max-login-timeout = 60
# The target queue size between nodeos and MongoDB plugin thread. (eosio::mongo_db_plugin)
# 节点与MongoDB插件线程之间的队列大小。
mongodb-queue-size = 1024
# The maximum size of the abi cache for serializing data. (eosio::mongo_db_plugin)
# 用于序列化数据的高速缓存的最大大小。
mongodb-abi-cache-size = 2048
# Required with --replay-blockchain, --hard-replay-blockchain, or --delete-all-blocks to wipe mongo db.This option required to prevent accidental wipe of mongo db. (eosio::mongo_db_plugin)
# 这个选项需要防止意外擦除mongo db。
mongodb-wipe = false
# If specified then only abi data pushed to mongodb until specified block is reached. (eosio::mongo_db_plugin)
# 如果指定了起始块,那么在到达指定块之前只有ABI数据被推送到MangGDB。
mongodb-block-start = 0
# MongoDB URI connection string, see: https://docs.mongodb.com/master/reference/connection-string/. If not specified then plugin is disabled. Default database 'EOS' is used if not specified in URI. Example: mongodb://127.0.0.1:27017/EOS (eosio::mongo_db_plugin)
# MongoDB URI连接字符串;如果不指定,插件被禁用;如果在URI中没有指定DB,则默认使用'EOS'。
# MongoDB URI参考:https://docs.mongodb.com/master/reference/connection-string/
# mongodb-uri =
# Enables storing blocks in mongodb. (eosio::mongo_db_plugin)
# 允许在MongoDB中存储块。
mongodb-store-blocks = 1
# Enables storing block state in mongodb. (eosio::mongo_db_plugin)
# 允许在MongoDB中存储块状态。
mongodb-store-block-states = 1
# Enables storing transactions in mongodb. (eosio::mongo_db_plugin)
# 允许在MongoDB中存储交易信息。
mongodb-store-transactions = 1
# Enables storing transaction traces in mongodb. (eosio::mongo_db_plugin)
# 允许在MongoDB中存储交易跟踪信息。
mongodb-store-transaction-traces = 1
# Enables storing action traces in mongodb. (eosio::mongo_db_plugin)
# 允许在MongoDB中存储动作跟踪。
mongodb-store-action-traces = 1
# Mongodb: Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. Default is * include everything. (eosio::mongo_db_plugin)
# mongodb-filter-on =
# Mongodb: Do not track actions which match receiver:action:actor. Action and Actor both blank excludes all from reciever. Actor blank excludes all from reciever:action. Receiver may not be blank. (eosio::mongo_db_plugin)
# mongodb-filter-out =
# The actual host:port used to listen for incoming p2p connections. (eosio::net_plugin)
# 实际的IP端口用于监听传入的p2p连接。
p2p-listen-endpoint = 0.0.0.0:9876
# An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint. (eosio::net_plugin)
# 外部可访问的IP端口,用于标识此节点。默认为p2p-listen-endpoint的值。
# p2p-server-address =
# 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)
# 要连接的peer的公共地址。根据需要使用多个p2p-peer-address选项来组成网络。
# p2p-peer-address =
# Maximum number of client nodes from any single IP address (eosio::net_plugin)
# 设置来自独立IP地址的最大客户端节点数数量。
p2p-max-nodes-per-host = 1
# The name supplied to identify this node amongst the peers. (eosio::net_plugin)
# 提供的名称用于标识此节点。
agent-name = "EOS Test Agent"
# Can be 'any' or 'producers' or 'specified' or 'none'. If 'specified', peer-key must be specified at least once. If only 'producers', peer-key is not required. 'producers' and 'specified' may be combined. (eosio::net_plugin)
# 可以设置为'any' or 'producers' or 'specified' or 'none'来确立允许哪种连接。
# 'specified'必须至少指定一个peer-key。
# 'producer'不需要peer-key。
allowed-connection = any
# Optional public key of peer allowed to connect. May be used multiple times. (eosio::net_plugin)
# 与allowed-connection结合使用;允许连接的可选公钥,可以配置多个。
# peer-key =
# Tuple of [PublicKey, WIF private key] (may specify multiple times) (eosio::net_plugin)
# peer-private-key =
# Maximum number of clients from which connections are accepted, use 0 for no limit (eosio::net_plugin)
# 可以连接的最大客户端数量,0为无限制。
max-clients = 25
# number of seconds to wait before cleaning up dead connections (eosio::net_plugin)
# 清除不可用连接的等待时间。
connection-cleanup-period = 30
# max connection cleanup time per cleanup call in millisec (eosio::net_plugin)
# 每次清理最大连接间隔。
max-cleanup-time-msec = 10
# True to require exact match of peer network version. (eosio::net_plugin)
# 如果为true,则要求peer网络版本完全一致。
network-version-match = 0
# number of blocks to retrieve in a chunk from any individual peer during synchronization (eosio::net_plugin)
# 在同步期间从单个peer中检索块的数目。
sync-fetch-span = 100
# maximum sizes of transaction or block messages that are sent without first sending a notice (eosio::net_plugin)
# 在第一次不发出通知时,事务或块消息的最大大小
max-implicit-request = 1500
# Enable expirimental socket read watermark optimization (eosio::net_plugin)
use-socket-read-watermark = 0
# The string used to format peers when logging messages about them. Variables are escaped with ${<variable name>}.
# 定义peer下日志的格式。
# Available Variables:
# _name self-reported name
#
# _id self-reported ID (64 hex characters)
#
# _sid first 8 characters of _peer.id
#
# _ip remote IP address of peer
#
# _port remote port number of peer
#
# _lip local IP address connected to peer
#
# _lport local port number connected to peer
#
# (eosio::net_plugin)
peer-log-format = ["${_name}" ${_ip}:${_port}]
# Enable block production, even if the chain is stale. (eosio::producer_plugin)
# 开启区块生产,即使链是stale.
enable-stale-production = false
# Start this node in a state where production is paused (eosio::producer_plugin)
# 在生产暂停的情况下开启此节点。
pause-on-startup = false
# Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid (eosio::producer_plugin)
# 限制推送事务代码在被认为无效之前允许执行的最大时间(毫秒)。
max-transaction-time = 30
# Limits the maximum age (in seconds) of the DPOS Irreversible Block for a chain this node will produce blocks on (use negative value to indicate unlimited) (eosio::producer_plugin)
# 限制该节点在DPOS共识下生成不可逆块的最大时间(以秒为单位)(使用负值指示无限)
max-irreversible-block-age = -1
# ID of producer controlled by this node (e.g. inita; may specify multiple times) (eosio::producer_plugin)
# 由这个节点控制的生产者ID.
# producer-name =
# (DEPRECATED - Use signature-provider instead) Tuple of [public key, WIF private key] (may specify multiple times) (eosio::producer_plugin)
# private-key =
# Key=Value pairs in the form <public-key>=<provider-spec>
# Where:
# <public-key> is a string form of a vaild EOSIO public key
#
# <provider-spec> is a string in the form <provider-type>:<data>
#
# <provider-type> is KEY, or KEOSD
#
# KEY:<data> is a string form of a valid EOSIO private key which maps to the provided public key
#
# KEOSD:<data> is the URL where keosd is available and the approptiate wallet(s) are unlocked (eosio::producer_plugin)
signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
# Limits the maximum time (in milliseconds) that is allowd for sending blocks to a keosd provider for signing (eosio::producer_plugin)
# 限制keosd对接收的块签名所需要的最大时间(毫秒)。
keosd-provider-timeout = 5
# account that can not access to extended CPU/NET virtual resources (eosio::producer_plugin)
# 灰名单,无法访问扩展的CPU/NET虚拟资源的帐户。
# greylist-account =
# offset of non last block producing time in micro second. Negative number results in blocks to go out sooner, and positive number results in blocks to go out later (eosio::producer_plugin)
produce-time-offset-us = 0
# offset of last block producing time in micro second. Negative number results in blocks to go out sooner, and positive number results in blocks to go out later (eosio::producer_plugin)
last-block-time-offset-us = 0
# ratio between incoming transations and deferred transactions when both are exhausted (eosio::producer_plugin)
incoming-defer-ratio = 1
# Lag in number of blocks from the head block when selecting the reference block for transactions (-1 means Last Irreversible Block) (eosio::txn_test_gen_plugin)
txn-reference-block-lag = 0
# Plugin(s) to enable, may be specified multiple times
# 设置启动时要使用的插件。
# plugin =
我们上边使用的启动命令是:
$ ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
在config.ini
中修改修改以下配置项,之后便可以直接使用./nodeos
来启动。
# 对应启动命令中 -e
enable-stale-production = true
# 对应启动命令中 -p eosio
producer-name = eosio
# 对应启动命令中 -plugin ******
plugin = eosio::producer_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
plugin = eosio::history_api_plugin
建议在配置中将verbose-http-errors=false
改为true
,便于在发开中发现各种奇怪的问题。
genesis.json
在之前的版本中genesis.json
不存在时,会在启动时随着config.ini
一起创建并加载使用,但是新版中取消了这一设定;规定只有在启动时使用命令--genesis-json XXXXXX
指定了genesis.json
才会加载,否则会采用默认的配置。
以下为genesis.json
文件内配置项:
{
"initial_timestamp": "2018-06-01T12:00:00.000",
"initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"initial_configuration": {
"max_block_net_usage": 1048576,
"target_block_net_usage_pct": 1000,
"max_transaction_net_usage": 524288,
"base_per_transaction_net_usage": 12,
"net_usage_leeway": 500,
"context_free_discount_net_usage_num": 20,
"context_free_discount_net_usage_den": 100,
"max_block_cpu_usage": 200000,
"target_block_cpu_usage_pct": 1000,
"max_transaction_cpu_usage": 150000,
"min_transaction_cpu_usage": 100,
"max_transaction_lifetime": 3600,
"deferred_trx_expiration_window": 600,
"max_transaction_delay": 3888000,
"max_inline_action_size": 4096,
"max_inline_action_depth": 4,
"max_authority_depth": 6
}
}
2018年9月3日16点02分修正部分说明。
.
.
.
.
.
.
.
【本文章出自NM1024.com,转载请注明作者出处。】
>>转载请注明原文链接地址:EOS单节点启动与配置说明
它为啥是shutdown “net_plugin.cpp:3046 plugin_shutdown”
不是应该驻留吗
你看到的这一行,完整是
^C2018-08-27T03:07:29.562 thread-0 net_plugin.cpp:3046 plugin_shutdown ] shutdown..
前边有^C(Ctrl+C),意思是我在这一步执行了退出,所以shutdown了。
I got following error while running code:
2019-06-26T10:06:34.623 thread-0 chain_plugin.cpp:317 plugin_initialize ] initializing chain plugin
2019-06-26T10:06:34.623 thread-0 chain_plugin.cpp:556 plugin_initialize ] Starting up fresh blockchain with default genesis state.
sh: 1: 30032: not found
2019-06-26T10:06:34.624 thread-0 chain_plugin.cpp:317 plugin_initialize ] initializing chain plugin
2019-06-26T10:06:34.624 thread-0 chain_plugin.cpp:556 plugin_initialize ] Starting up fresh blockchain with default genesis state.
2019-06-26T10:06:34.906 thread-0 http_plugin.cpp:344 plugin_initialize ] configured http to listen on 127.0.0.1:8888
2019-06-26T10:06:34.906 thread-0 net_plugin.cpp:2894 plugin_initialize ] Initialize net plugin
2019-06-26T10:06:34.906 thread-0 net_plugin.cpp:2920 plugin_initialize ] host: 0.0.0.0 port: 9876
2019-06-26T10:06:34.906 thread-0 net_plugin.cpp:2991 plugin_initialize ] my node_id is f3851eb429291c06fdad3631d2edfcb93c44ee8c8c0a1972f1378f5a50cdcc39
2019-06-26T10:06:34.906 thread-0 main.cpp:105 main ] nodeos version v1.2.5-dirty
2019-06-26T10:06:34.906 thread-0 main.cpp:106 main ] eosio root is /home/bob/.local/share
2019-06-26T10:06:34.906 thread-0 controller.cpp:1380 startup ] No head block in fork db, perhaps we need to replay
2019-06-26T10:06:34.906 thread-0 controller.cpp:372 initialize_fork_db ] Initializing new blockchain with genesis state
2019-06-26T10:06:34.938 thread-0 chain_plugin.cpp:648 plugin_startup ] starting chain in read/write mode
2019-06-26T10:06:34.938 thread-0 chain_plugin.cpp:652 plugin_startup ] Blockchain started; head block is #1, genesis timestamp is 2018-06-01T12:00:00.000
2019-06-26T10:06:34.938 thread-0 producer_plugin.cpp:648 plugin_startup ] producer plugin: plugin_startup() begin
2019-06-26T10:06:34.938 thread-0 producer_plugin.cpp:670 plugin_startup ] Launching block production for 1 producers at 2019-06-26T10:06:34.938.
2019-06-26T10:06:34.985 thread-0 producer_plugin.cpp:682 plugin_startup ] producer plugin: plugin_startup() end
2019-06-26T10:06:34.985 thread-0 http_plugin.cpp:401 plugin_startup ] start listening for http requests
2019-06-26T10:06:34.985 thread-0 http_plugin.cpp:408 plugin_startup ] http service failed to start: Address already in use
2019-06-26T10:06:35.013 thread-0 http_plugin.cpp:344 plugin_initialize ] configured http to listen on 127.0.0.1:8888
2019-06-26T10:06:35.013 thread-0 net_plugin.cpp:2894 plugin_initialize ] Initialize net plugin
2019-06-26T10:06:35.013 thread-0 net_plugin.cpp:2920 plugin_initialize ] host: 0.0.0.0 port: 9876
2019-06-26T10:06:35.014 thread-0 net_plugin.cpp:2991 plugin_initialize ] my node_id is 1ada8546526b4e476074753edebcaf303f522dd67519b2d2c0d5192d72f419b7
2019-06-26T10:06:35.014 thread-0 main.cpp:105 main ] nodeos version v1.2.5-dirty
2019-06-26T10:06:35.014 thread-0 main.cpp:106 main ] eosio root is /home/bob/.local/share
2019-06-26T10:06:35.014 thread-0 controller.cpp:1380 startup ] No head block in fork db, perhaps we need to replay
2019-06-26T10:06:35.014 thread-0 controller.cpp:372 initialize_fork_db ] Initializing new blockchain with genesis state