@cfxjs/fullnode

3.2.0 • Public • Published

@cfxjs/fullnode

Start a conflux local network from nodejs.

Features

  • Download conflux binary depends on system type
  • Start/restart/quit a conflux node locally
  • Initialize accounts with specified balance on start/restart

Note

  • The latest version may not support windows.

Install

npm i -D @cfxjs/fullnode
yarn add --dev @cfxjs/fullnode

Examples

Start server

const Node = require("@cfxjs/fullnode");
(async () => {
  const node = new Node({accounts: [
      // initialize accounts with specified gdrip balance
      {
        address: "0x91e36D5f4ce79054e2e7811132860469d6E802d6",
        balance: 100000000000000000000
      }
    ]});
  await node.start();
  // it has a js-conflux-sdk instance in it
  console.log(node.cfx);
})();

A conflux node will be start at localhost:12537 be default.

Stop server

await server.quit().catch(() => console.log('failed to quit'));

Restart server

await server.restart(); // accepts the same arguments as server.start

Check out index.js for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @cfxjs/fullnode

Weekly Downloads

3

Version

3.2.0

License

MIT

Unpacked Size

26.2 kB

Total Files

19

Last publish

Collaborators

  • iosh
  • mosshqqmosi
  • cryptoshine
  • sssensational
  • iangeliaq
  • confi
  • pana