在使用创世块文件初始化链时,遇到了以下问题:Fatal: Failed to read genesis file: open genesis.json: permission denied
geth版本 Version: 1.9.6-unstable 日期 2024/4/15
这个问题应为,所查看的教程中并没有前置的客户端节点配置命令。
下载命令:
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
可能遇到的问题
-
Fatal: invalid genesis file: missing 0x prefix for hex data:这个错误信息意思很明白,就是你的json文件中,对于16进制数据,需要加上0x前缀
-
Fatal: invalid genesis file: hex string has odd length: 从v1.6开始,设置的十六进制数值,不能是奇数位, 比如不能是0x0,而应该是0x00。
-
Fatal: failed to write genesis block: genesis has no chain configuration :这个错误信息,就是说,你的json文件中,缺少config部分。看到这个信息,我们不需要把geth退回到旧版本,而是需要加上config部分。
-
Error: invalid sender undefined: 这个错误不会导致初始化失败,但是会在以后的转账(eth.sendTransaction),或者部署智能合约的