ubuntu16.04运行EOS3.0

上文《ubuntu16.04编译eos3.0》已编译好了EOS的程序

一 运行nodeos用于同步区块节点程序

./nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::account_history_api_plugin 

-e 启用区块生成,即使链比较陈旧
-p 由该节点控制的生产者的ID
--plugin 启用插件
eosio::wallet_api_plugin 启用了钱包api接口
eosio::chain_api_plugin 启用区块api插件接口
eosio::account_history_api_plugin 启用账户历史api插件接口

运行日志如下

 ./nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::account_history_api_plugin 
2567461ms thread-0   wallet_plugin.cpp:41          plugin_initialize    ] initializing wallet plugin
2567461ms thread-0   http_plugin.cpp:141           plugin_initialize    ] host: 127.0.0.1 port: 8888 
2567462ms thread-0   http_plugin.cpp:144           plugin_initialize    ] configured http to listen on 127.0.0.1:8888
2567462ms thread-0   chain_plugin.cpp:99           plugin_initialize    ] initializing chain plugin
2567462ms thread-0   net_plugin.cpp:2622           plugin_initialize    ] Initialize net plugin
2567462ms thread-0   net_plugin.cpp:2644           plugin_initialize    ] Setting net_plugin logging level to info
2567462ms thread-0   net_plugin.cpp:2672           plugin_initialize    ] host: 0.0.0.0 port: 9876 
2567462ms thread-0   net_plugin.cpp:2748           plugin_initialize    ] my node_id is c409889e9990c1c70684e7e10da1cb8270224d7d97ec6a5be05e12e7f834044a
2567462ms thread-0   main.cpp:90                   main                 ] nodeos version d9ad8eec
2567462ms thread-0   main.cpp:91                   main                 ] eosio root is /home/li/.local/share
2567462ms thread-0   http_plugin.cpp:213           plugin_startup       ] start listening for http requests
2567462ms thread-0   wallet_api_plugin.cpp:70      plugin_startup       ] starting wallet_api_plugin
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/create
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/get_public_keys
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/import_key
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/list_keys
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/list_wallets
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/lock
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/lock_all
2567462ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/open
2567463ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/set_timeout
2567463ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/sign_transaction
2567463ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/wallet/unlock
2567463ms thread-0   chain_plugin.cpp:178          plugin_startup       ] 
 generating default genesis file /home/li/.local/share/eosio/nodeos/config/genesis.json
2567565ms thread-0   chain_plugin.cpp:208          plugin_startup       ] starting chain in read/write mode
2567565ms thread-0   chain_plugin.cpp:213          plugin_startup       ] Blockchain started; head block is #0, genesis timestamp is 2018-03-01T12:00:00.000
2567565ms thread-0   chain_api_plugin.cpp:62       plugin_startup       ] starting chain_api_plugin
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/abi_bin_to_json
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/abi_json_to_bin
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_account
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_block
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_code
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_currency_balance
2567565ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_currency_stats
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_info
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_required_keys
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/get_table_rows
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/push_block
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/push_transaction
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/chain/push_transactions
2567566ms thread-0   account_history_api_plugin.cpp:45 plugin_startup       ] starting account_history_api_plugin
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/account_history/get_controlled_accounts
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/account_history/get_key_accounts
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/account_history/get_transaction
2567566ms thread-0   http_plugin.cpp:242           add_handler          ] add api url: /v1/account_history/get_transactions
2567566ms thread-0   net_plugin.cpp:2760           plugin_startup       ] starting listener, max clients is 25
2567566ms thread-0   producer_plugin.cpp:161       plugin_startup       ] producer plugin:  plugin_startup() begin
2567566ms thread-0   producer_plugin.cpp:166       plugin_startup       ] Launching block production for 1 producers.

*******************************
*                             *
*   ------ NEW CHAIN ------   *
*   -  Welcome to EOSIO!  -   *
*   -----------------------   *
*                             *
*******************************

Your genesis seems to have an old timestamp
Please consider using the --genesis-timestamp option to give your genesis a recent timestamp

2567566ms thread-0   producer_plugin.cpp:176       plugin_startup       ] producer plugin:  plugin_startup() end
eosio generated block 893d20e0... #1 @ 2018-04-26T09:42:48.000 with 0 trxs, lib: 0
eosio generated block 1dd3c44f... #2 @ 2018-04-26T09:42:48.500 with 0 trxs, lib: 1
eosio generated block e7ea6789... #3 @ 2018-04-26T09:42:49.000 with 0 trxs, lib: 2
eosio generated block d1f3fefc... #4 @ 2018-04-26T09:42:49.500 with 0 trxs, lib: 3
2569795ms thread-0   net_plugin.cpp:2774           plugin_shutdown      ] shutdown..
2569795ms thread-0   net_plugin.cpp:2777           plugin_shutdown      ] close acceptor
2569795ms thread-0   net_plugin.cpp:2780           plugin_shutdown      ] close 0 connections
2569795ms thread-0   net_plugin.cpp:2788           plugin_shutdown      ] exit shutdown

<1 产生了nodeid
“my node_id is dedbb9ce492b3c20f2a2bdc70a3679b891fd3cd0f3cd62a3ce40b8050ad2198a”
<2 产生了区块创世状态文件
" generating default genesis file /home/li/.local/share/eosio/nodeos/config/genesis.json"

二 运行 cleos命令行交互程序

./cleos -p 8888 get info
-p 制定要链接的nodeos端口
get 从区块链中检索各项和信息

显示了当前最近区块的状态信息

{
  "server_version": "d9ad8eec",
  "head_block_num": 28,
  "last_irreversible_block_num": 27,
  "head_block_id": "0000001c4eb61c1d8c5f6232ae3588f478717f470878a2a2adc8715d47b6c25f",
  "head_block_time": "2018-04-26T09:52:06",
  "head_block_producer": "eosio"
}

8888开放的http端口,已经在config.ini中,配置好了(见附加的config.ini内容)
“http-server-address = 127.0.0.1:8888”

三 引用

http://liyuechun.org/2018/04/04/eos-dev/ 《第一篇 - 手把手教你理清EOS各种开发环境搭建来龙去脉》

https://github.com/EOSIO/eos/wiki/Local-Environment#4-creating-and-launching-a-single-node-testnet 《Creating and Launching a Single Node Testnet》

四总结

《1 学会了nodeos,cleos的命令行基本参数
《2 了解创世文件genesis.json,和config.ini结构

五 附加

<1 创世文件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 config.ini内容

cat config.ini 
# Track only transactions whose scopes involve the listed accounts. Default is to track all transactions. (eosio::account_history_plugin)
# filter_on_accounts = 

# Limits the maximum time (in milliseconds) processing a single get_transactions call. (eosio::account_history_plugin)
get-transactions-time-limit = 3

# File to read Genesis State from (eosio::chain_plugin)
genesis-json = "genesis.json"

# override the initial timestamp in the Genesis State file (eosio::chain_plugin)
# genesis-timestamp = 

# the location of the block log (absolute path or relative to application data dir) (eosio::chain_plugin)
block-log-dir = "blocks"

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints. (eosio::chain_plugin)
# checkpoint = 

# Limits the maximum time (in milliseconds) that a reversible block is allowed to run before being considered invalid (eosio::chain_plugin)
max-reversible-block-time = -1

# Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid (eosio::chain_plugin)
max-pending-transaction-time = -1

# Limits the maximum time (in milliseconds) that is allowed a to push deferred transactions at the start of a block (eosio::chain_plugin)
max-deferred-transaction-time = 20

# Override default WASM runtime (eosio::chain_plugin)
# wasm-runtime = 

# Time to wait, in milliseconds, between creating next faucet created account. (eosio::faucet_testnet_plugin)
faucet-create-interval-ms = 1000

# Name to use as creator for faucet created accounts. (eosio::faucet_testnet_plugin)
faucet-name = faucet

# [public key, WIF private key] for signing for faucet creator account (eosio::faucet_testnet_plugin)
faucet-private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]

# The local IP and port to listen for incoming http connections. (eosio::http_plugin)
http-server-address = 127.0.0.1:8888

# Specify the Access-Control-Allow-Origin to be returned on each request. (eosio::http_plugin)
# access-control-allow-origin = 

# Specify the Access-Control-Allow-Headers to be returned on each request. (eosio::http_plugin)
# access-control-allow-headers = 

# Specify if Access-Control-Allow-Credentials: true should be returned on each request. (eosio::http_plugin)
access-control-allow-credentials = false

# The queue size between nodeos and MongoDB plugin thread. (eosio::mongo_db_plugin)
mongodb-queue-size = 256

# 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. (eosio::mongo_db_plugin)
# mongodb-uri = 

# The actual host:port used to listen for incoming p2p connections. (eosio::net_plugin)
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)
# 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)
# p2p-peer-address = 

# 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)
allowed-connection = any

# Optional public key of peer allowed to connect.  May be used multiple times. (eosio::net_plugin)
# peer-key = 

# Tuple of [PublicKey, WIF private key] (may specify multiple times) (eosio::net_plugin)
# peer-private-key = 

# Log level: one of 'all', 'debug', 'info', 'warn', 'error', or 'off' (eosio::net_plugin)
log-level-net-plugin = info

# Maximum number of clients from which connections are accepted, use 0 for no limit (eosio::net_plugin)
max-clients = 25

# number of seconds to wait before cleaning up dead connections (eosio::net_plugin)
connection-cleanup-period = 30

# True to require exact match of peer network version. (eosio::net_plugin)
network-version-match = 0

# number of blocks to retrieve in a chunk from any individual peer during synchronization (eosio::net_plugin)
sync-fetch-span = 100

# Enable block production, even if the chain is stale. (eosio::producer_plugin)
enable-stale-production = false

# Percent of producers (0-100) that must be participating in order to produce blocks (eosio::producer_plugin)
required-participation = 33

# ID of producer controlled by this node (e.g. inita; may specify multiple times) (eosio::producer_plugin)
# producer-name = 

# Tuple of [public key, WIF private key] (may specify multiple times) (eosio::producer_plugin)
private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]

# The path of the wallet files (absolute path or relative to application data dir) (eosio::wallet_plugin)
wallet-dir = "."

# Timeout for unlocked wallet in seconds. 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 = 

# eosio key that will be imported automatically when a wallet is created. (eosio::wallet_plugin)
# eosio-key = 

# Plugin(s) to enable, may be specified multiple times
# plugin = 

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,560评论 4 361
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,104评论 1 291
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,297评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,869评论 0 204
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,275评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,563评论 1 216
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,833评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,543评论 0 197
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,245评论 1 241
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,512评论 2 244
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,011评论 1 258
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,359评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,006评论 3 235
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,062评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,825评论 0 194
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,590评论 2 273
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,501评论 2 268

推荐阅读更多精彩内容