Windows 下GO Ethereum的编译
source link: https://studygolang.com/articles/9602?fr=sidebar
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Windows 下GO Ethereum的编译
怎当她临去时秋波那一转 · 2017-03-16 12:00:29 · 5410 次点击 · 预计阅读时间 1 分钟 · 大约8小时之前 开始浏览笔者最近需要研究Ethereum, 调研了一下,选择编译Go-Ethereum
在windows下,安装了Go package在 C:\GO。 环境变量里设了环境变量GOROOT=C:\GO
另外设置Go的工作目录(我用了C:\GOWORK),环境变量里设了环境变量GOPATH=C:\GOWORK。
首先,安装Chocolatey。
以管理员身份启动PowerShell prompt窗口,执行
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
安装完chocolatey后,第二步安装Go-Ehtereum环境: git, golang, mingw. 由于我已经安装了git和golang。我只运行下面的命令
choco install mingw
第三步,配置编译环境
打开一个新的命令窗口,运行以下命令:
set "GOPATH=C:\GOWORK"
set "Path=C:\GOWORK\bin;%Path%"
setx GOPATH "%GOPATH%"
setx Path "%Path%"
mkdir src\github.com\ethereum
git clone https://github.com/ethereum/go-ethereum src\github.com\ethereum\go-ethereum
cd src\github.com\ethereum\go-ethereum
go get -u -v golang.org/x/net/context
最后编译, 在C:\GOWORK\src\github.com\ethereum\go-ethereum目录下,运行
go install -v ./...
Hola, Exe 文件生成:
编译中遇到的问题:
笔者微信二维码
注: 原创,转载请注明出处
有疑问加站长微信联系(非本文作者)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK