您当前的位置: 首页 >  区块链
  • 4浏览

    0关注

    284博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

【区块链 | EOS】重启服务器后,按照官方命令启动本地私有网络节点报错的解决办法!!

区块链(Web3)开发工程师 发布时间:2018-11-29 19:30:52 ,浏览量:4

下边的方法已失效,新方法为:https://blog.csdn.net/qq_28505809/article/details/85295838     一,开启keosd及报错处理办法!

注意:这步如果出现问题 

 这个错是因为当前已经启动了keosd,可以使用

#1. 查询是否已经启动此命令,获取进程ID
ps -ef |grep keosd

#2. 输出
root@ubuntu:/home/guoyi# ps -ef |grep keosd
root       3312   2396  0 18:57 pts/0    00:00:00 keosd
root       3460   2396  0 19:14 pts/0    00:00:00 grep --color=auto keosd

#3. 杀死进程
root@ubuntu:/home/guoyi# kill 3312
root@ubuntu:/home/guoyi# ps -ef |grep keosd
root       3473   2396  0 19:16 pts/0    00:00:00 grep --color=auto keosd
[1]+  已完成               keosd


#4. 重新启动即可
root@ubuntu:/home/guoyi# keosd &
[1] 3475
root@ubuntu:/home/guoyi# info  2018-11-29T11:16:56.335 thread-0  wallet_plugin.cpp:42          plugin_initialize    ] initializing wallet plugin
info  2018-11-29T11:16:56.335 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/keosd/stop
info  2018-11-29T11:16:56.336 thread-0  wallet_api_plugin.cpp:73      plugin_startup       ] starting wallet_api_plugin
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/create
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/create_key
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/get_public_keys
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/import_key
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/list_keys
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/list_wallets
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/lock
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/lock_all
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/open
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/remove_key
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/set_timeout
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/sign_digest
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/sign_transaction
info  2018-11-29T11:16:56.336 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/unlock

二,nodeos开启出错

报错内容如下:

rethrow database dirty flag set: 
    {"what":"database dirty flag set"}
    thread-0  chain_plugin.cpp:684 plugin_initialize
error 2018-11-29T11:04:26.837 thread-0  main.cpp:125                  main                 ] database dirty flag set (likely due to unclean shutdown): replay required

解决办法:

同样杀死进程重新开启!
#1. 查询到进程ID
ps -ef |grep nodeos

#2. 杀死
kill 进程ID

#3. 此时需要重新启动 NODEOS 
启动命令为:

root@ubuntu:/home/guoyi# nodeos -e -p eosio 
--plugin eosio::producer_plugin 
--plugin eosio::chain_api_plugin  
--access-control-allow-origin=* 
--contracts-console 
--http-validate-host=false 
—filter-on=‘*’ >> nodeos.log 2>&1 &


nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin -d /home/contracts/eosio/data --config-dir /home/contracts/eosio/config --access-control-allow-origin=* --contracts-console --http-validate-host=false —filter-on=‘*’ >> nodeos.log 2>&1 &


#原命令为:
nodeos -e -p eosio \
--plugin eosio::producer_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::http_plugin \
-d /home/contracts/eosio/data \
--config-dir /home/contracts/eosio/config \
--access-control-allow-origin=* \
--contracts-console \
--http-validate-host=false \
—filter-on=‘*’ >> nodeos.log 2>&1 &

但重新后就不可用这个命令!切记
 三,正常日志

此时在打印日志即为:

T11:26:54.500 signed by eosio [trxs: 0, lib: 861, confirmed: 0]
info  2018-11-29T11:26:55.001 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 0000035f2f9f9e4f... #863 @ 2018-11-29T11:26:55.000 signed by eosio [trxs: 0, lib: 862, confirmed: 0]
info  2018-11-29T11:26:55.501 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 00000360993f2db0... #864 @ 2018-11-29T11:26:55.500 signed by eosio [trxs: 0, lib: 863, confirmed: 0]
info  2018-11-29T11:26:56.001 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 00000361fe16f01b... #865 @ 2018-11-29T11:26:56.000 signed by eosio [trxs: 0, lib: 864, confirmed: 0]
info  2018-11-29T11:26:56.501 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 0000036252707355... #866 @ 2018-11-29T11:26:56.500 signed by eosio [trxs: 0, lib: 865, confirmed: 0]
info  2018-11-29T11:26:57.001 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 000003631edd3521... #867 @ 2018-11-29T11:26:57.000 signed by eosio [trxs: 0, lib: 866, confirmed: 0]
info  2018-11-29T11:26:57.501 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 00000364fdaf798c... #868 @ 2018-11-29T11:26:57.500 signed by eosio [trxs: 0, lib: 867, confirmed: 0]
info  2018-11-29T11:26:58.001 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 00000365060f211c... #869 @ 2018-11-29T11:26:58.000 signed by eosio [trxs: 0, lib: 868, confirmed: 0]
info  2018-11-29T11:26:58.500 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 000003665b7b65ea... #870 @ 2018-11-29T11:26:58.500 signed by eosio [trxs: 0, lib: 869, confirmed: 0]
info  2018-11-29T11:26:59.001 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 000003678ec1892c... #871 @ 2018-11-29T11:26:59.000 signed by eosio [trxs: 0, lib: 870, confirmed: 0]
info  2018-11-29T11:26:59.501 thread-0  producer_plugin.cpp:1490      produce_block        ] Produced block 00000368773bb47e... #872 @ 2018-11-29T11:26:59.500 signed by eosio [trxs: 0, lib: 871, confirmed: 0]

日志显示稳定产生区块,访问 http://localhost:8888/v1/chain/get_info 网页信息为当前最后一个区块信息:

{
	"server_version": "59626f1e",
	"chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
	"head_block_num": 1146,
	"last_irreversible_block_num": 1145,
	"last_irreversible_block_id": "000004790981a6a79f7df38937781c9eeeec346b10ad896446b7769f68025490",
	"head_block_id": "0000047a203bff31a5d6b35f089e9a393953698164830d7644ba289b5376431c",
	"head_block_time": "2018-11-29T11:29:16.500",
	"head_block_producer": "eosio",
	"virtual_block_cpu_limit": 627769,
	"virtual_block_net_limit": 3295921,
	"block_cpu_limit": 199900,
	"block_net_limit": 1048576,
	"server_version_string": "v1.4.4"
}
四、如果以上操作还未解决问题 方法1:

清理日志:

#使用此命令删除原有的日志文件
find / -name nodeos.log

root@ubuntu:/home/guoyi#  find / -name nodeos.log
/home/guoyi/nodeos.log
/home/contracts/nodeos.log
/home/contracts/eosio.contracts/eosio.token/nodeos.log
find: ‘/run/user/1000/gvfs’: 权限不够

然后

# 启动nodeos
nodeos -e -p eosio \
--plugin eosio::producer_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::http_plugin \
-d /home/contracts/eosio/data \
--config-dir /home/contracts/eosio/config \
--access-control-allow-origin=* \
--contracts-console \
--http-validate-host=false \
—filter-on=‘*’ >> nodeos.log 2>&1 &
方法2. 

重装eos!!

卸载:
sudo apt remove eosio.cdt

安装:
cd /home/guoyi/
sudo apt install ./eosio.cdt-1.3.2.x86_64.deb

 

关注
打赏
1665194163
查看更多评论
立即登录/注册

微信扫码登录

0.0365s