I can't get the node-bitcoin rpc module running correctly in my express app... Either I get a connection refused error or I get a invalid params -32602
Here's a little code snipped from my app.js file. Can somebody help me out on what I'm doing wrong here. FYI, I do have port 8332 and 8333 open on nginx
/******* THIS GIVES ME INVALID PARAMS from -32602 ******/
var net = require('net');
var server = net.createServer(function(c) { //'connection' listener
console.log('server connected');
});
server.listen(8332, function() { //'listening' listener
console.log('server bound');
});
var bitcoinClient = new bitcoin.Client({
host: 'localhost',
port: 8332,
user: 'username',
pass: 'password'
});
bitcoinClient.getInfo(function(e, info){
if(e){ return console.log(e);}
});
/****************************************************************/
/******* THIS GIVES ME CONNECTION REFUSED ******/
var bitcoinClient = new bitcoin.Client({
host: 'localhost',
port: 8332,
user: 'username',
pass: 'password'
});
bitcoinClient.getInfo(function(e, info){
if(e){ return console.log(e);}
});
/****
bitcoin.conf
file to expect incoming rpc traffic?