Code Monkey home page Code Monkey logo

Comments (15)

obale avatar obale commented on September 26, 2024

I am interested in MongoDB support for this library.

from bitcoin-ruby.

saurabhbhatia avatar saurabhbhatia commented on September 26, 2024

👍 for MongoDb support

from bitcoin-ruby.

mhanne avatar mhanne commented on September 26, 2024

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.

panlilu avatar panlilu commented on September 26, 2024

MongoDB support,cool

from bitcoin-ruby.

roganartu avatar roganartu commented on September 26, 2024

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.

saurabhbhatia avatar saurabhbhatia commented on September 26, 2024

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.

sgarciac avatar sgarciac commented on September 26, 2024

Is anyone working on this? (I would work on it if no one is)

from bitcoin-ruby.

sgarciac avatar sgarciac commented on September 26, 2024

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.

mhanne avatar mhanne commented on September 26, 2024

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.

sgarciac avatar sgarciac commented on September 26, 2024

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.

lian avatar lian commented on September 26, 2024

thought about using mongoid gem instead of the mongo gem driver?

from bitcoin-ruby.

sgarciac avatar sgarciac commented on September 26, 2024

hmm, is it really worth it? It seems to me the data model is simple enough to use mongodb directly.

from bitcoin-ruby.

lian avatar lian commented on September 26, 2024

its a driver thing. mongoid uses moped as mongo driver. and the author of both now works at mongodb.

from bitcoin-ruby.

sgarciac avatar sgarciac commented on September 26, 2024

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.

mhanne avatar mhanne commented on September 26, 2024

Continued in mhanne/bitcoin-ruby-blockchain#9

from bitcoin-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.