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?
-
Regarding SSD instead of RAM: medium.com/@bytemaster/… & steemit.com/eos/@eosio/… Hard disk would be out of the question as it wouldn't be fast enough. Another kind of storing state would be IPFS.– NatCommented Nov 29, 2018 at 5:18
-
What is IPFS? Do you have any documents for this? &Nat– user2644Commented Nov 29, 2018 at 6:21
-
Yes. Think of IPFS as torrenting. steemit uses IPFS for large file storage. As does dtube. steemit.com/eos/@eosio/eos-io-storage-white-paper-now-available– NatCommented Nov 29, 2018 at 7:07
1 Answer
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.
-
Thank you very much, I got it. And I think chainbase which be used to store longest chain but mongo_db cannot.– user2644Commented Dec 1, 2018 at 1:20
-
1@Onotoko Yes, chainbase is where actual chain data is stored. 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"
– VarshCommented 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 Commented Jul 25, 2023 at 7:25