以太坊服务节点搭建

以太坊

在centos上安装以太坊

安装所需环境
  • yum update -y && yum install git wget bzip2 vim gcc-c++ ntp epel-release nodejs cmake -y
安装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:/opt/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

到此geth环境已经安装完毕

启动geth
  • 正式环境后台启动geth,
nohup geth  --datadir "/data/database/eth" --fast -cache 2048 --rpc --rpcaddr "0.0.0.0"  --rpcport "12345" --rpcapi "eth,net,web3,personal,admin"  --trie-cache-gens 3000> /data/database/eth/block.log 2>&1 &
  • 启动以太坊测试服务(控制台)
geth --networkid "3" --datadir "/data/database/eth" --testnet --fast -cache 2048 --rpc --rpcaddr "0.0.0.0" --rpcport "12345" --rpcapi "eth,net,web3,personal,admin" console 2>> geth.log
  • 在更新中请耐心等待,一般需要48个小时,甚至需要更多时间.

二.使用java操作:web3j开发文档

参考文档

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值