vechain / connex.driver-nodejs Goto Github PK
View Code? Open in Web Editor NEWHas been moved to https://github.com/vechain/connex/tree/master/packages/driver
License: GNU Lesser General Public License v3.0
Has been moved to https://github.com/vechain/connex/tree/master/packages/driver
License: GNU Lesser General Public License v3.0
sample code:
var Framework = require('@vechain/connex-framework')
var Driver, SimpleNet, SimpleWallet, options = require('@vechain/connex.driver-nodejs')
const wallet = new SimpleWallet()
wallet.import('.........') // here imported my testnet account 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
console.log(connex);
driver.txParams.expiration = 18
driver.txParams.gasPriceCoef = 128
driver.onTxCommit = txObj => {
//
}
Followed steps
I install all the modules.
I set the my testnet account private key.
I also tested in Vechain testnet also "https://sync-testnet.vechain.org".
Issue faced in above source code:
const wallet = new SimpleWallet()
^
TypeError: SimpleWallet is not a constructor
Kindly let me know, if I was missed anything, or any other procedure to follow.If anyone know,kindly help me
Hi! I'm using @vechain/connex.driver-nodejs": "^1.1.1"
& @vechain/connex-framework": "^1.1.2"
to connect to mainnet node.
Sometimes struggle with innumerous timeout errors. Examples:
headTracker(http): Error: timeout of 15000ms exceeded
headTracker(http): Error: socket hang up
headTracker(ws): Error: ws read timeout
All of the points to @vechain/connex.driver-nodejs/dist/simple-net.js
or @vechain/connex.driver-nodejs/dist/simple-websocket-reader.js
The most strange thing that all of them occur already after successful request execution.
Here's the code of creating Connex instance for requests:
const net = new SimpleNet(netAddr);
const driver = await Driver.connect(net);
const client = new Framework(driver).thor;
What can cause the reason of timeout?
Need the Net timeout exposed, so it can be set by the developer. It currently is hard coded to 15 seconds.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.