Skip to content
NodeJS driver for Connex framework
TypeScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src fix ws reference Sep 12, 2019
.gitignore
.npmignore
LICENSE ver 1.0.0 Aug 7, 2019
README.md ver 1.0.0 Aug 7, 2019
package-lock.json
package.json upgrade thor-devkit; ver 1.2.0-beta3 Sep 12, 2019
tsconfig.json use connex.driver; add cache Jul 31, 2019
tslint.json init project Jun 13, 2019

README.md

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 } 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 => {
    // 
}
You can’t perform that action at this time.