Windows 下GO Ethereum的編譯

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

筆者最近需要研究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 檔案產生:

編譯中遇到的問題: 

 

 

筆者二維碼

註: 原創,轉載請註明出處

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.