Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Repository files navigation

DEPRECATED - narya is now deprecated and no longer maintained. Please follow the official docs to run a local network.

NPM moduleJoin the communityFollow on Twitter

Run an Elrond test network with a single command.

Getting started

Pre-requisites:

Run it:

$ npx narya

You can install it as a global Node module and run it:

$ npm i -g narya
$ narya

Once the Docker container is up and running the proxy can be accessed at http://localhost:7950

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 narya

You 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')awaitstart()// start a networkconstchild=getChildProcess()// get the `ChildProcess` instance representing the docker containerawaitstop()// stop the started network

You can also get a reference to the test account wallets:

const{WALLETS}=require('narya)
const{ BasicWallet }=require('elrondjs')// output Alice's addressconsole.log(WALLETS.alice.bech32)// "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"// use it for signing transactionsconstwallet=BasicWallet.fromJsonKeyFileString(JSON.stringify(WALLETS.alice),'password')awaitwallet.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:latest

If 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/bash

Publishing

docker login
docker push hiddentao/erdnet:latest

NPM package

To build the package and watch for changes:

npm run dev

To build for production:

npm run build

To publish a new release:

npm run release

To run local tests:

npm test

License

MIT

About

DEPRECATED - Run an Elrond test network with a single command.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Contributors

Languages