linux安装go语言及ethereum

本文档详细介绍了如何在服务器上安装配置Go语言环境,并进一步安装与运行Ethereum客户端geth的过程。包括环境变量的设置、依赖软件的安装及geth节点的启动与常用命令。

安装go语言

# cd /usr/local/go

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

# tar -xvf go1.10.1.linux-amd64.tar.gz

# sudo vi /etc/profile

export GO_HOME="/usr/local/go/go"

export JAVA_HOME="/usr/local/jdk1.8.0_144"

export CATALINA_HOME="/usr/local/apache-tomcat-9.0.0.M22"

export PATH=$PATH:$GO_HOME/bin:$JAVA_HOME/bin:$CATALINA_HOME/bin

export CLASSPATH=$JAVA_HOME/jre/lib/tools.jar:$JAVA_HOME/bin/tools.jar:$JAVA_HOME/common/lib/servlet-api.jar

# source /etc/profile

# go version

go version go1.10.1 linux/amd64

然后安装ethereum# cd /usr/local/ethereum

# wget https://github.com/ethereum/go-ethereum/archive/v1.8.3.tar.gz

# tar -xvf v1.8.3.tar.gz

# cd go-ethereum-1.8.3/

# make geth

运行geth

$ nohup /usr/local/ethereum/go-ethereum-1.8.3/build/bin/geth --cache 256 --identity "itari" --gcmode archive --datadir /usr/local/ethereum/private/data0 --networkid 898 --port 30303 --rpc --rpcaddr 0.0.0.0 --rpcport 8545 --rpcapi "db,web3,eth,personal,miner,net,txpool" --rpccorsdomain "*" &

--cache 256:这个参数设置内存大小,单位M,默认128,如果设置成1024,一会就挂了

交互命令

$ /usr/local/ethereum/go-ethereum-1.8.3/build/bin/geth attach ipc:/usr/local/ethereum/private/data0/geth.ipc

备注:香港服务器装好后必须指定路径/usr/local/ethereum/go-ethereum-1.8.3/build/bin/geth

上海服务器装好后可以直接geth

转载于:https://my.oschina.net/duojin/blog/1824043

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值