0

I have some confuse with chain_plugin and mongo_plugin, why do we need them? And if I can modify chainbase which can write directly state to disk, Do I can discard mongoDB?

3

1 Answer 1

1

chain_plugin is actually the core part that manages the blockchain data structure in nodeos. Most of time it is enabled automatically.

mongo_db_plugin is an add-on plugin that aims to replace the previous history_plugin and history_api_plugin, and is for data access / analysis / reporting purpose only. It is more like a peripheral module attached to the nodeos core and it can not work without chain_plugin. If you do not need a mongodb database for query, you can definitely disable mongo_db_plugin and it will save huge amount of system resources.

4
  • Thank you very much, I got it. And I think chainbase which be used to store longest chain but mongo_db cannot.
    – user2644
    Commented Dec 1, 2018 at 1:20
  • 1
    @Onotoko Yes, chainbase is where actual chain data is stored.
    – Tong Shen
    Commented Dec 3, 2018 at 16:32
  • If I store all data of action traces, transactions and blocks everything on MongoDB, still will it consume chain state memory? I want to get rid of the exception Database has reached an unsafe level of usage, shutting down to avoid corrupting the database. Please increase the value set for "chain-state-db-size-mb"
    – Varsh
    Commented Jul 11, 2022 at 3:54
  • @Varsh Yes chain state still will consume the same amount of memory regardless of how you setup your MongoDB plugin. For the exception, refer to github.com/EOSIO/eos/issues/5107
    – Tong Shen
    Commented Jul 25, 2023 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.