eos-local v0.2.2
EOS Local
Node.js module for running local EOS docker container. It supports both CLI and normal node module.
Why build this library?
Running EOS in docker makes it very convenient for developers to spin up local EOS test environments. Still, there's no convenient way to run the docker containers within Node.js environment. I build this while having my jouney into EOS ecosystem.
Dependencies
You need Docker. Yep, that's it. The library is smart enough to pull the latest version of eosio/eos-dev:latest docker image for you if you don't already have it.
Node.js Installation
$> npm install --save eos-localNode.js Example Usage
const EOSLocal = require('eos-local')
const eos = new EOSLocal()
eos.run({
name: 'eos-dev-container',
port: '8888',
binds: [
'/tmp/work:/work',
'/tmp/eosio/data:/mnt/dev/data',
'/tmp/eosio/config:/mnt/dev/config',
],
})
/** Do your thing here */
eos.stop({
name: 'eos-dev-container', // Same container name
})Take a look at bin/cli.js for more example of Node.js use. More documentaiton coming soon.
CLI Usage
Run with npx, without installing
$> npx eos-local run
# With some configuration
$> npx eos-local run -p 8888 -v /tmp/work:/work,/tmp/eosio/data:/mnt/dev/data eos-dev-container
# Do your usual hack til you're satisfied
$> npx eos-local stop eos-dev-containerYou can pass the --help flag for all the options.
npx eos-local --help
npx eos-local run --help
npx eos-local stop --helpLicense
MIT = Do whatever you want with this
Contributions
All the pull requests are extremely welcome.
