Error when running newly installed bitcoinjs

193 views
Skip to first unread message

Andrey Fedorov

unread,
Jun 15, 2012, 1:28:17 PM6/15/12
to bitc...@googlegroups.com
I have a clean installation of node and bitcoinjs v0.6.12 on Ubuntu, and I get the following error when I try to run bitcoinjs:

fedorov@fedorov:~/code/bitcoinjs-server$ bitcoinjs run --testnet --bchdbg

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (/usr/local/lib/node_modules/bitcoinjs/lib/binary.js:9:12)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:32)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/bitcoinjs/lib/bootstrap/irc.js:4:14)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)

Is this an issue with node or with bitcoinjs? Any advice would be much appreciated :)

Cheers,
Andrey

Stefan Thomas

unread,
Jun 15, 2012, 1:29:41 PM6/15/12
to bitc...@googlegroups.com
Can you try the latest BitcoinJS from git? Also what is your Node.js version?

Andrey Fedorov

unread,
Jun 15, 2012, 1:47:13 PM6/15/12
to bitc...@googlegroups.com
I'm running Node.js v0.6.12 (sorry for mis-placing it before). I got it via apt-get.

Sorry for the newbie question, but which git repo should I check out and how do I install it? I tried checking out bitcoinjs-server and running "npm install" from the code dir, which seemed to install something, but didn't add anything to my path (as "npm install bitcoinjs -g" did).

- Andrey

Stefan Thomas

unread,
Jun 15, 2012, 1:51:04 PM6/15/12
to bitc...@googlegroups.com
You can install the git version using "sudo npm link". I gotta add it to the wiki somewhere - feel free to do it too, if you have a second.

Node.js v0.6.12 should be fine.

Andrey Fedorov

unread,
Jun 15, 2012, 2:03:22 PM6/15/12
to bitc...@googlegroups.com
That worked, thanks. Which wiki are you referring to? The wiki on bitcoin.it seems to refer to the older architecture of node-bitcoin-p2p and node-bitcoin-exit. I don't need to run those anymore, do I?

Next issue: how do I get the gui working? I've checked out the code in bitcoinjs-gui, and copied config/config.sample.js to config/config.js. I opened index.html in my browser, but only see a static About page.

- Andrey

Andrey Fedorov

unread,
Jun 15, 2012, 2:16:17 PM6/15/12
to bitc...@googlegroups.com
Also, I get the same error when running node-bitcoin-explorer from the git source (following the directions in README.md):

fedorov@fedorov:~/code/node-bitcoin-explorer$ node app.js

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (/home/fedorov/code/node-bitcoin-explorer/node_modules/bitcoinjs/lib/binary.js:9:12)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:32)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/home/fedorov/code/node-bitcoin-explorer/node_modules/bitcoinjs/lib/bootstrap/irc.js:4:14)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)

Any idea what could be causing it?

- Andrey

Stefan Thomas

unread,
Jun 15, 2012, 2:27:35 PM6/15/12
to bitc...@googlegroups.com
The BitcoinJS wiki is on Github:

https://github.com/bitcoinjs/bitcoinjs-server/wiki


Next issue: how do I get the gui working?
Also, I get the same error when running node-bitcoin-explorer

I haven't run either component in a while, so there likely some incompatiblities with the latest BitcoinJS. I'll try and help as much as I can (based on how much time I have), but if you want to run these, prepare to do some legwork yourself. :)

Andrey Fedorov

unread,
Jun 15, 2012, 2:39:53 PM6/15/12
to bitc...@googlegroups.com
The BitcoinJS wiki is on Github: https://github.com/bitcoinjs/bitcoinjs-server/wiki

Thanks, updated it. 
 
I haven't run either component in a while, so there likely some incompatiblities with the latest BitcoinJS. I'll try and help as much as I can (based on how much time I have), but if you want to run these, prepare to do some legwork yourself. :)

Sounds fair. The issue was with Chrome security settings for file:// URL's, it seems to be working fine in Firefox. I'll play around with it and ask questions in a separate thread.

Thanks again for your prompt help, it's much appreciated!

Cheers,
Andrey

Andrey Fedorov

unread,
Jun 15, 2012, 11:18:27 PM6/15/12
to bitc...@googlegroups.com
The server just finished downloading the blockchain, and it looks like everything is working great.

It was a little confusing how the default server value in the GUI's settings included a port (the same port I was accessing the GUI on (8000)), but also appended the default exit node port (3125) in the JS code. I thought that would violate the same origin policies in the browser, but I guess not!

Got it all figured out though, and working nicely. Thanks again for the help!

Cheers,
Andrey
Reply all
Reply to author
Forward
0 new messages