配置ubuntu系统并搭建以太坊私链问题:
ubuntu:
1. ubuntu数字签名问题
GPG 错误:https://dl.google.com/linux/chrome/deb stable Release: 由于没有公钥,无法验证下列签名: NO_PUBKEY 1397BC53640DBXXXX
E: 仓库 “https://dl.google.com/linux/chrome/deb stable Release” 没有数字签名。
报错原因 :google chrome 改变了linux的key仓库。
解决方式:执行命令 sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 1397BC53640DBXXXX(红色字体为ubuntu 未验证签名)
一、进入ubuntu终端命令行,安装geth:
sudo apt-get installsoftware-properties-common
sudo add-apt-repository -yppa:ethereum/ethereum
sudo add-apt-repository -yppa:ethereum/ethereum-dev
sudo apt-get update
sudo apt-get install ethereum
二:创建创世区块:
在以上安装成功之后,直接启动,即可连接公有链。现在通过配置创世块来创建私有链。同一个网络中,创世块必须是一样的,否则无法联通,创建一个eth的根目录的文件夹,在根目录下新建创世块json文件genesis.json。内容如下:
{
"config":{
"chainId" : 16,
"homesteadblock":0,
"epi155block":0,
"epi158block":0
},
"coinbase":"0x0000000000000000000000000000000000000000",
"nonce":"0x0000000000000042",
"mixhash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x4000",
"alloc": {},
"timestamp": "0x00",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData":"SecBroBlock",
"gasLimit":"0xffffffff"
}
三、初始化
参考:https://blog.csdn.net/sportshark/article/details/51855007
启动节点成功后,会进入Geth的命令行模式,输入如下命令
geth --identity "PICCetherum" --rpc --rpccorsdomain "*" --datadir "~/private-geth/app/chain/data0" --port 30303 --rpcapi "db,eth,net,web3" --networkid 95518 console