narya v1.1.2
narya
Run an Elrond test network with a single command.
Getting started
Pre-requisites:
Run it:
$ npx naryaYou can install it as a global Node module and run it:
$ npm i -g narya
$ naryaOnce the Docker container is up and running the proxy can be accessed at http://localhost:7950
Full docs are available at https://narya.erd.dev.
Usage guide
You can use narya via the CLI tool or programmatically in Node.
Note that the docker container is run in auto-remove mode, meaning that as soon narya (or your Node.js that is using it programmatically) exits, the Docker container will also be stopped and removed.
CLI: Command-line tool
To start a local network:
$ npx naryaYou can view all commands using help:
$ npx narya help
narya
Deploy a local Elrond test network.
Usage
$ narya [command] [options]
Commands
start Start a network.
version Display version.
help Print this usage guide. Use "help <command>" for help on a specific command. Programmatic API
In node.js:
const { start, stop, getChildProcess } = require('narya')
await start() // start a network
const child = getChildProcess() // get the `ChildProcess` instance representing the docker container
await stop() // stop the started networkYou can also get a reference to the test account wallets:
const { WALLETS } = require('narya)
const { BasicWallet } = require('elrondjs')
// output Alice's address
console.log( WALLETS.alice.bech32 ) // "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"
// use it for signing transactions
const wallet = BasicWallet.fromJsonKeyFileString(JSON.stringify(WALLETS.alice), 'password')
await wallet.signTransaction(...)Contributors guide
Build docker image:
docker build --tag hiddentao/erdnet:latest .Run docker image:
docker run --rm -it -p 127.0.0.1:7950:7950/tcp hiddentao/erdnet:latestIf you need to debug, run docker image with bash:
docker run --rm -it -p 127.0.0.1:7950:7950/tcp hiddentao/erdnet:latest /bin/bashPublishing
docker login
docker push hiddentao/erdnet:latestNPM package
To build the package and watch for changes:
npm run devTo build for production:
npm run buildTo publish a new release:
npm run releaseTo run local tests:
npm testLicense
MIT