jb55 / node-bitcoin

zero-dependency bitcoin core rpc lib for nodejs
The Unlicense
45 stars 127 forks source link

Error 110 #14

Closed ghost closed 12 years ago

ghost commented 12 years ago

I am successfully running bitcoind on the ubuntu server that has been configured properly with rpcuser & rpcpassword & rpcport=8332. I am able to type commands in bitcoind. Ex: bitcoind getbalance

This module used to be working before with nodejs until I started getting the following error: { errno: 110, code: 'ETIMEDOUT', syscall: 'connect' }

I am new to the bitcoin world and I am probably missing something pretty obvious.

Thanks for your help, I have been figuring this for hours.

freewil commented 12 years ago

Are you synced up with the blockchain? If it's trying to sync that could cause RPC responses to be delayed

What is the exact code you're using?

ghost commented 12 years ago

Yes bitcoind is perfectly synced with the blockchain ( I checked with getInfo ). It's been turned on since more then 48 hours. Here is the code I am using.

var bitcoin = require('bitcoin');

var client = new bitcoin.Client({ host : 'localhost', port : 8332, user : 'bitcoinrpc', pass : 'mypsw' });

client.getBalance('*', 6, function(err, balance) { if (err) return console.log(err); console.log('Balance:', balance); });

freewil commented 12 years ago

what versions are you running of:

  1. node
  2. node-bitcoin
  3. bitcoind
ghost commented 12 years ago

I had multiple versions of nodejs installed via node version manage (nvm). I ended up accidentally using node v0.4.10. I immediately switch it back to node version v0.8.0 and it worked with success. I knew the bug was something obvious as it used to be working before.

Node-Bitcoin: 1.3.0 Bitcoind: 6.3 (60300)

P.S: Is there a NodeJS event-based payment notification script somewhere? If not, I would be interested in creating it and share it once its done.

freewil commented 12 years ago

P.S: Is there a NodeJS event-based payment notification script somewhere? If not, I would be interested in creating it and share it once its done.

Not that I am aware of. There are some services offering APIs that do this.