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的更多相关文章

  1. My tool chain in CentOS 7

    - Git Client SmartGit http://www.linuxlinks.com/article/20120129035558195/GitClients.html candidates ...

  2. ethereum/EIPs-155 Simple replay attack protection 35,36

    EIP 155:重放攻击保护——防止了在一个以太坊链上的交易被重复广播到另外一条链. 在看椭圆曲线时有提到,与r.s.v中的v相关 不同的共有链定义不同的chainId, 防止同一笔交易在不同的共有链 ...

  3. 设计模式之——Chain of Responsibility

    Chain of Responsibility模式又叫做责任链模式,是将多个对象组成一条职责链,然后按照职责链上的顺序一个一个的找出是谁来负责处理. 这个模式很简单,下面就是一个实例程序,有六个处理器 ...

  4. List of CentOS Mirrors

    From:https://www.centos.org/download/mirrors/ CentOS welcomes new mirror sites. If you are consideri ...

  5. EOS 资源汇总

    EOS 资源汇总     A curated list of EOS Ecosystem by [SuperONE](https://superone.io/) EOS 主网 超级节点 https:/ ...

  6. ethereumjs/ethereumjs-common-1-简介

    为了了解ethereumjs/ethereumjs-block-3-代码的使用需要了解的一个模块 https://github.com/ethereumjs/ethereumjs-common Com ...

  7. Openssl oscp命令

    一.简介 ocsp,在线证书状态命,能够执行很多OCSP的任务,可以被用于打印请求文件和响应文件, 二.语法 openssl ocsp [-out file] [-issuer file] [-cer ...

  8. Openssl s_client命令

    一.简介 s_client为一个SSL/TLS客户端程序,与s_server对应,它不仅能与s_server进行通信,也能与任何使用ssl协议的其他服务程序进行通信 二.语法 openssl s_cl ...

  9. Openssl s_server命令

    一.简介 s_server是openssl提供的一个SSL服务程序.使用此程序前,需要生成各种证书.本命令可以用来测试ssl客户端,比如各种浏览器的https协议支持 二.语法 openssl s_s ...

随机推荐

  1. numpy Array[:,]的取值方法

  2. 1052 Linked List Sorting (25分)

    题目 1. 思路 使用map存放所有的地址对 使用起始地址遍历map,结果存放在vector中 排序vector 输出vector 2. 注意点 开始的时候起始地址为-1 可能有些节点没有用到,注意排 ...

  3. eclipse 设置不弹出debug调试框

  4. 自制yum源离线安装ansible

    适应场景 在实际生产环境中,服务器往往是不能访问互联网,如果简单的下载ansible源码安装,会碰到缺少各种依赖包的问题,因此,推荐制作yum源,然后使用yum安装ansible. 实验环境 模拟可以 ...

  5. 九、c++容器

    9.1 简介 容器库是类模板与算法的汇集,允许程序员简单地访问常见数据结构,例如队列.链表和栈. 有三类容器--顺序容器.关联容器和无序关联容器--每种都被设计为支持不同组的操作. 顺序容器:顺序容器 ...

  6. C++-POJ1018-Communication System

    贪心算法:先排序,再枚举最小带宽(B),每次更新当前最小花费(P)和以及答案(ans) #include <cstdio> #include <algorithm> using ...

  7. mysql 实践(例题)

    MySQL安装见本博 安装成功后,开始菜单中找到 “MySQL 8.0 Command Line Client” 进行启动(启动后,可直接输入MySQL密码) 1. create database 数 ...

  8. Java + Selenium 无头浏览器模式

    我们说的无头模式,只是在爬虫执行的时候,不再弹出浏览器的界面,只是使用浏览器的内核进行爬取,下面是示例代码: //设置本地chromedriver地址 System.setProperty(" ...

  9. [POI2011]ROT-Tree Rotations 线段树合并|主席树 / 逆序对

    题目[POI2011]ROT-Tree Rotations [Description] 现在有一棵二叉树,所有非叶子节点都有两个孩子.在每个叶子节点上有一个权值(有\(n\)个叶子节点,满足这些权值为 ...

  10. winform学习(11)Timer控件

    利用Timer控件制作简单的跑马灯: 拉一个Lable控件至窗体中心,Text内容为★▶◀★▶◀★▶◀★▶◀ 再拉一个Timer控件,属性Enabled设置为True(即开启控件),Interval设 ...