Bitcoin Forum
April 26, 2024, 09:08:45 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoinJS - packed for meteorjs  (Read 1639 times)
ca333 (OP)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
July 17, 2015, 07: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


this space is available (free) for humanitarian nonprofit organizations - please contact me
1714122525
Hero Member
*
Offline Offline

Posts: 1714122525

View Profile Personal Message (Offline)

Ignore
1714122525
Reply with quote  #2

1714122525
Report to moderator
1714122525
Hero Member
*
Offline Offline

Posts: 1714122525

View Profile Personal Message (Offline)

Ignore
1714122525
Reply with quote  #2

1714122525
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
melisande
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250



View Profile
July 24, 2015, 05:59:20 PM
Last edit: August 06, 2015, 10:17:13 PM by melisande
 #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
ca333 (OP)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
August 06, 2015, 12:38:05 PM
Last edit: August 06, 2015, 10:33:38 PM by ca333
 #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

this space is available (free) for humanitarian nonprofit organizations - please contact me
redPanda
Member
**
Offline Offline

Activity: 65
Merit: 16


View Profile
August 06, 2015, 09: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
ca333 (OP)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
August 06, 2015, 09:35:33 PM
Last edit: August 06, 2015, 10:15:52 PM by ca333
 #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());

this space is available (free) for humanitarian nonprofit organizations - please contact me
redPanda
Member
**
Offline Offline

Activity: 65
Merit: 16


View Profile
August 06, 2015, 11: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
ca333 (OP)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
August 07, 2015, 07:07:59 AM
Last edit: August 07, 2015, 10:25:04 AM by ca333
 #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

this space is available (free) for humanitarian nonprofit organizations - please contact me
CelestialWalrus
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
August 07, 2015, 07: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)
ca333 (OP)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
August 07, 2015, 08: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.



this space is available (free) for humanitarian nonprofit organizations - please contact me
redPanda
Member
**
Offline Offline

Activity: 65
Merit: 16


View Profile
August 07, 2015, 02:56:57 PM
 #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 ?
MrZillion
Member
**
Offline Offline

Activity: 174
Merit: 10

Mundus Ex Plurimum


View Profile WWW
August 08, 2015, 03:24:21 AM
 #11

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)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
August 08, 2015, 01:28:51 PM
 #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:
<script src="bitcoinjs.min.js"></script>

ca333

this space is available (free) for humanitarian nonprofit organizations - please contact me
redPanda
Member
**
Offline Offline

Activity: 65
Merit: 16


View Profile
August 08, 2015, 07: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 ?
ca333 (OP)
Hero Member
*****
Offline Offline

Activity: 520
Merit: 522


Developer - EthicHacker - BTC enthusiast


View Profile
August 09, 2015, 10: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

this space is available (free) for humanitarian nonprofit organizations - please contact me
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!