如何将 mongoDB 与 tendermint 一起使用?

How to use mongoDB with tendermint?

目前 tendermint 的默认数据库是 LevelDB,但我想使用 mongoDB,但没有找到任何有用的文档。 那么,任何人都可以提供帮助,甚至有可能吗? 有可能,我看到了,但是怎么做呢?

为 Tendermint 编写 MongoDB 适配器应该很容易。参见 https://github.com/tendermint/tendermint/issues/803

  1. 创建一个新文件 libs/db/mongo_db.go
  2. 写出惊人的代码示例:https://github.com/tendermint/tendermint/blob/develop/libs/db/mem_db.go
  3. 将新后端 MongoDBBackendStr 添加到 db.go
  4. 更改本地 tendermint 配置以使用新后端 db_backend = "mongodb"
  5. 向我们发送 PR :)

你也可以看看BigchainDBhttps://blog.bigchaindb.com/bigchaindb-2-0-is-byzantine-fault-tolerant-5ffdac96bc44。他们使用 MongoDB 作为主要存储 afaik。


我们的聊天:https://riot.im/app/#/room/#tendermint:matrix.org 论坛:https://forum.cosmos.network/c/tendermint