win10 64位平台 编译 go-ethereum源码

win10 64位平台 编译 go-ethereum源码

  1. 首先安装包管理工具chocolatey
    官网在:https://chocolatey.org/install
    根据用的是cmd.exe还是PowerShell.exe,用不同的命令安装。具体参考官网的说明

  2. 分别安装git,golang,mingw (需要管理员权限)

    C:\Windows\system32> choco install git
    C:\Windows\system32> choco install golang
    C:\Windows\system32> choco install mingw
    

    golang版本 >= 1.7

  3. 安装完之后,环境变量会被修改,重新打开一个命令行窗口 (不需要管理员权限)

  4. 执行下列操作

    C:\Users\xxx> set "GOPATH=%USERPROFILE%"
    C:\Users\xxx> set "Path=%USERPROFILE%\bin;%Path%"
    C:\Users\xxx> setx GOPATH "%GOPATH%"
    C:\Users\xxx> setx Path "%Path%"
    C:\Users\xxx> mkdir src\github.com\ethereum
    C:\Users\xxx> git clone https://github.com/ethereum/go-ethereum src\github.com\ethereum\go-ethereum
    C:\Users\xxx> cd src\github.com\ethereum\go-ethereum
    C:\Users\xxx> go get -u -v golang.org/x/net/context
    
  5. 最后执行编译

    C:\Users\xxx\src\github.com\ethereum\go-ethereum> go install -v ./cmd/...
    
  6. 编译成功之后,geth.exe和其他一些工具会被安装在 %GOPATH%\bin

参考:https://github.com/ethereum/go-ethereum/wiki/Installation-instructions-for-Windows

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值