1.2.0 • Published 6 years ago

@rchain-community/repl v1.2.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

repl

Node.js based RNode REPL interface.

This package enabled applications to use the interal gRPC interface of the RChain RNode server to execute Eval and Run commands.

Library usage

Install using NPM:

npm i @rchain-community/repl

Usage:

const REPL = require('@rchain-community/repl')

const repl = new REPL(host, port)
repl.eval(myRholangCode)
  .then(output => {
    console.log(output)
  })
  .catch(err => {
    console.log(err)
  })

CLI usage

You can also use this package as a CLI script to execute Rholang programs.

In order to do so, first install it globally:

npm i -g @rchain-community/repl

Usage:

rnode-repl <program.rho> [host] [port]