博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ethereumjs/browser-builds
阅读量:5817 次
发布时间:2019-06-18

本文共 4961 字,大约阅读时间需要 16 分钟。

https://github.com/ethereumjs/browser-builds

ethereumjs - Browser Builds

This repository contains browser builds of the following ethereumjs libraries:

这个存储库包含以下ethereumjs库的浏览器构建(其实就是将下面的ethereumjs库构造成浏览器能够使用的js文件形式)

They are built using  with a known set of working dependencies.

使用带着具有一组已知的工作依赖项的来构建

For every library/build collection there is a larger plain source version also including the source mappings (e.g. ethereumjs-vm-x.x.x.js) and a minified version for use in production (e.g. ethereumjs-vm-x.x.x.min.js).

这里对每个库/构建收集有一个更大的包含资源映射(比如ethereumjs-vm-x.x.x.js) 的纯资源版本,以及在生产时使用的简化版本 (比如ethereumjs-vm-x.x.x.min.js)

Note注意:

This repository was just lately (October 2017) revived. Currently all builds are considered experimental in terms of API stability, functionality and security!

这个存储库最近(2017/10)才恢复使用。目前,从API的稳定性、功能和安全性来看,所有构建都是实验性的

Usage使用

In your web application, include only one of the builds from the dist directory. All exports will be available under the global ethereumjs.

在你的web应用中,只包含来自dist目录之一的构建。在全局变量ethereumjs下,所有的构建都是可用的

Note: all packages expect ECMAScript 6 (ES6) as a minimum environment. From browsers lacking ES6 support, please use a shim (like ) before including any of the builds from this repo.

注意:所有包都期待使用 ECMAScript 6 (ES6) 作为最小的环境。如果浏览器缺少ES6支持,从该存储库中包含任何构建之前,请使用shim(like )

Examples例子

Examples for usage of the browser builds can be found in the examples directory:

vm.html

  
EthereumJS VM - Browser Example

Start an  from the main directory of the repository to run the examples in the browser.

从存储库的主目录开启 去在浏览器中运行该例子

Build构建

Builds are done using the .js exports compilation files from the  directory and using the  script from the main directory to create the build in the  folder.

构建的完成需要先文件夹中使用.js输出编译文件,然后使用来自主目录脚本在文件夹中创建构建

Version numbers for the builds are directly extracted from the versions installed in the local node_modules folder.

构建的版本数目直接从安装在本地的node_modules文件夹的版本中抽取出。

For creating new builds:为了创建新的构建

  1. Change package.json to require desired/up-to-date versions of the libraries 改变package.json去获取想要的/最新版本的库

package.json

{  "private": true,  "name": "browser-builds",  "version": "0.0.0",  "description": "Browser builds of ethereumjs libraries.",  "scripts": {    "build": "node build.js"  },  "repository": {    "type": "git",    "url": "git+https://github.com/ethereumjs/browser-builds.git"  },  "keywords": [    "ethereum",    "browser"  ],  "author": "Alex Beregszaszi 
", "license": "MIT", "bugs": { "url": "https://github.com/ethereumjs/browser-builds/issues" }, "homepage": "https://github.com/ethereumjs/browser-builds#readme", "dependencies": {//这里写了所有的库,你可以根据你自己的需求进行删减,并更改相应的版本 "ethereumjs-abi": "^0.6.2", "ethereumjs-icap": "^0.3.1", "ethereumjs-tx": "^1.3.1", "ethereumjs-units": "^0.2.0", "ethereumjs-vm": "^2.3.0", "ethereumjs-wallet": "^0.6.0" }, "devDependencies": { "babel-preset-env": "^1.7.0", "babel-preset-react": "^6.24.1", "babelify": "^7.3.0", "browserify": "^14.4.0", "uglifyify": "^4.0.4" }}

  2.Reinstall/update local node_modules packages  重新安装/更新本地node_modules

运行npm install

  3.Run npm run build to generate new set of builds  运行npm run build命令去生成新构建集

返回:

userdeMBP:browser-builds-master user$ npm run build> browser-builds@0.0.0 build /Users/user/browser-builds-master> node build.js***ethereumjs-all***Creating debug version package dist/ethereumjs-all/ethereumjs-all-2018-12-07.jsCreating minified package dist/ethereumjs-all/ethereumjs-all-2018-12-07.min.js***ethereumjs-vm***Creating debug version package dist/ethereumjs-vm/ethereumjs-vm-2.5.0.jsCreating minified package dist/ethereumjs-vm/ethereumjs-vm-2.5.0.min.js***ethereumjs-tx***Creating debug version package dist/ethereumjs-tx/ethereumjs-tx-1.3.7.jsCreating minified package dist/ethereumjs-tx/ethereumjs-tx-1.3.7.min.js***ethereumjs-icap***Omitting debug version package dist/ethereumjs-icap/ethereumjs-icap-0.3.1.js (file exists)Omitting minified package dist/ethereumjs-icap/ethereumjs-icap-0.3.1.min.js (file exists)***ethereumjs-wallet***Creating debug version package dist/ethereumjs-wallet/ethereumjs-wallet-0.6.2.jsCreating minified package dist/ethereumjs-wallet/ethereumjs-wallet-0.6.2.min.js***ethereumjs-wallet-hd***Creating debug version package dist/ethereumjs-wallet-hd/ethereumjs-wallet-hd-0.6.2.js***ethereumjs-abi***Omitting debug version package dist/ethereumjs-abi/ethereumjs-abi-0.6.5.js (file exists)Omitting minified package dist/ethereumjs-abi/ethereumjs-abi-0.6.5.min.js (file exists)Creating minified package dist/ethereumjs-wallet-hd/ethereumjs-wallet-hd-0.6.2.min.js***ethereumjs-wallet-thirdparty***Creating debug version package dist/ethereumjs-wallet-thirdparty/ethereumjs-wallet-thirdparty-0.6.2.jsCreating minified package dist/ethereumjs-wallet-thirdparty/ethereumjs-wallet-thirdparty-0.6.2.min.js

然后你的dist文件夹下就会得到你想要的构建了,然后你就能够在页面端使用这些构建了,就像上面的例子一样

转载于:https://www.cnblogs.com/wanghui-garcia/p/10084089.html

你可能感兴趣的文章
数据结构——串的朴素模式和KMP匹配算法
查看>>
FreeMarker-Built-ins for strings
查看>>
验证DataGridView控件的数据输入
查看>>
POJ1033
查看>>
argparse - 命令行选项与参数解析(转)
查看>>
一维数组
查看>>
Linux学习笔记之三
查看>>
CentOS 6.6 FTP install
查看>>
图解Ajax工作原理
查看>>
oracle导入导出小记
查看>>
聊一聊log4j2配置文件log4j2.xml
查看>>
NeHe OpenGL教程 第七课:光照和键盘
查看>>
修改上一篇文章的node.js代码,支持默认页及支持中文
查看>>
Php实现版本比较接口
查看>>
删除设备和驱动器中软件图标
查看>>
第四章 TCP粘包/拆包问题的解决之道---4.1---
查看>>
html语言
查看>>
从源码看集合ArrayList
查看>>
spring-boot支持websocket
查看>>
菜鸟笔记(一) - Java常见的乱码问题
查看>>