Comments (15)
I am interested in MongoDB support for this library.
from bitcoin-ruby.
from bitcoin-ruby.
To make a new storage backend, you only have to subclass StoreBase and override the methods that raise "Not implemented". Store the data however you like, and when you read it back, create a Storage::Model::Block/Tx instead of a Protocol::Block/Tx. They are basically the same, but the Models include some extra data (like block depth) and helper methods to fetch associated objects. See the dummy store for a very minimalistic example.
I'm happy to help if you encounter any problems, don't hesitate to ask!
from bitcoin-ruby.
MongoDB support,cool
from bitcoin-ruby.
I might give this a go early April unless someone else has bandwidth for it
earlier.
On 21/03/2014 12:42 PM, "panlilu" [email protected] wrote:
MongoDB support,cool
Reply to this email directly or view it on GitHubhttps://github.com//issues/61#issuecomment-38244810
.
from bitcoin-ruby.
I going to read this over the weekend and take a look at it. Will post more of what I understand in this thread.
from bitcoin-ruby.
Is anyone working on this? (I would work on it if no one is)
from bitcoin-ruby.
I've got a very preliminary version of a mongodb storage working, if anyone is interested in playing with it:
https://github.com/sgarciac/bitcoin-ruby/tree/mongo
The node seems to be Ok with it ('./bin/bitcoin_node -s "mongo::mongodb://localhost/bitcoin"'), and it seems to feed a mongo database Ok. Other than the mongo code, I had to do some minor refactoring in the storage code.
As I said, its just a first "working" version, I have not tested it at all, other having a look at the created database, which looks ok. I'm not yet creating a pull request, it'd need some testing first, I think.
from bitcoin-ruby.
Awesome! It seems to work quite well already, syncing the chain :D
I had to add a "?pool_size=3" to the connection string, so it doesn't die if a block takes longer to store than the connection timeout.
I've also had to terminate it while processing testnet block #4110, because it was taking up all available RAM (only ~1G, maybe there's no leak but it just needs a bigger working space?).
from bitcoin-ruby.
I'm gonna do some optimisations and tuning, it starts getting really slow after block 100000, when importing the blockchain from a .dat file.
from bitcoin-ruby.
thought about using mongoid gem instead of the mongo gem driver?
from bitcoin-ruby.
hmm, is it really worth it? It seems to me the data model is simple enough to use mongodb directly.
from bitcoin-ruby.
its a driver thing. mongoid uses moped as mongo driver. and the author of both now works at mongodb.
from bitcoin-ruby.
I see. I will give it a try when I get some free time (but I'll probably use moped directly, without the mapper)
from bitcoin-ruby.
Continued in mhanne/bitcoin-ruby-blockchain#9
from bitcoin-ruby.
Related Issues (20)
- RuntimeError: Script type must be hash160, pubkey, p2wpkh or multisig HOT 2
- raise exceptions instead of returning NIL
- How to convert transaction to hex format? HOT 3
- How to convert hash160 script to Script object?
- Webbtc is not longer alive, better remove it from the README
- Add BitcoinSV Support HOT 1
- Supporting openssl 1.1.0 HOT 1
- litecoin HOT 1
- Why do we need openssl.rb?
- Invalid DLL file names on Windows OpenSSL 1.1.0 / 1.1.1
- Mac os iterm2 fish 'irb' terminated by signal SIGABRT (Abort)
- Is this gem is threadsafe? HOT 5
- Connect Node
- Undefined method 'bytesize' for nil:NilClass Error HOT 9
- Can this be used for dogecoin? HOT 1
- undefined method `each' for nil:NilClass (NoMethodError) HOT 9
- How do I correctly use the second output that sends remaining btc back to me?
- Can an the value of a prev_out be less than the amount I am sending?
- undefined method `dsa_sign_asn1' HOT 4
- Supporting openssl 3.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitcoin-ruby.