@vechain/connex.driver-nodejs
TypeScript icon, indicating that this package has built-in type declarations

1.2.0-beta6 • Public • Published

Connex Driver for NodeJS

npm version

It drives Connex Framework to work in NodeJS environment. Now you can use Connex in NodeJS backend project.

Installation

# install driver along with framework
npm i @vechain/connex-framework @vechain/connex.driver-nodejs

Usage

The REPL playground is a good start.

import { Framework } from '@vechain/connex-framework'
import { Driver, SimpleNet, SimpleWallet, options } from '@vechain/connex.driver-nodejs'

const wallet = new SimpleWallet()
// add account by importing private key
wallet.import('<private key>')

const driver = await Driver.connect(new SimpleNet('http://localhost:8669/'), wallet)
const connex = new Framework(driver)
// here get connex object ready to use
...

// config tx parameters, e.g. expiration, gasPriceCoef
driver.txParams.expiration = 18
driver.txParams.gasPriceCoef = 128

// watch committed tx
driver.onTxCommit = txObj => {
    // 
}

// if feel error logs annoying, you can disable it by
options.disableErrorLog = true

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.0-beta6111latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.0-beta6111
1.2.0-beta50
1.2.0-beta40
1.2.0-beta30
1.2.0-beta20
1.2.0-beta10
1.0.0-beta-160
1.0.0-beta-140
1.0.0-beta-130
1.0.0-beta-120
1.0.0-beta-110
1.0.0-beta-90
1.0.0-beta-80
1.0.0-beta-70
1.0.0-beta-50
1.0.0-beta-30
1.0.0-beta-20
1.0.0-beta-10
1.0.0-alpha-50
1.0.0-alpha-40
1.0.0-alpha-30
1.0.0-alpha-20
1.0.0-alpha-10

Package Sidebar

Install

npm i @vechain/connex.driver-nodejs

Weekly Downloads

111

Version

1.2.0-beta6

License

LGPL-3.0

Unpacked Size

103 kB

Total Files

29

Last publish

Collaborators

  • tony.li
  • samuelebello
  • lucanicoladebiasi
  • fabiorigam
  • freemanzmrojo
  • agilulfo