wget https://studygolang.com/dl/golang/go1.13.10.linux-amd64.tar.gz
tar -zxvf go1.13.10.linux-amd64.tar.gz
mkdir go-pck
#配置环境变量
export GOROOT=$HOME/my-app/go #go目录
export GOPATH=$HOME/my-app/go-pck #go依赖包目录
export PATH="$PATH:$GOROOT/bin"
#使用阿里云 Go Module 国内镜像仓库服务
go env -w GO111MODULE=on
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
2.安装go-ethereum
git clone git@gitee.com:mirrors/go-ethereum.git
cd go-ethereum
make geth
/**Ubuntu会出现以下错误,找到hid.c文件 将 include <iconv.h> 改为 include "/usr/include/iconv.h"
*../go-pck/pkg/mod/github.com/karalabe/usb@v0.0.0-20190919080040-51dc0efba356/hidapi/libusb/hid.c:444*:对‘libiconv_open’未定义的引用
*../go-pck/pkg/mod/github.com/karalabe/usb@v0.0.0-20190919080040-51dc0efba356/hidapi/libusb/hid.c:456:对‘libiconv’未定义的引用
*../go-pck/pkg/mod/github.com/karalabe/usb@v0.0.0-20190919080040-51dc0efba356/hidapi/libusb/hid.c:471:对‘libiconv_close’未定义的引用
**/