Go Ethereum 以太坊 web3.js 打包编译发布过程

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhuweiqin2937/article/details/82532257

太坊的js交互是靠web3.js调用的。
改完后,需要打包,放到Go Ethereum里测试,以下就是打包编译过程说明。
web3.js版本:v0.20.6。

  1. 安装cnpm
1
npm install -g cnpm --registry=https://registry.npm.taobao.org
  1. web3.js的根路径下 安装web3.js的依赖
1
$ cnpm install
  1. 安装gulp打包命令
1
npm install gulp -g
  1. web3.js的根路径下 执行gulp
1
gulp
  1. dist/web3.js文件拷贝到项目中
1
cp dist/web3.js ../go-cypherium/internal/jsre/deps
  1. 安装go-bindata(我是在~目录下执行的)
1
go get -u github.com/jteeuwen/go-bindata/...
  1. 复制 go-bindata文件 到 go的安装目录的bin下。
1
cp ~/go/bin/go-bindata  ~/install/go/bin
  1. 在cypherium_private/go-cypherium/internal/jsre/deps下执行deps.go的倒数第二行,会看到bindata.go已变蓝色,大功告成!
1
go-bindata -nometadata -pkg deps -o bindata.go bignumber.js web3.js

猜你喜欢

转载自blog.csdn.net/zhuweiqin2937/article/details/82532257
今日推荐