Code Monkey home page Code Monkey logo

tendermint-node's Introduction

tendermint-node

Run a Tendermint full node.

On install, this package downloads a prebuilt Tendermint binary from the official Tendermint releases, and checks it against a known SHA256 hash.

Usage

npm install tendermint-node

let tendermint = require('tendermint-node')

// init a directory for running tendermint
tendermint.initSync({ home: './tendermint' })

// start the full node
let node = tendermint.node({
  home: './tendermint',
  rpc: {
    laddr: 'tcp://0.0.0.0:8888'
  }
  // these options are equivalent to CLI flags
})
node.stdout.pipe(process.stdout)

tendermint.init(path)

Initializes a data directory to be used by a full node. path should be the path to the directory to be initialized.

Returns a Promise.

tendermint.initSync(path)

The synchronous version of tendermint.init().

tendermint.node(path, opts)

Spawns a Tendermint full node.

Returns a ChildProcess object representing the Tendermint process. It has an rpc property which is a client for the node's RPC server (RpcClient). path should be a path to the directory (initialized by init or initSync).

opts may be an object containing options passed to Tendermint as CLI arguments (you may use any flag supported by Tendermint). To see all supported options, run npm i -g tendermint-node && tendermint node --help.

tendermint.lite(target, path, opts)

Spawns a Tendermint light node (talks to a full node and verifies its RPC data).

Returns a ChildProcess object representing the Tendermint process. It has an rpc property which is a client for the node's RPC server (RpcClient).

target should be the URL of a full node's RPC server (e.g. http://somefullnode.com:46657).

path should be a path to a directory where light client data will be stored.

opts may be an object containing options passed to tendermint as CLI arguments (you may use any flag supported by tendermint). To see all supported options, run npm i -g tendermint-node && tendermint lite --help.

tendermint.version()

Returns the tendermint binary's version string.

tendermint.genValidator()

Generates a validator private key, returned as stringified JSON.

tendermint-node's People

Contributors

krishnapg avatar mappum avatar yaram avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.