一.单测试节点运行方法
1.首先将编译好的eosd存放于操作系统的任意位置,我们这里为/home/uhdesk/eos/build/programs/eosd
在eosd目录下创建data-dir目录,并在data-dir目录下创建两个配置文件config.ini和genesis.json
config.ini配置内容为:
# Track only transactions whose scopes involve the listed accounts. Default is to track all transactions.
# filter_on_accounts =
# Limits the maximum time (in milliseconds) processing a single get_transactions call.
get-transactions-time-limit = 3
# File to read Genesis State from
genesis-json =/home/uhdesk/eos/build/programs/eosd/data-dir/genesis.json
# override the initial timestamp in the Genesis State file
# genesis-timestamp =
# the location of the block log (absolute path or relative to application data dir)
block-log-dir = "blocks"
# Sets the block interval in seconds.
block-interval-seconds = 1
# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =
# Limits the maximum time (in milliseconds) that is allowed a transaction's code to execute from a received block.
rcvd-block-trans-execution-time = 72
# Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute.
trans-execution-time = 18
# Limits the maximum time (in milliseconds) that is allowed a transaction's code to execute while creating a block.
create-block-trans-execution-time = 18
# The time frame, in seconds, that the per-authorized-account-transaction-msg-rate-limit is imposed over.
per-authorized-account-transaction-msg-rate-limit-time-frame-sec = 18
# Limits the maximum rate of transaction messages that an account is allowed each per-authorized-account-transaction-msg-rate-limit-time-frame-sec.
per-authorized-account-transaction-msg-rate-limit = 1800
# The time frame, in seconds, that the per-code-account-transaction-msg-rate-limit is imposed over.
per-code-account-transaction-msg-rate-limit-time-frame-sec = 18
# Limits the maximum rate of transaction messages that an account's code is allowed each per-code-account-transaction-msg-rate-limit-time-frame-sec.
per-code-account-transaction-msg-rate-limit = 18000
# Limits the maximum database storage that an account's code is allowed.
per-code-account-max-storage-db-limit-mbytes = 5
# The overhead to apply per row for approximating total database storage.
row-overhead-db-limit-bytes = 32
# The maximum depth the pending transaction queue will be allowed to reach till new pushed transactions are rejected.
pending-txn-depth-limit = 1000
# The maximum allowed for generating a block before subsequent transactions get put back on the pending transaction queue.
gen-block-time-limit-msec = 200
# open the database in read only mode
readonly = 0
# the location of the chain shared memory files (absolute path or relative to application data dir)
shared-file-dir = "blockchain"
# Minimum size MB of database shared memory file
shared-file-size = 8192
# Time to wait, in milliseconds, between creating next faucet created account.
faucet-create-interval-ms = 1000
# Name to use as creator for faucet created accounts.
faucet-name = faucet
# [public key, WIF private key] for signing for faucet creator account
faucet-private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
# The local IP and port to listen for incoming http connections.
http-server-address = 127.0.0.1:8888
# Specify the Access-Control-Allow-Origin to be returned on each request.
# access-control-allow-origin =
# Specify the Access-Control-Allow-Headers to be returned on each request.
# access-control-allow-headers =
# Specify if Access-Control-Allow-Credentials: true should be returned on each request.
access-control-allow-credentials = false
# The actual host:port used to listen for incoming p2p connections.
p2p-listen-endpoint = 0.0.0.0:9876
# An externally accessible host:port for identifying this node. Defaults to 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.
# p2p-peer-address =
# The name supplied to identify this node amongst the peers.
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.
allowed-connection = any
# Optional public key of peer allowed to connect. May be used multiple times.
# peer-key =
# Tuple of [PublicKey, WIF private key] (may specify multiple times)
# peer-private-key =
# Log level: one of 'all', 'debug', 'info', 'warn', 'error', or 'off'
log-level-net-plugin = info
# Maximum number of clients from which connections are accepted, use 0 for no limit
max-clients = 25
# number of seconds to wait before cleaning up dead connections
connection-cleanup-period = 30
# True to require exact match of peer network version.
network-version-match = 0
# number of blocks to retrieve in a chunk from any individual peer during synchronization
sync-fetch-span = 100
# Enable block production, even if the chain is stale.
#enable-stale-production = false
# Percent of producers (0-99) that must be participating in order to produce blocks
required-participation = false
# ID of producer controlled by this node (e.g. inita; may specify multiple times)
# producer-name =
# Tuple of [public key, WIF private key] (may specify multiple times)
private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
# Plugin(s) to enable, may be specified multiple times
# plugin =
# Enable production on a stale chain, since a single-node test chain is pretty much always stale
enable-stale-production = true
# Enable block production with the testnet producers
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
# Load the block producer plugin, so you can produce blocks
plugin = eosio::producer_plugin
# Wallet plugin
plugin = eosio::wallet_api_plugin
# As well as API and HTTP plugins
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
genesis.json配置内容为:
{
"initial_timestamp": "2017-03-30T12:00:00",
"initial_parameters": {
"maintenance_interval": 86400,
"maintenance_skip_slots": 3,
"maximum_transaction_size": 2048,
"maximum_block_size": 2048000000,
"maximum_time_until_expiration": 86400,
"maximum_producer_count": 1001
},
"immutable_parameters": {
"min_producer_count": 21
},
"initial_accounts": [{
"name": "inita",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initb",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initc",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initd",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "inite",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initf",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initg",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "inith",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initi",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initj",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initk",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initl",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initm",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initn",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "inito",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initp",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initq",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initr",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "inits",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initt",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
},{
"name": "initu",
"owner_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"liquid_balance": "1000000.0000 EOS"
}],
"initial_producers": [{
"owner_name": "inita",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initb",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initc",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initd",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "inite",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initf",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initg",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "inith",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initi",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initj",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initk",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initl",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initm",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initn",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "inito",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initp",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initq",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initr",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "inits",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initt",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "initu",
"block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
}],
"initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000"
}
在当前目录下运行eosd即可
./eosd
我们即将看到eos运行日志:
uhdesk@uhdesk-VirtualBox:~/eos/build/programs/eosd$ ./eosd
1123887ms chain_plugin.cpp:126 plugin_initialize ] initializing chain plugin
1123887ms wasm_interface.cpp:757 get ] Runtime::init
1123888ms producer_plugin.cpp:170 plugin_initialize ] Public Key: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
1123888ms wallet_plugin.cpp:34 plugin_initialize ] initializing wallet plugin
1123888ms http_plugin.cpp:138 plugin_initialize ] host: 127.0.0.1 port: 8888
1123888ms http_plugin.cpp:141 plugin_initialize ] configured http to listen on 127.0.0.1:8888
1123888ms net_plugin.cpp:2521 plugin_initialize ] Initialize net plugin
1123888ms net_plugin.cpp:2543 plugin_initialize ] Setting net_plugin logging level to info
1123888ms net_plugin.cpp:2571 plugin_initialize ] host: 0.0.0.0 port: 9876
1123889ms net_plugin.cpp:2650 plugin_initialize ] my node_id is 15fad4a1dcff08c5c8053b6adf557da0d02f7140f58997eb2e0bccafd7114d39
1123889ms main.cpp:59 main ] eosd version bcb5bf75
1123891ms block_log.cpp:92 open ] Opening block log at /home/uhdesk/eos/build/programs/eosd/data-dir/blocks/blocks.log
1123891ms block_log.cpp:120 open ] Log is nonempty
1123891ms block_log.cpp:128 open ] Index is nonempty
1123894ms chain_plugin.cpp:250 plugin_startup ] starting chain in read/write mode
1123894ms chain_plugin.cpp:255 plugin_startup ] Blockchain started; head block is #344, genesis timestamp is 2017-03-30T12:00:00
1123894ms producer_plugin.cpp:181 plugin_startup ] producer plugin: plugin_startup() begin
1123895ms producer_plugin.cpp:186 plugin_startup ] Launching block production for 21 producers.
1123895ms producer_plugin.cpp:196 plugin_startup ] producer plugin: plugin_startup() end
1123895ms http_plugin.cpp:153 plugin_startup ] start processing http thread
1123895ms http_plugin.cpp:210 plugin_startup ] start listening for http requests
1123895ms http_plugin.cpp:215 plugin_startup ] http io service exit
1123895ms wallet_api_plugin.cpp:69 plugin_startup ] starting wallet_api_plugin
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/create
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/get_public_keys
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/import_key
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/list_keys
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/list_wallets
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/lock
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/lock_all
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/open
1123895ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/set_timeout
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/sign_transaction
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/wallet/unlock
1123896ms chain_api_plugin.cpp:60 plugin_startup ] starting chain_api_plugin
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/abi_bin_to_json
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/abi_json_to_bin
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/get_account
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/get_block
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/get_code
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/get_info
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/get_required_keys
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/get_table_rows
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/push_block
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/push_transaction
1123896ms http_plugin.cpp:239 add_handler ] add api url: /v1/chain/push_transactions
1123896ms net_plugin.cpp:2662 plugin_startup ] starting listener, max clients is 25
1124012ms chain_controller.cpp:1046 validate_block_heade ] head_block_time 2018-02-27T09:08:37, next_block 2018-02-28T03:18:44, block_interval 1
1124013ms chain_controller.cpp:1048 validate_block_heade ] Did not produce block within block_interval 1, took 65407000ms)
1124409ms chain_controller.cpp:208 _push_block ] initq #345 @2018-02-28T03:18:44 | 0 trx, 0 pending, exectime_ms=397
1124409ms producer_plugin.cpp:246 block_production_loo ] initq generated block #345 @ 2018-02-28T03:18:44 with 0 trxs 0 pending
1125003ms chain_controller.cpp:208 _push_block ] initi #346 @2018-02-28T03:18:45 | 0 trx, 0 pending, exectime_ms=0
1125004ms producer_plugin.cpp:246 block_production_loo ] initi generated block #346 @ 2018-02-28T03:18:45 with 0 trxs 0 pending
1126013ms chain_controller.cpp:208 _push_block ] initk #347 @2018-02-28T03:18:46 | 0 trx, 0 pending, exectime_ms=0
1126014ms producer_plugin.cpp:246 block_production_loo ] initk generated block #347 @ 2018-02-28T03:18:46 with 0 trxs 0 pending