A client library to connect to eclair RPC in JavaScript. Forked of Bitpay's bitcoind-rpc.
eclair-rpc.js runs on node, and can be installed via npm:
npm install eclair-rpc
Install eclair and make sure eclair API is running and reachable. Example .eclair/eclair.conf
file might look like:
eclair.chain=testnet
eclair.node-alias=testone
eclair.node-color=49daaa
eclair.bitcoind.rpcport=18333
eclair.bitcoind.rpcuser=bitcoind_username
eclair.bitcoind.rpcpassword=bitcoind_password
eclair.api.enabled=true
eclair.api.password="eclair_password"
eclair.api.binding-ip="0.0.0.0"
var run = function() {
var EclairClient = require('eclair-rpc');
var config = {
protocol: 'http',
pass: 'password',
host: '127.0.0.1',
port: '8080',
};
var rpc = new EclairClient(config);
var txids = [];
function getNodeInfo() {
rpc.getinfo(function(err, res){
if (err) {
console.error(err);
}
console.log(res);
});
}
getNodeInfo();
};
RpcClient.callspec = {
allnodes: '',
channels: '',
checkinvoice: 'str',
close: 'str',
connect: 'str str int',
getinfo: '',
open: 'str int',
receive: 'int str',
send: 'str',
};
Code released under the MIT license.