ca333 (OP)
|
|
July 17, 2015, 07:36:24 AM |
|
Hello community, i packed the bitcoinJS-library ( http://bitcoinjs.org/) for the nodejs based framework meteor. meteor package repo: https://atmospherejs.com/ca333/bitcoinjsmy github: https://github.com/ca333/bitcoinjs-meteorI 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
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
melisande
|
|
July 24, 2015, 05:59:20 PM Last edit: August 06, 2015, 10:17:13 PM by melisande |
|
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
|
|
|
|
ca333 (OP)
|
|
August 06, 2015, 12:38:05 PM Last edit: August 06, 2015, 10:33:38 PM by 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
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
redPanda
Member
Offline
Activity: 65
Merit: 16
|
|
August 06, 2015, 09:23:02 PM |
|
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
|
|
|
|
ca333 (OP)
|
|
August 06, 2015, 09:35:33 PM Last edit: August 06, 2015, 10:15:52 PM by ca333 |
|
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: 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 curl https://install.meteor.com/ | sh 2) add ca333:bitcoinjs (inside your meteor project dir) meteor add ca333:bitcoinjs 3) generated a privkey @server and made ouput var eckey = bitcoinjs.ECKey.makeRandom(); console.log(eckey.toWIF());
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
redPanda
Member
Offline
Activity: 65
Merit: 16
|
|
August 06, 2015, 11:58:18 PM |
|
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 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
|
|
|
|
ca333 (OP)
|
|
August 07, 2015, 07:07:59 AM Last edit: August 07, 2015, 10:25:04 AM by ca333 |
|
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 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.3i 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 so now should work. thank you, ca333
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
CelestialWalrus
Newbie
Offline
Activity: 7
Merit: 0
|
|
August 07, 2015, 07:42:01 AM |
|
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)
|
|
|
|
ca333 (OP)
|
|
August 07, 2015, 08:22:30 AM |
|
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.
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
redPanda
Member
Offline
Activity: 65
Merit: 16
|
|
August 07, 2015, 02:56:57 PM |
|
I removed and added ca333:bitcoinjs again and it works ! Last question: is there a way to execute the package on the client side ?
|
|
|
|
MrZillion
Member
Offline
Activity: 174
Merit: 10
Mundus Ex Plurimum
|
|
August 08, 2015, 03:24:21 AM |
|
Anybody try to run this in AngularJS environment?
|
============================================================================================================== Creators of the ZillionGRID 3.0 **** Mundus Ex Plurimum: World of Plenty **** www.ZillionCoin.com **** TELEGRAM **** TWITTER **** Crex24 Exchange==============================================================================================================
|
|
|
ca333 (OP)
|
|
August 08, 2015, 01:28:51 PM |
|
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: $ 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. <script src="bitcoinjs.min.js"></script> ca333
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
redPanda
Member
Offline
Activity: 65
Merit: 16
|
|
August 08, 2015, 07:02:46 PM |
|
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: 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 ?
|
|
|
|
ca333 (OP)
|
|
August 09, 2015, 10:57:49 AM |
|
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: 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
|
this space is available (free) for humanitarian nonprofit organizations - please contact me
|
|
|
|