ubuntu搭建私链爬坑

配置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.youkuaiyun.com/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

出现 Welcome to the Geth JavaScript console! 测试成功。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值