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 ...
随机推荐
- detach() 使用和.detach()和.data的区别 、cpu()函数的作用
detach() 使用和.detach()和.data的区别 .cpu()函数的作用 待办 detach使用 https://blog.csdn.net/qq_27825451/article/det ...
- JavaScript 引擎基础:Shapes 和 Inline Caches
JavaScript 引擎基础:Shapes 和 Inline Caches hijiangtao 中国科学院大学 计算机应用技术硕士 260 人赞同了该文章 前言:本文也可以被称做 “JavaS ...
- js获取自定义data属性
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- JMeter压力测试,http请求压测,5分钟让你学会如何压测接口!
JMeter压力测试 官网:https://jmeter.apache.org 最新款的jmeter需要java8的支持,所以请自行安装jdk8.这里就不啰嗦了. 可以根据自己的系统下载zip或者是t ...
- C++类几种初始化的顺序
首先给段代码: class A{ public: ; A():x(){cout<<"A(): x="<<x<<endl;} A(int a):x ...
- c++面向对象 之 内联函数 this 静态成员
1,内联函数 如果一个函数是内联的,那么在编译时,编译器会把该函数的代码副本放置在每个调用该函数的地方.用inline指定,内联函数通常短小精悍没有while和for循环,能够帮助提升程序执行的速度 ...
- Unity3d简便的声音管理方案
本方法是对Ez-Sound-Manager的扩展 https://github.com/JackM36/Eazy-Sound-Manager 参考Audio Toolkit Free Version ...
- 文件分割合并DOS版
这个从163邮箱里翻出来的程序,2004年的修改日期,放这另存一下. 当时拿了一本C++的书来学,学了一阵就琢磨着做一个东东,然后就想起一个以前印象深刻的软件,叫做笨笨狗分割器. 当时主要还是靠3.5 ...
- 如何查看mac多少位的操作系统?
1.点击工具栏左上角点击 (苹果Logo)标志,关于本机 --> 更多信息 --> 系统报告 -->(左侧栏中)软件 (有的电脑是没有的例如第一张图) 2. 输入命令 una ...
- AcWing 282. 石子合并
#include <iostream> #include <algorithm> using namespace std; ; int n; int s[N];//前缀和 in ...