I am trying to connect multichcain (from same machine ) using node bitcoin wrapper of node js but unable to connect.
Here is the code a.js -->
console.log("Hello World");
var bitcoin = require('bitcoin');
var client = new bitcoin.Client({
host: '192.168.100.9',
port: 9241,
user: 'rpcuser', //from multichain.conf
pass: '3895uWRBD8KfWKUT35EzhxkkHTqArPSd1Av3to1aL2um'
});
client.getDifficulty(function(err, difficulty) {
if (err) {
return console.error(err);
}
console.log('Difficulty: ' + difficulty);
});
Output->
root@kali:~/Desktop# nodejs a.js
Hello World
{ [Error: socket hang up] code: 'ECONNRESET' }