Bitcanna-rpc is a library that allows you to interact with the json-rpc part of a bitcanna client (regardless of the coin) A simple initialization with the client's rpc identifier and you will be able to recover all the information from bitcanna-cli
1/ In your nodeJs project, create .npmrc
file and add this:
@bitcannacommunity:registry=https://npm.pkg.github.com
2/ Install lib:
npm install @bitcannacommunity/bitcanna-rpc
const bcnaRpc = require('@bitcannacommunity/bitcanna-rpc');
const bitCanna = new bcnaRpc('localhost', '9888', 'rpcUsername', 'rpcPass');
bitCanna.call('getinfo', [], function (err, resB) {
if (err !== null) {
console.log('Bitcanna RPC error: ' + err )
} else {
console.log(resB.result)
}
})