Connection Refused

292 views
Skip to first unread message

Masiar

unread,
Jan 3, 2013, 11:45:59 AM1/3/13
to bitc...@googlegroups.com
Hi all, I'm pretty new to the BitCoin world and to BitCoinJS but I know JS pretty well.

I downloaded BitCoinJS and tried to run bitcoinjs run --testnet --bchdbg, but it said I needed some setting.js file, so I took the one in the /daemon folder, which is sort of an example. I modified it inserting my data for my miner account on a pool (Slush's) and set some variables, then saved it somewhere and re-run the command, and I received this output:

3 Jan 17:41:07.025 - info: Loading configuration
3 Jan 17:41:07.045 - info: Initializing LevelDB (leveldb:///home/mypath/.bitcoinjs/leveldb/)
3 Jan 17:41:07.046 - info: LevelDB: Database loaded (rev. 1.0)
3 Jan 17:41:07.292 - info: Trying to detect local Bitcoin node (connect="auto")
3 Jan 17:41:07.292 - info: Connecting to peer localhost:18333
3 Jan 17:41:07.303 - info: Listening for JSON-RPC connections on mining.bitcoin.cz:8332
3 Jan 17:41:07.304 - info: Connection refused for localhost:18333
3 Jan 17:41:07.304 - info: Disconnected from peer localhost:18333
3 Jan 17:41:07.304 - info: No local proxy, connecting to network instead (connect="auto")

events.js:68
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: listen EADDRNOTAVAIL
    at errnoException (net.js:769:11)
    at Server._listen2 (net.js:892:19)
    at listen (net.js:936:10)
    at Server.listen (net.js:993:9)
    at asyncCallback (dns.js:67:16)
    at Object.onanswer [as oncomplete] (dns.js:120:9)


What does that mean? I'm just trying to use this node app as a miner, to test performance and stuff, but apparently I can't even set it to work properly. I searched a bit for settings.js files as examples to run a simple miner but I couldn't find any.

Can somebody help me? Pointing to a settings.js file would suffice! I just need to copypaste that and insert my data I guess.

Thanks

Stefan Thomas

unread,
Jan 3, 2013, 12:18:06 PM1/3/13
to bitc...@googlegroups.com
Hey there,

BitcoinJS is a Bitcoin node, not a miner. You can connect a miner to it
if you like, but in practice you would probably be wanting to use a pool
- which is what you're trying to do. In other words, BitcoinJS is not
the kind of software you need.

What you need is a Bitcoin miner, here is a list:

https://en.bitcoin.it/wiki/Software#Mining_apps

For the sake of completeness: The specific error you're getting is that
you've set the hostname that BitcoinJS is trying to listen on to
"mining.bitcoin.cz", but that's not the address of your computer, so it
can't listen there.

Cheers,

Stefan

Masiar

unread,
Jan 3, 2013, 3:29:49 PM1/3/13
to bitc...@googlegroups.com
Well thanks :-). I was completely wrong in my assumptions.
Would it be possible to plug a miner to the Bitcoin node and make my server mine in a pool? Is there something already out there? Since I'm new I don't even know what to search for.

Thanks

Lior Hakim

unread,
Jan 3, 2013, 4:07:24 PM1/3/13
to bitc...@googlegroups.com
Look in http://mining.bitcoin.cz/ like stephan said under the section getting started.
You can also get better answers If you go to the bitcoin forums @ https://bitcointalk.org/index.php
and register. many people there can help you get started
--
Fashion passes,

L

:):

Masiar

unread,
Jan 4, 2013, 2:14:57 AM1/4/13
to bitc...@googlegroups.com
Thanks again. Judging by your answer, apparently there is no miner plugin for BitCoinJS, so it's time to write one. I'll see what I can do.

Cheers,

Masiar

Stefan Thomas

unread,
Jan 4, 2013, 5:37:10 AM1/4/13
to bitc...@googlegroups.com
BitcoinJS has a built-in CPU miner. But it's only for unit testing purposes, it's way too inefficient for practical usage.

https://github.com/bitcoinjs/bitcoinjs-server/blob/master/lib/miner/javascript.js

Note that this is a built-in miner. If you want to develop a practical Bitcoin miner in Node.js, I would make it a separate project and use the Getwork API to connect to a node (which could be BitcoinJS or a pool like Slush). Here is some more info on the Getwork API:

https://en.bitcoin.it/wiki/Getwork
Which is part of the JSON-RPC API: https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

For the actual mining, you need to use GPU acceleration via OpenCL. I guess you would use node-webcl for this: https://github.com/fifield/node-webcl

As the actual shader core you would use an existing Bitcoin mining kernel: https://github.com/m0mchil/poclbm/blob/master/phatk.cl

Basically, what you're trying to do is take a project like poclbm (written in Python) and port it to Node.js.

HTH, Stefan
Reply all
Reply to author
Forward
0 new messages