2

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?

renny
  • 590
  • 4
  • 23

1 Answers1

3

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

melekes
  • 1,880
  • 2
  • 24
  • 30
  • Regarding BigchainDB, afaik they don't directly store the main blockchain in MongoDB. They extend the blockchain network datastore by operating Mongo in parallel with the blockchain, and notarising data operations as transactions on the main blockchain. – robertdavid Mar 18 '19 at 16:15