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 ...
随机推荐
- 剑指offer 62. 二叉搜索树的第 k 个结点
62. 二叉搜索树的第 k 个结点 题目描述 给定一棵二叉搜索树,请找出其中的第k小的结点.例如, (5,3,7,2,4,6,8) 中,按结点数值大小顺序第三小结点的值为4. 法一: 非递归中序 ...
- Tomcat 加载外部dll时如何配置
1.在myeclipse环境下配置 先将dll放置在c:\windows\system32中,然后在myEclipse中,window->Preferences->MyEclipse-&g ...
- 如何在linux主机上运行/调试 arm/mips架构的binary
如何在linux主机上运行/调试 arm/mips架构的binary 原文链接M4x@10.0.0.55 本文中用于展示的binary分别来自Jarvis OJ上pwn的add,typo两道题 写这篇 ...
- pyodbc 向excel中读写数据
import pyodbc conn_info=( 'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};''DBQ=[Sh ...
- Ubuntu 的apt install 和卸载正确姿势
先说下使用apt installl 安装的包的卸载: apt-get remove: 卸载软件apt-get purge: 卸载软件和配置文件apt-get autoremove: 移除没有使用的依 ...
- 字符串UTF-8和GBK之间的转换以及判定
一.判定字符串是否是UTF-8的编码 bool is_str_utf8(const char* str) { unsigned ;//UFT8可用1-6个字节编码,ASCII用一个字节 unsigne ...
- MySQL加号+ 的作用
案例:查询员工名和员工姓,连接成一个字段,并显示为: 姓名 SELECT last_name+first_name AS 姓名 FROM employees;没有报错但姓名一下全是0 Java中的 + ...
- Python | 字符串拆分和拼接及常用操作
一.字符串拆分 str = "hola ha1 ha2 china ha3 " # partition 从左侧找到第一个目标,切割成三组数据的[元组] str1 = str.par ...
- 【原】mac电脑保存服务器账号/密码登录操作
一.说明 mac电脑自带终端神奇iterm2,日常登录服务器操作一般场景为ssh user@ip,确认后再输入密码操作. 该操作较为麻烦且需通过hostname判断所在主机. 通过ssh生成秘钥方式较 ...
- EQ实现
原理参考: https://www.cnblogs.com/fellow1988/p/9189338.html https://www.cnblogs.com/fellow1988/p/9136346 ...