Building Ethereum private chain on CentOS
golang安装
yum install golang
查看版本
go version
安装以太坊源代码
Building Geth (command line client)
Clone the repository to a directory of your choosing:
git clone https://github.com/ethereum/go-ethereum

Install latest distribution of Go if you don't have it already.
Building geth requires Go and C compilers to be installed:
sudo apt-get install -y build-essential
Finally, build the geth program using the following command.
cd go-ethereum
make geth
由于firewall原因无法下载go相关库请使用代理

You can now run build/bin/geth to start your node.
golang <3
创世区块文件的准备
创建账号:
./geth --datadir /eth/data account new

在go-ethereum/build/bin目录下创建init.json的文本文件,内容如下:
{
"config": {
"chainId": 666,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"ethash": {}
},
"nonce": "0x0",
"timestamp": "0x5ddf8f3e",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x00002",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": { }
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
创世区块初始化
在go-ethereum/build/bin目录下执行以下命令以完成创世区块的创建:
./geth --datadir "/app/chain" init init.json
注意:上面命令中--datadir后面的 /app/chain可以任意指定,无需提前创建,但是一定要保证有足够的磁盘空间。init.json是我们在上一步创建的文件,注意文件名要一致。执行完成后,将会出现类似以下信息:

启动以太坊
仍然在go-ethereum/build/bin目录下执行,执行的命令是:
./geth --rpc --rpccorsdomain "*" --datadir "/eth/data" --port "30303" --rpcapi "db,eth,net,web3" --networkid 100000 console

到目前为止,我们的私有链就搭建成功了。下一次,我们会介绍账户创建,挖矿,转账等操作。
Building Ethereum private chain on CentOS的更多相关文章
- My tool chain in CentOS 7
- Git Client SmartGit http://www.linuxlinks.com/article/20120129035558195/GitClients.html candidates ...
- ethereum/EIPs-155 Simple replay attack protection 35,36
EIP 155:重放攻击保护——防止了在一个以太坊链上的交易被重复广播到另外一条链. 在看椭圆曲线时有提到,与r.s.v中的v相关 不同的共有链定义不同的chainId, 防止同一笔交易在不同的共有链 ...
- 设计模式之——Chain of Responsibility
Chain of Responsibility模式又叫做责任链模式,是将多个对象组成一条职责链,然后按照职责链上的顺序一个一个的找出是谁来负责处理. 这个模式很简单,下面就是一个实例程序,有六个处理器 ...
- List of CentOS Mirrors
From:https://www.centos.org/download/mirrors/ CentOS welcomes new mirror sites. If you are consideri ...
- EOS 资源汇总
EOS 资源汇总 A curated list of EOS Ecosystem by [SuperONE](https://superone.io/) EOS 主网 超级节点 https:/ ...
- ethereumjs/ethereumjs-common-1-简介
为了了解ethereumjs/ethereumjs-block-3-代码的使用需要了解的一个模块 https://github.com/ethereumjs/ethereumjs-common Com ...
- Openssl oscp命令
一.简介 ocsp,在线证书状态命,能够执行很多OCSP的任务,可以被用于打印请求文件和响应文件, 二.语法 openssl ocsp [-out file] [-issuer file] [-cer ...
- Openssl s_client命令
一.简介 s_client为一个SSL/TLS客户端程序,与s_server对应,它不仅能与s_server进行通信,也能与任何使用ssl协议的其他服务程序进行通信 二.语法 openssl s_cl ...
- Openssl s_server命令
一.简介 s_server是openssl提供的一个SSL服务程序.使用此程序前,需要生成各种证书.本命令可以用来测试ssl客户端,比如各种浏览器的https协议支持 二.语法 openssl s_s ...
随机推荐
- python数据赋值后,修改新数据,原数据如何保证不被修改?
python中对象,赋值后是同一地址,如果是可变对象,对其中一个修改会影响到另一个,如果要生成完全新的对象,应使用deepcopyimport copydata1=copy.deepcopy(data ...
- spring boot 运行错误: 找不到或无法加载主类
在项目根目录运行 mvn clean install 进行重新编译 不行的话就删了原有的启动配置,重新配置启动.
- Unity中引入Supersocket.ClientEngine并测试
在使用Supersocket Server的过程中,发现Server是不支持.net 3.5的. 1.Server端中的几个Command: namespace SuperSocketProtoSer ...
- CSS盒子模型探讨
盒模型 html文档中的每个元素都被描绘成矩形盒子,这些矩形盒子通过一个模型来描述其占用空间,这个模型称为盒模型.盒模型通过四个边界来描述:margin(外边距),border(边框),padding ...
- wap网站开发小记(转载)
一:网页的一些标记 1:声明 <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http ...
- sql 根据两点经纬度算出两点之间距离
select (sqrt( ( ((121.544685-longitude)*PI()*12656*cos(((31.134857+latitude)/2)*PI()/180)/180) * ((1 ...
- 图像变换 - 霍夫线变换(cvHoughLines2)
霍夫变换是一种在图像中寻找直线.圆及其他简单形状的方法,霍夫线变换是利用Hough变换在二值图像中找到直线. 利用CV_HOUGH_PROBABILISTIC,对应PPHT(累计概率霍夫变换)?这个算 ...
- JS中使用lambda筛选list
LevelEnum.filter(x=>x.Category=="水利工程")
- NOIP做题练习(day1)
A - Xenny and Alternating Tasks 题面 题解 枚举第一天是谁做,将两个答案取\(min\)即可. 代码 #include <iostream> #includ ...
- redis5.0.7安装及配置集群
1.安装环境linux系统,时间2020年2月 2.官网下载https://redis.io/ 3.解压 tar -zxvf redis-5.0.7.tar.gz 4.配置文件 //创建etc文件夹, ...