ErisDB Promise JS lib (Alpha)
This is JavaScript JSON-RPC 2.0 client library for ErisDB
Installation
Prerequisites
You will need ErisDB
installed and running
Also this library is using ES6 so you will have to use node.js > 4.0.0
Installing node module
$ npm i --save eris-db-promise
Usage
Finding out ErisDB IP
$ eris chains inspect <name of ErisDB server> NetworkSettings.IPAddress
After that you will be able to create new instance of library:
const erisFactory = // For base HTTP JSON RPCconst erisDb = erisFactory// For WebSocket RPC clientconst erisDb = erisFactory
This library uses Promise
so all methods will return promises:
erisDbaccounts
API Reference
Library contains this components:
Component Name | Accessor |
---|---|
Accounts | ErisDB.accounts |
Blockchain | ErisDB.blockchain |
Consensus | ErisDB.consensus |
Events | ErisDB.events |
NameReg | ErisDB.namereg |
Network | ErisDB.network |
Transactions | ErisDB.transactions |
Unsafe | ErisDB.unsafe |
All methods are made using documentation here
All methods usages are described in tests
Browser usage
This library has browser version into dist/index.js
you could download it and use in browser.
Example of usage is into dist/index.html
Signing transactions
This library includes transaction signing mechanism.
Sample:
const tx = inputs: address: useraddress amount: 101 sequence: 1 pub_key: userpub_key outputs: address: other_accountaddress amount: 100 const txForSign = chain_id: 'chainIdHere' tx: 2 _ erisdbtransactions