Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #173 from ewasm/cli
Browse files Browse the repository at this point in the history
Create a proper CLI
  • Loading branch information
axic authored Jan 24, 2018
2 parents 91c033a + 1cf1d8e commit 69dfebf
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ before_install:
script:
- |
if [ $LANG = js ]; then
bin/evm2wasm.js 0x600160020200 trace
npm run $TEST_SUITE
fi
- |
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

EVM (Ethereum VM 1.0) to [eWASM](https://github.com/ethereum/evm2.0-design) transcompiler. Here is a online [frontend](https://ewasm.github.io/evm2wasm-frontend/dist/).
EVM (Ethereum VM 1.0) to [eWASM](https://github.com/ewasm/design) transcompiler. Here is a online [frontend](https://ewasm.github.io/evm2wasm-frontend/dist/).

# INSTALL
`npm install evm2wasm`

# USE
There is a commandline tool to transcompile EVM input:
```
$ evm2wasm 0x600160020200 trace
```

# DEVELOP
* After any changes to `.wast` file, `npm run build` needs to be run to compile the files into a .json file
* To rebuild the documentation run `npm run build:docs`
Expand Down
5 changes: 0 additions & 5 deletions bin/compileEVM.js

This file was deleted.

17 changes: 17 additions & 0 deletions bin/evm2wasm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

const evm2wasm = require('../index.js')
const ethUtil = require('ethereumjs-util')

const input = ethUtil.toBuffer(process.argv[2])

evm2wasm.evm2wasm(input, {
stackTrace: process.argv[3] === 'trace',
tempName: 'temp',
inlineOps: true,
wabt: true
}).then(function (output) {
console.log(output.toString('binary'))
}).catch(function (err) {
console.err('Failed: ' + err)
})
18 changes: 0 additions & 18 deletions bin/runWast.js

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"build": "node ./wasm/generateInterface.js",
"build:docs": "documentation build --github -f md ./index.js > ./docs/index.md"
},
"bin": {
"evm2wasm": "bin/evm2wasm.js"
},
"author": "mjbecze <[email protected]>",
"license": "MPL-2.0",
"devDependencies": {
Expand Down

0 comments on commit 69dfebf

Please sign in to comment.