mongodbblockchaintendermint

How to use mongoDB with tendermint?


Currently the default db of tendermint is LevelDB but i want to use mongoDB and did not find any helpful documentation over it. So, can anybody help or is it even possible? It's possible, i saw, but how?


Solution

  • It should be easy to write a MongoDB adapter for Tendermint. See https://github.com/tendermint/tendermint/issues/803.

    1. create a new file libs/db/mongo_db.go
    2. 🙏 write amazing code 🙏 Example: https://github.com/tendermint/tendermint/blob/develop/libs/db/mem_db.go
    3. add the new backend MongoDBBackendStr to db.go
    4. change the local tendermint configuration to use the new backend db_backend = "mongodb"
    5. send us a PR :)

    You can also take a look at the BigchainDB https://blog.bigchaindb.com/bigchaindb-2-0-is-byzantine-fault-tolerant-5ffdac96bc44. They are using MongoDB as a primary storage afaik.


    Our chat: https://riot.im/app/#/room/#tendermint:matrix.org Forum: https://forum.cosmos.network/c/tendermint