Skip to content

Node.js library with CLI tool for running local EOS docker container

License

Notifications You must be signed in to change notification settings

smiled0g/eos-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EOS Local

Node.js module for running local EOS docker container. It supports both CLI and regular Node.js module.

NPM

Dependency Status devDependency Status

Why build this library?

I build this while having my jouney into EOS ecosystem. While running EOS in docker makes it very convenient for developers to spin up local EOS test environments, there's no convenient way to run the docker containers within Node.js environment. The library offers a simple way to do exactly that with Node.js. Via npx interface, it also functions as CLI tool for folks who don't want to deal with docker.

Dependencies

You need Docker and Node.js v8+. 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-local

Node.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-container

You can pass the --help flag for all the options.

npx eos-local --help
npx eos-local run --help
npx eos-local stop --help

License

MIT = Do whatever you want with this

Contributions

All the pull requests are extremely welcome.

About

Node.js library with CLI tool for running local EOS docker container

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published