Author

Topic: bitcoinJS - packed for meteorjs (Read 1673 times)

hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
August 09, 2015, 05:57:49 AM
#14
I have another question:

How do I use the documentation for bitcoinjs ?

in "http://bitcoinjs.org", they say: "Documentation: Soon. For now, use the tests as a reference."

with a link to "https://github.com/bitcoinjs/bitcoinjs-lib/tree/master/test"

On this page, go to integration and basic.js, at line 20:

Code:
var hash = bitcoin.crypto.sha256('correct horse battery staple')
var d = bigi.fromBuffer(hash)
var keyPair = new bitcoin.ECPair(d)
var address = keyPair.getAddress()

First line is OK (replace bitcoin by bitcoinjs), I can print the hash in meteor: console.log(hash)
but what I'm suppose to do with "bigi" which comes from line 4: var bigi = require('bigi')

Also

key = bitcoinjs.ECKey.makeRandom();
works but
keyPair = bitcoinjs.ECPair.makeRandom({ rng: rng })
don't

I don't understand which functions or parameters I can use for bitcoinjs ?

you have to dig in code, and look for functionality which you need.
The current version is 1.5.7 and the npm module from my package also is on v1.5.7 which don't have
ECPair in it. see https://github.com/bitcoinjs/bitcoinjs-lib/issues/408
this is coming soon.

when you want more detailed documented library. maybe the bitcore is better for your need. Also
has very good playground/api-refs/documentation. I am packing right now bitcore last version for the meteor. I publish it
this days.

thank you,
ca333
member
Activity: 65
Merit: 16
August 08, 2015, 02:02:46 PM
#13
I have another question:

How do I use the documentation for bitcoinjs ?

in "http://bitcoinjs.org", they say: "Documentation: Soon. For now, use the tests as a reference."

with a link to "https://github.com/bitcoinjs/bitcoinjs-lib/tree/master/test"

On this page, go to integration and basic.js, at line 20:

Code:
var hash = bitcoin.crypto.sha256('correct horse battery staple')
var d = bigi.fromBuffer(hash)
var keyPair = new bitcoin.ECPair(d)
var address = keyPair.getAddress()

First line is OK (replace bitcoin by bitcoinjs), I can print the hash in meteor: console.log(hash)
but what I'm suppose to do with "bigi" which comes from line 4: var bigi = require('bigi')

Also

key = bitcoinjs.ECKey.makeRandom();
works but
keyPair = bitcoinjs.ECPair.makeRandom({ rng: rng })
don't

I don't understand which functions or parameters I can use for bitcoinjs ?
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
August 08, 2015, 08:28:51 AM
#12
Anybody try to run this in AngularJS environment?

You can compile the bitcoinjs-lib for browser and reference
in your webapp. So then you can use it also with AngularJS (and any other client UI framework).

For example you can make it very fast with the node package manager:

Code:
$ npm -g install bitcoinjs-lib browserify uglify-js
$ browserify -r bitcoinjs-lib -s Bitcoin | uglifyjs > bitcoinjs.min.js


now only reference the bitcoinjs.min.js in your webapp and you can use it full on client-side.

Code:

ca333
member
Activity: 174
Merit: 10
Mundus Ex Plurimum
August 07, 2015, 10:24:21 PM
#11
Anybody try to run this in AngularJS environment?
member
Activity: 65
Merit: 16
August 07, 2015, 09:56:57 AM
#10
I removed and added ca333:bitcoinjs again and it works !
 Smiley

Last question: is there a way to execute the package on the client side ?
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
August 07, 2015, 03:22:30 AM
#9
Hello community, i packed the bitcoinJS-library (http://bitcoinjs.org/) for the nodejs based framework meteor.

meteor package repo: https://atmospherejs.com/ca333/bitcoinjs
my github: https://github.com/ca333/bitcoinjs-meteor

I am working myself on few realtime-btc apps, mostly making experiments and tests on performance analysis, p2p-tests
and realtime social/communication applications with hard relation to BTC..

Happy coding.
thank you,
ca333


Thank you for giving us powerful and trustful script, I will definitely get a coder to install this on my website for btc realtime price quotes

It doesn't provide realtime price quotes. It's just a Bitcoin client for node.js/meteor. (Unless the OP changed something)

correct, BitcoinJS is only the lib for btc-procedures like the ecdsa-functions, transaction-building, scripts, multisig & hd-wallets, block-functions, etc..

for realtime price quotes use API of the exchanges. Principally we could also make a small package which is uses some cex-APIs (localbtc, btc-e, coinbase, etc.) and calculate avg. price which can then be used globally in any meteor-app. good idea. will do it.


newbie
Activity: 7
Merit: 0
August 07, 2015, 02:42:01 AM
#8
Hello community, i packed the bitcoinJS-library (http://bitcoinjs.org/) for the nodejs based framework meteor.

meteor package repo: https://atmospherejs.com/ca333/bitcoinjs
my github: https://github.com/ca333/bitcoinjs-meteor

I am working myself on few realtime-btc apps, mostly making experiments and tests on performance analysis, p2p-tests
and realtime social/communication applications with hard relation to BTC..

Happy coding.
thank you,
ca333


Thank you for giving us powerful and trustful script, I will definitely get a coder to install this on my website for btc realtime price quotes

It doesn't provide realtime price quotes. It's just a Bitcoin client for node.js/meteor. (Unless the OP changed something)
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
August 07, 2015, 02:07:59 AM
#7
I installed npm on my mac
> npm -v
2.11.3

and I installed meteor and npm from scratch on my Ubuntu server
> npm -v
1.3.10

I have the same error on both machines

Code:
Uncaught ReferenceError: Npm is not defined
  Mac:    Uncaught TypeError: Cannot read property 'bitcoinjs' of undefined
  Ubuntu: Uncaught TypeError: Package[ 'ca333:bitcoinjs'] is undefined
Uncaught ReferenceError: Template is not defined
Uncaught ReferenceError: Meteor is not defined



i am not sure whats causing error. i have now excluded library client-loading.
can you try it again (remove & add), it should work now for you.
NOTICE: We use library only serverside. when you have data for client
publish/subscribe ONLY necessary pieces.

FYI: on OSX i am using npm @2.5.1 with meteor @1.1.0.3 ,
and on debian8 i am using npm @1.4.21 and meteor @1.1.0.3



i asked team-member to test it on his machine (debian 7 64b), also worked fine.
and i now installed ubuntu 14.04 x64 on my server and test again from scratch
and made sure error is not on my side. after ubuntu-installation finished i did this
procedure:


1. apt-get update && apt-get upgrade
2. apt-get install npm curl
3. curl https://install.meteor.com/ | sh
4. meteor create testapp
5. cd testapp
6. meteor add ca333:bitcoinjs
7. meteor

versioncheck:


app:


function-check bitcoinjs:


8. remove ubuntu, reinstalled debian Wink

so now should work.

thank you,
ca333
member
Activity: 65
Merit: 16
August 06, 2015, 06:58:18 PM
#6
I installed npm on my mac
> npm -v
2.11.3

and I installed meteor and npm from scratch on my Ubuntu server
> npm -v
1.3.10

I have the same error on both machines

Code:
Uncaught ReferenceError: Npm is not defined
  Mac:    Uncaught TypeError: Cannot read property 'bitcoinjs' of undefined
  Ubuntu: Uncaught TypeError: Package[ 'ca333:bitcoinjs'] is undefined
Uncaught ReferenceError: Template is not defined
Uncaught ReferenceError: Meteor is not defined
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
August 06, 2015, 04:35:33 PM
#5
I cannot install this package:

fisrt I create a project:

> meteor create myProject
> cd myProject
> meteor

Until here it's OK, then ctl C to exit meteor,
then I try to install  ca333:bitcoinjs

> meteor add ca333:bitcoinjs

(and not "meteor install ca333:bitcoinjs" as it is indicated)

the output from meteor:

Changes to your project's package version selections:
ca333:bitcoinjs  added, version 1.5.7        
ca333:bitcoinjs: Pure JS bitcoin library

then I restart meteor and and go to localhost:3000 in Chrome and I get that:

Uncaught ReferenceError: Npm is not defined
Uncaught TypeError: Cannot read property 'bitcoinjs' of undefined
Uncaught ReferenceError: Template is not defined
Uncaught ReferenceError: Meteor is not defined

What's wrong ?
Thanks



You must install npm:
Code:
apt-get install npm


P.S. i corrected my typo (install/add) in atmosphere and github. in atmosphere its stated in left top as meteor add [...].


#edit: I tested now on fresh virtual machine ( debian 8 ) and all work fine

steps i did:

1) install meteor, npm & create project
Code:
curl https://install.meteor.com/ | sh
Code:
apt-get install npm
Code:
meteor create myproject
Code:
cd myproject

2) add ca333:bitcoinjs (inside your meteor project dir)
Code:
meteor add ca333:bitcoinjs

3) generated a privkey @server and made ouput
Code:
var eckey = bitcoinjs.ECKey.makeRandom();
  console.log(eckey.toWIF());
member
Activity: 65
Merit: 16
August 06, 2015, 04:23:02 PM
#4
I cannot install this package:

fisrt I create a project:

> meteor create myProject
> cd myProject
> meteor

Until here it's OK, then ctl C to exit meteor,
then I try to install  ca333:bitcoinjs

> meteor add ca333:bitcoinjs

(and not "meteor install ca333:bitcoinjs" as it is indicated)

the output from meteor:

Changes to your project's package version selections:
ca333:bitcoinjs  added, version 1.5.7         
ca333:bitcoinjs: Pure JS bitcoin library

then I restart meteor and and go to localhost:3000 in Chrome and I get that:

Uncaught ReferenceError: Npm is not defined
Uncaught TypeError: Cannot read property 'bitcoinjs' of undefined
Uncaught ReferenceError: Template is not defined
Uncaught ReferenceError: Meteor is not defined

What's wrong ?
Thanks
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
August 06, 2015, 07:38:05 AM
#3
Hello community, i packed the bitcoinJS-library (http://bitcoinjs.org/) for the nodejs based framework meteor.

meteor package repo: https://atmospherejs.com/ca333/bitcoinjs
my github: https://github.com/ca333/bitcoinjs-meteor

I am working myself on few realtime-btc apps, mostly making experiments and tests on performance analysis, p2p-tests
and realtime social/communication applications with hard relation to BTC..

Happy coding.
thank you,
ca333


Thank you for giving us powerful and trustful script, I will definitely get a coder to install this on my website for btc realtime price quotes

Thank you. I hope other devs can find use in my packages. I already wrote async-wrapper for bitcore integration. So soon i release the bitcore async wrap, then you can use it for many things when it acts like sync procedure. This is great for example to make BTC websites, accept donation, check the balance of addresses, make webshop, and many many more opportunities to code nice bitcoin-applications with it.

thank you,
ca333
sr. member
Activity: 434
Merit: 250
July 24, 2015, 12:59:20 PM
#2
Hello community, i packed the bitcoinJS-library (http://bitcoinjs.org/) for the nodejs based framework meteor.

meteor package repo: https://atmospherejs.com/ca333/bitcoinjs
my github: https://github.com/ca333/bitcoinjs-meteor

I am working myself on few realtime-btc apps, mostly making experiments and tests on performance analysis, p2p-tests
and realtime social/communication applications with hard relation to BTC..

Happy coding.
thank you,
ca333


Thank you for giving us powerful and trustful script, I will definitely get a coder to install this on my website for btc realtime price quotes
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast
July 17, 2015, 02:36:24 AM
#1
Hello community, i packed the bitcoinJS-library (http://bitcoinjs.org/) for the nodejs based framework meteor.

meteor package repo: https://atmospherejs.com/ca333/bitcoinjs
my github: https://github.com/ca333/bitcoinjs-meteor

I am working myself on few realtime-btc apps, mostly making experiments and tests on performance analysis, p2p-tests
and realtime social/communication applications with hard relation to BTC..

Happy coding.
thank you,
ca333

Jump to: