bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

SendTx example says hash.reverse has no method 'reverse'

Open markeroon opened this issue 12 years ago • 7 comments

Hey all, the validation example example works fine, but the SendTx example bombs out. Anyone know what's going on? I've attached the error.

Thanks for any help that people can offer.


node examples/SendTx.js 
connecting to 127.0.0.1:18333
connected to 127.0.0.1:18333



/home/client/js/payment-app/vendor/bitcore/examples/SendTx.js:29
  hash.reverse();
       ^
TypeError: Object �_5��ĕ�ܫ�����*ʹ�v�M��j*}�e has no method 'reverse'
    at createTx (/home/client/js/payment-app/vendor/bitcore/examples/SendTx.js:29:8)
    at PeerManager.<anonymous> (/home/client/js/payment-app/vendor/bitcore/examples/SendTx.js:55:17)
    at PeerManager.EventEmitter.emit (events.js:95:17)
    at PeerManager.handleReady (/home/client/js/payment-app/vendor/bitcore/PeerManager.js:126:10)
    at Connection.EventEmitter.emit (events.js:117:20)
    at Connection.handleMessage (/home/client/js/payment-app/vendor/bitcore/Connection.js:160:10)
    at Connection.processData (/home/client/js/payment-app/vendor/bitcore/Connection.js:400:12)
    at Connection.processData (/home/client/js/payment-app/vendor/bitcore/Connection.js:404:10)
    at Connection.handleData (/home/client/js/payment-app/vendor/bitcore/Connection.js:328:10)
    at Socket.EventEmitter.emit (events.js:117:20)

markeroon avatar Feb 25 '14 01:02 markeroon

Fixed when #91 gets merged.

Edit: _Examples_ are fixed in #91, you'll have to copy/paste them again.

SomeoneWeird avatar Feb 25 '14 04:02 SomeoneWeird

Hello, how did you make the address validation example work fine? Did you do any extra configuration? I've tried several times... Thanks!

IvanMontilla avatar Feb 25 '14 20:02 IvanMontilla

I just did an npm install in the main directory and then ran it as is.

What error are you getting?

markeroon avatar Feb 25 '14 20:02 markeroon

https://github.com/bitpay/bitcore/issues/92 <- exactly this issue. I'm using Ubuntu Server 12.10 and Node v0.9.9, wonder if that's the problem.

IvanMontilla avatar Feb 25 '14 20:02 IvanMontilla

I can run your code just fine. It outputs that the address is valid. Perhaps update node? I am using v0.10.26.

markeroon avatar Feb 25 '14 21:02 markeroon

Done with my tests. That was it. Ubuntu gives old packages for an LTS distribution. Heh! Thanks.

IvanMontilla avatar Feb 25 '14 21:02 IvanMontilla

Just tried @SomeoneWeird 's solution. Appears to be working -- thanks.

markeroon avatar Feb 26 '14 00:02 markeroon