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. 洛谷P2158 [SDOI2008]仪仗队 欧拉函数的应用

    https://www.luogu.org/problem/P2158 #include<bits/stdc++.h> #define int long long using namesp ...

  2. 函数的应用_python

    一.各类函数应用 1.高阶函数:函数里面调用函数 例子: def add(a): return (a*a) def print_info(fun,c,d): #传入函数与参数 return fun(c ...

  3. ASP.NET Razor简介

    Razor 不是一种编程语言.它是服务器端的标记语言. 什么是 Razor? Razor 是一种标记语法,可以让您将基于服务器的代码(Visual Basic 和 C#)嵌入到网页中. 基于服务器的代 ...

  4. OrCAD 仿真与仿真模块库介绍

    PSpice A/D9.1个别时候可能会出现异常现象,例如:某一步后,突然电路图的电源极性被自动改变了!造成直流电压和直流电流不正常,输出无波形.所以应该趁正常的时候做好备份是明智的. PSpice ...

  5. ORA-00904: "I_LEVEL": invalid identifier

    问题描述 ORA-00904: "I_LEVEL": invalid identifier 标示符无效

  6. Python_初识面向对象

    楔子 你现在是一家游戏公司的开发人员,现在需要你开发一款叫做<人狗大战>的游戏,你就思考呀,人狗作战,那至少需要2个角色,一个是人, 一个是狗,且人和狗都有不同的技能,比如人拿棍打狗, 狗 ...

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

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

  8. sourcetree(mac)设置代理

    Mercurial: edit ~/.hgrcas shown here: http://www.selenic.com/mercurial/hgrc.5.html#http-proxy Git: e ...

  9. HTML5学习(4)文本元素

    使用VSCode编辑器,内置emmet插件. ctrl+/ 注释/取消注释 ctrl+enter 新起一行 ctrl+shift+enter 往上新起一行 h$*4>lorem10 <h1 ...

  10. ASP学习笔记1

    一.变量 1.1 声明变量 dim name name="Donald Duck" response.write("My name is: " & na ...