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. C语言结构体理解

    本质就是数学中集合,里面变量相当于元素,难点在于就是:以前做数学题都是别人给了一个集合,算里面的关系,编程不一样的就是,自己定义一个集合.

  2. my bug of VG algorithm

    def visibility_graph(series): g = nx.Graph() # convert list of magnitudes into list of tuples that h ...

  3. Wooden Sticks(贪心)

    Wooden Sticks. win the wooden spoon:成为末名. 题目地址:http://poj.org/problem?id=1065 There is a pile of n w ...

  4. 【NOIP2012普及组】质因数分解

    P1075 质因数分解 假期第一天就给一道入门难度的题写题解…… 这道题一开始就被我想复杂了:埃式筛,欧拉筛……然而开一个1e9的数组?不现实. 直到看到题解区的dalao用唯一分解定理: 算术基本定 ...

  5. python的setup和teardown

    关于python unittest ① setup():每个测试函数运行前运行② teardown():每个测试函数运行完后执行③ setUpClass():必须使用@classmethod 装饰器, ...

  6. SaltStack自动化软件简介及安装

    ==================================================================================================== ...

  7. WPF学习笔记一之布局

    1.Canvas 布局控件Canvas主要用来画图,注意Canvas.Left/Right/Top/Bottom <Canvas Margin="10,10,10,10" B ...

  8. 题解 P2146 [NOI2015]软件包管理器

    P2146 [NOI2015]软件包管理器 感觉代码比其他题解更简洁qwq 树链剖分模板题 install x:将1~x的路径上的节点全部变成1(安装x需要先安装1~x) uninstall x:将x ...

  9. python接口自动化测试 - requests库的基础使用

    简单介绍 requests库简单易用的HTTP库 Get请求 格式: requests.get(url) 注意:若需要传请求参数,可直接在 url 最后的 ? 后面,也可以调用 get() 时多加一个 ...

  10. thinkphp 接收文件并处理

    html前台文件,上传到控制器,thinkphp处理它 前台 <form action="{:url('product/brand_addcl')}" enctype=&qu ...