一招解决以太坊启动私有链报错一招解决以太坊启动私有链报错
系统环境
Ubuntu 20.04
ethereum1.13.2
geth 1.13.2
go 1.13.8
输入:geth --identity "myethereum" --datadir ./myblockchain --networkid 5777 console --allow-insecure-unlock
输出:Fatal: Failed to register the Ethereum service: ethash is only supported as a historical component of already merged networks
或
输入:geth --identity "myethereum" --rpc --rpcaddr "127.0.0.1" --port 30304 --rpcport "7545" --rpccorsdomain "*" --datadir ./myblockchain --rpcapi "db,eth,net,web3,admin,personal" --networkid 5777 console --allow-insecure-unlock
输出:flag provided but not defined: -rpcapi
第一步安装aptitude
sudo apt-get install aptitude
第二步安装gcc和g++环境
sudo aptitude install gcc
sudo aptitude install g++
第三步将ethereum1.13.2换成ethereum1.10.8
git clone -b v1.10.5 https://github.com/ethereum/go-ethereum.git
进入go-ethereum目录
make geth
./build/bin/geth version
第四步配置环境变量
gedit ~/.bashrc
添加以下内容保存
export GETH=/usr/local/go-ethereum
export PATH=$PATH:$GETH/build/bin