1

Windows 下GO Ethereum的编译

 1 year ago
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小时之前 开始浏览    
这是一个创建于 2017-03-16 12:00:29 的文章,其中的信息可能已经有所发展或是发生改变。

笔者最近需要研究Ethereum, 调研了一下,选择编译Go-Ethereum

174643_PksT_2981977.png

在windows下,安装了Go package在 C:\GO。 环境变量里设了环境变量GOROOT=C:\GO

另外设置Go的工作目录(我用了C:\GOWORK),环境变量里设了环境变量GOPATH=C:\GOWORK。

182157_qpUA_2981977.png

首先,安装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 文件生成:

182321_ZaXs_2981977.png

编译中遇到的问题: 

笔者微信二维码

104233_30GZ_2981977.png

注: 原创,转载请注明出处


有疑问加站长微信联系(非本文作者)

280

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK