node-covenantsql
This repo is nodejs driver for CovenantSQL written by TypeScript.
Install
Install node-covenantsql
via npm or yarn:
npm install --save node-covenantsql
or
yarn add node-covenantsql
Get started
Follow CovenantSQL Quickstart to get you prepared.
configs for driver
- If the CovenantSQL endpoint comes with
HTTPS
then.pem
and.key
files are needed for requests:
const config = endpoint: 'e.morenodes.com:11108' // testnet endpoint with https database: `` // your DB id created by `cql` tools key_dir: path // your key file https_pem_dir: path // your pem file (cert file)
- If only
HTTP
is needed, then your config could be:
const config = endpoint: 'localhost:11105' // local testnet endpoint without https database: `` // your DB id created by `cql` tools bypassPem: true // bypass https config
connect and query
cql.createConnectionconfig.then.catchconsole.loge