@yqrashawn/conflux-local-network-lite
Start a conflux local network from nodejs.
Last updated 4 months ago by yqrashawn .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @yqrashawn/conflux-local-network-lite 
SYNC missed versions from official npm registry.

conflux-local-network-lite

Start a conflux local network from nodejs.

Features

  • download conflux binary depends on system type (only support ubuntu when using linux)
  • start/restart/quit a conflux node locally
  • create accounts with specified balance on start/restart

Note

  • The latest version don't support windows , don't have the conflux windows binary yet.

Install

npm i -D @yqrashawn/conflux-local-network-lite
yarn add --dev @yqrashawn/conflux-local-network-lite

Examples

Start server

const ConfluxLocalNetworkLite = require("@yqrashawn/conflux-local-network-lite");
(async () => {
  const server = new ConfluxLocalNetworkLite();
  await server.start({
    verbose: false, // show log of conflux node
    accounts: [
      // initialize accounts with specified gdrip balance
      {
        address: "0x91e36D5f4ce79054e2e7811132860469d6E802d6",
        balance: 100000000000000000000
      }
    ],
    genBlockInterval: 1000 // gen one block per 1000 ms
  });
  // it has a conflux-web instance in it
  console.log(server.cfx);
  // it will generate a wallet and account automatically
  console.log(server.wallet);
})();

A conflux node will be start at localhost:12539.

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.

Current Tags

  • 2.2.0                                ...           latest (4 months ago)

64 Versions

  • 2.2.0                                ...           4 months ago
  • 2.1.4                                ...           4 months ago
  • 2.1.3                                ...           4 months ago
  • 2.1.2                                ...           6 months ago
  • 2.1.1                                ...           6 months ago
  • 2.1.0                                ...           6 months ago
  • 2.0.20                                ...           6 months ago
  • 2.0.19                                ...           6 months ago
  • 2.0.18                                ...           6 months ago
  • 2.0.17                                ...           6 months ago
  • 2.0.16                                ...           7 months ago
  • 2.0.15                                ...           7 months ago
  • 2.0.14                                ...           7 months ago
  • 2.0.13                                ...           7 months ago
  • 2.0.12                                ...           7 months ago
  • 2.0.11                                ...           7 months ago
  • 2.0.10                                ...           7 months ago
  • 2.0.9                                ...           7 months ago
  • 2.0.8                                ...           7 months ago
  • 2.0.7                                ...           8 months ago
  • 2.0.6                                ...           8 months ago
  • 2.0.5                                ...           8 months ago
  • 2.0.4                                ...           8 months ago
  • 2.0.3                                ...           8 months ago
  • 2.0.2                                ...           8 months ago
  • 2.0.1                                ...           8 months ago
  • 2.0.0-beta                                ...           9 months ago
  • 2.0.0-alpha                                ...           9 months ago
  • 1.0.7                                ...           9 months ago
  • 1.0.5                                ...           9 months ago
  • 1.0.4                                ...           9 months ago
  • 1.0.3                                ...           9 months ago
  • 1.0.2                                ...           10 months ago
  • 1.0.1                                ...           10 months ago
  • 1.0.0                                ...           10 months ago
  • 0.9.10                                ...           10 months ago
  • 0.9.9                                ...           a year ago
  • 0.9.8                                ...           a year ago
  • 0.9.7                                ...           a year ago
  • 0.9.6                                ...           a year ago
  • 0.9.5                                ...           a year ago
  • 0.9.4                                ...           a year ago
  • 0.9.3                                ...           a year ago
  • 0.9.2                                ...           a year ago
  • 0.9.1                                ...           a year ago
  • 0.9.0                                ...           a year ago
  • 0.8.10                                ...           a year ago
  • 0.8.9                                ...           a year ago
  • 0.8.8                                ...           a year ago
  • 0.8.7                                ...           a year ago
  • 0.8.6                                ...           a year ago
  • 0.8.5                                ...           a year ago
  • 0.8.4                                ...           a year ago
  • 0.8.3                                ...           a year ago
  • 0.8.2                                ...           a year ago
  • 0.8.1                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (15)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |