Bitcoin Forum
April 24, 2024, 10:30:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Port client to node.js?  (Read 1453 times)
keverw (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10



View Profile WWW
June 24, 2012, 12:24:52 PM
 #1

Hey. I was wondering if anyone would be interested in porting the client in to node.js, and have a really nice simple rest api. Not sure how long something like this could take, also it could store multiple wallets. Like in requests, you could be like wallet=walletname. obviously this client would want to run on a local network, with a firewall and not port forwarded. Also a way to confirm the small 0.005 tx fees. like you would do wallet=Kevin&pay=ADDRESS&amount=0.01

and it would then reply with a json object, saying a fee, the app using the API would then decide to pay it and do wallet=Kevin&pay=ADDRESS&amount=0.01&allowfee=0.005

Just an idea. Would something like this be valuable to the community? I myself, would like to see this project happen. But I wouldn't want to go about it alone, and this client would be open source also.

Go open a whole new world with Visa Prepaid Bitcoin. More people go with, Visa Bitcoin.
Donate - BTC: 1giYNSkexV3vtqUPQZvGf9Nu1dfQ73VMZ
1713997807
Hero Member
*
Offline Offline

Posts: 1713997807

View Profile Personal Message (Offline)

Ignore
1713997807
Reply with quote  #2

1713997807
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713997807
Hero Member
*
Offline Offline

Posts: 1713997807

View Profile Personal Message (Offline)

Ignore
1713997807
Reply with quote  #2

1713997807
Report to moderator
1713997807
Hero Member
*
Offline Offline

Posts: 1713997807

View Profile Personal Message (Offline)

Ignore
1713997807
Reply with quote  #2

1713997807
Report to moderator
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
June 24, 2012, 09:44:31 PM
 #2

Here's a project that appears to have stalled:

 - https://github.com/gasteve/node-bitcoin-p2p

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


keverw (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10



View Profile WWW
June 24, 2012, 11:53:00 PM
 #3

Here's a project that appears to have stalled:

 - https://github.com/gasteve/node-bitcoin-p2p


Looks like it uses it's own DB, I would prefer the one I have an idea for to use the same database files as the QT wallet. Just copy in to a dir and it would work. Might be worth trying to fork and updating.

Go open a whole new world with Visa Prepaid Bitcoin. More people go with, Visa Bitcoin.
Donate - BTC: 1giYNSkexV3vtqUPQZvGf9Nu1dfQ73VMZ
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
June 25, 2012, 04:14:58 AM
 #4

Here's a project that appears to have stalled:

 - https://github.com/gasteve/node-bitcoin-p2p


Looks like it uses it's own DB, I would prefer the one I have an idea for to use the same database files as the QT wallet. Just copy in to a dir and it would work. Might be worth trying to fork and updating.
I don't think there is a BDB adapter for JS, so this would likely be a large undertaking.

keverw (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10



View Profile WWW
June 25, 2012, 04:56:19 AM
 #5

Here's a project that appears to have stalled:

 - https://github.com/gasteve/node-bitcoin-p2p


Looks like it uses it's own DB, I would prefer the one I have an idea for to use the same database files as the QT wallet. Just copy in to a dir and it would work. Might be worth trying to fork and updating.
I don't think there is a BDB adapter for JS, so this would likely be a large undertaking.

Not sure. Googled it. Would https://github.com/mcavage/node-bdb, be it?

Go open a whole new world with Visa Prepaid Bitcoin. More people go with, Visa Bitcoin.
Donate - BTC: 1giYNSkexV3vtqUPQZvGf9Nu1dfQ73VMZ
Andrew Vorobyov
Hero Member
*****
Offline Offline

Activity: 558
Merit: 500



View Profile
June 25, 2012, 05:58:55 AM
 #6

http://bitcoinjs.org/
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
June 25, 2012, 04:38:30 PM
 #7

Here's a project that appears to have stalled:

 - https://github.com/gasteve/node-bitcoin-p2p


Looks like it uses it's own DB, I would prefer the one I have an idea for to use the same database files as the QT wallet. Just copy in to a dir and it would work. Might be worth trying to fork and updating.
I don't think there is a BDB adapter for JS, so this would likely be a large undertaking.

Not sure. Googled it. Would https://github.com/mcavage/node-bdb, be it?
I stand corrected.  However that adapter hasn't been worked on in a year it looks like there is still more to work on.

Quote
However, there are a few important notes to be aware of with the node environment; since node is written to abstract away concurrency from you, and BDB is written to assume you have complete control over your concurrency model, there are some complications:

Since environment/database open/close can only be done by one thread of control, these bindings don't have an asynchronous open/close. Best practice is to open everything at startup time (e.g., before you do a listen()).
Transactions can't be active in more than one thread at a time. That pretty much screws the pooch for node, unless I did something like what the erlang driver does, and maintain a thread pool that "routes" any request involving a transaction to the same thread. Possible, but that's going to bring a lot of context switches, and I would need a compelling reason to add in all that complexity. For now, all operations in DB are protected by a transaction (assuming you opened the DB transactionally), and I plan on adding a conditionalUpdate API in the near future.
Because of transactional complications, there is not yet cursor support. This is on my list to add with something like an EventEmitter.


Maybe you could use node-bdb to import the wallet.dat into the wallet format that bitcoinjs uses.  Then the concurrency issues won't be a problem since you are only reading from the satoshi wallet.


keverw (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10



View Profile WWW
June 25, 2012, 05:31:25 PM
 #8

hmm. Yeah. I was thinking more of a way to "jumpstart" the block database, just copy the block chain and go. That's why I was thinking same format, but importing would work also I guess.


That looks promising. Might give it a try when my project is in the stage where I need to add a wallet. Still working on getting the basics out of the way.

Go open a whole new world with Visa Prepaid Bitcoin. More people go with, Visa Bitcoin.
Donate - BTC: 1giYNSkexV3vtqUPQZvGf9Nu1dfQ73VMZ
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!