您正在查看: EOS-新手问答 分类下的文章

--replay-blockchain does not work

try --hard-replay-blockchain
参考:github

更新EOS 1.1.0 后无法RPC访问

更新 ~/.local/share/eosio/nodeos/config/config.ini
修改或添加
http-validate-host=false

或者 nodeos 启动时添加参数 --http-validate-host=false

如何正常停止nodeos?(database dirty flag set (likely due to unclean shutdown): replay required)

kill 命令再次执行时会导致以下错误。

pkill -9 nodeos or kill -9 {pid}
database dirty flag set (likely due to unclean shutdown): replay required

当重新运行nodeos时,必须使用--replay-blockchain命令忽略它。

让我们安全的结束nodeos 进程

This appears to be two different issues.

Startup after a crash or ungraceful shutdown nearly always fails due to corruption of the boost shared memory cache of the in-memory database. --resync is required to clean up the mess.

For normal shutdown, never kill with -9. Always use either the default (no argument) signal (which is SIGTERM) or SIGINT. Numerically, those are 15 and 2, respectively.

pkill nodeos | Safe
pkill -15 nodeos | Safe
pkill -2 nodeos | Safe
pkill -TERM nodeos | Safe
pkill -SIGTERM nodeos | Safe
pkill -INT nodeos | Safe
pkill -SIGINT nodeos | Safe
pkill -9 nodeos | Not Safe
pkill -KILL nodeos | Not Safe
pkill -SIGKILL nodeos | Not Safe

The core dump is a different problem. That looks like a corrupted network packet, specifically a signed_block_summary. Summary messages are being eliminated from the protocol, so this particular error will no longer be possible soon.

参考自:github

fatal error: 'eosiolib/eosio.hpp' file not found

新手第一次编译EOS后执行编译Hello World合约时经常出现如下错误

root@ubuntu:~/eos/build/tools# ./eosiocpp -o ../contracts/hello/hello.wast ../contracts/hello/hello.cpp 
../hello/hello.cpp:3:10: fatal error: 'eosiolib/eosio.hpp' file not found #include ^~~~~~~~~~~~~~~~~~~~ 1 error generated.
root@ubuntu:~/eos/build/tools#

解决此问题方案如下

  1. cd eos_source/build,执行 sudo make install
  2. cd ../contracts/hello/ 切换到hello 合约目录
  3. 去掉执行程序eosiocpp前的./,修改为 eosiocpp -o hello.wast hello.cpp

v1.1.0 之后版本 出现的问题 参考(更新v1.1.0后,在执行 sudo make install 之后,cleos 等指令还是无效

添加环境变量

打开 ~/.bashrc

vi ~/.bashrc

在文件最后添加

#set eosio path
export EOSIO_PATH=/usr/local/eosio/bin
export PATH=$EOSIO_PATH:$PATH

终端执行以下命令,添加立即生效

source ~/.bashrc

EOS新版 默认的genesis.json 文件位置

EOS之前的版本,如果~/.local/share/eosio/nodeos/config/genesis.json不存在的话,
会自动在此目录创建初始化的genesis.json,每次nodeos 运行也会自动读取genesis.json

之后版本默认不会再已文件的形式创建初始化的genesis.json,(可查看相关代码)。程序也不会再自动读取genesis.json
当需要时自己手动通过--genesis-json传入。这样可避免不必要的数据冲突。

相关文章: