博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
以太坊(一)
阅读量:4595 次
发布时间:2019-06-09

本文共 1761 字,大约阅读时间需要 5 分钟。

Centos 7 安装 以太坊环境

安装系统依赖库   

##yum update -y && yum install git wget bzip2 vim gcc-c++ ntp epel-release nodejs cmake -y  

# 安装编译工具和库yum -y groupinstall 'Development Tools'# 安装和设置 ntp 时间校准服务yum -y install ntpsystemctl enable ntpd.servicesystemctl start ntpd.service

安装Go

wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz

tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz
echo 'export GOROOT=/usr/local/go' >> /etc/profile
echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/profile
echo 'export GOPATH=/root/go' >> /etc/profile
echo 'export PATH=$PATH:$GOPATH/bin' >> /etc/profile
source /etc/profile

验证

$ go version

go version go1.10 linux/amd64

克隆编译项目go-ethereum

git clone https://github.com/ethereum/go-ethereum.git

cd go-ethereum

make all

在path中加入geth路径

echo 'export PATH=$PATH:/usr/local/go-ethereum/build/bin' >> /etc/profile

source /etc/profile

验证

geth version

Geth
Version: 1.8.2-unstable
Git Commit: bd6879ac518431174a490ba42f7e6e822dcb3ee1
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10
Operating System: linux
GOPATH=/root/go
GOROOT=/usr/local/go

配置私有链初始状态,新建文件genesis.json

{     "config": {            "chainId": 22,             "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "alloc" : {}, "coinbase" : "0x0000000000000000000000000000000000000000", "difficulty" : "0x400", "extraData" : "", "gasLimit" : "0x2fefd8", "nonce" : "0x0000000000000038", "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp" : "0x00" }

初始化区块链,生成创世区块和初始状态

geth --datadir /opt/data init /opt/eth/genesis.json

 

启动区块链

geth --datadir ./data0 --networkid 11 console

 

转载于:https://www.cnblogs.com/liuq1991/p/9042658.html

你可能感兴趣的文章
JS常用方法【笔记整理】-持续整理中
查看>>
getRow()方法
查看>>
Vmstat命令监控Linux资源并将数据通过图形化方式显示
查看>>
SQL Server 数据库访问通用类(更新)
查看>>
bzoj4566: [Haoi2016]找相同字符
查看>>
20172324 2017-2018-2《程序设计与数据结构》第五周 n!的计算
查看>>
USB枚举过程
查看>>
步进电机驱动器 和H桥
查看>>
python数据类型
查看>>
数据库
查看>>
任务就绪表OS_PrioGetHighest函数
查看>>
转:大灰狼的汇编视频教程笔记(下)
查看>>
javascript常见的几种事件类型
查看>>
关于大型网站技术演进的思考(八)--存储的瓶颈终篇(8)
查看>>
20+ 个很棒的 jQuery 文件上传插件或教程
查看>>
关于Struts2的多文件上传
查看>>
hosts学习整理
查看>>
github上的版本和本地版本冲突的解决方法
查看>>
ModalPopupExtender控件属性、功能
查看>>
js 工厂模式、简单模式、抽象模式
查看>>