0

The Substrate Client has a:

  • Substrate CLI here, where we're given the option to choose to use either RocksDB or ParityDB

  • Substrate Service (sc-service) where here it states:

"The RocksDB feature activates the RocksDB database backend. If it is not activated, and you pass a path to a database, an error will be produced at runtime"

In its builder it sets the backend database (sc_client_api::backend::Backend) that "contains blocks and chain state" for a node here let backend = new_db_backend(config.db_config())?; using the sc-client-db database configuration, where we're also uses our choice of either RocksDB or ParityDB here.

In its tests here database: DatabaseSource::RocksDb { path: root.join("db"), cache_size: 128 }, and here source: DatabaseSource::RocksDb { path: tmp.path().into(), cache_size: 1024 }, it shows how it sets RocksDB as the database.

It also has a file with comment "RocksDB-based offchain workers local storage", where it appears to uses RocksDB here.

Is the reason why an error will be produced at runtime if we don't activate RocksDB with the feature (e.g. if we activate ParityDB and passed a path to ParityDB instead) because it only supports RocksDB for offchain workers local storage, or may we use ParityDB for offchain workers local storage instead?

1
  • In client/service (sc-service) they only use the rocksdb feature in client/service/tests here and here. In client/db (sc-client-db) they are also using the rocksdb feature and importing RockDB's kvdb-rocksdb dependency. Mar 13 at 4:11

0

Your Answer

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

Browse other questions tagged or ask your own question.