Questions tagged [database]

Questions pertaining to runtime storage and chain databases, including querying storage, database back-ups and archiving.

Filter by
Sorted by
Tagged with
1 vote
1 answer
28 views

How to prune sibling blocks?

Testing some behaviors on a collator, I often end-up with [🌗] Block import error: State Database error: Too many sibling blocks inserted Is there way to remove those siblings from the database ?
user avatar
  • 546
1 vote
2 answers
46 views

How can I purging chain database between tests of a development testnet?

I am running a few tests using Jest and Polkadot.js, and I need to reset the state before each test. Should I do that or spawn a new node each time? And if so, what's the best way to do it? I am using ...
user avatar
2 votes
1 answer
48 views

How to to run the substrate-node-template with parity-db instead of rockdb?

I'm looking for a how-to-guide, or an example that runs the substrate-node-template using parity-db instead of rockdb.
user avatar
6 votes
1 answer
66 views

Get block height from database snapshot, without running a node

I have synced a Substrate-based parachain (Moonbase Alpha) and stopped the node to take a snapshot of the database directory. I would like to know what's the best block (block height, last finalized ...
user avatar
  • 161
3 votes
2 answers
35 views

Is there a way for a validator node to store relay chain db and parachain data in different partitions

Is there a way to tell the validator node to store db/full/parachains on a different partition/location. Or is it safe to rsync it to a folder on another partition and then simlink it for a live ...
user avatar
  • 193
6 votes
1 answer
36 views

Is there a way to prune blocks/transactions from the database

My understanding is that --pruning remove the old trie nodes but does not delete the content of the blocks, is there a way to also delete the blocks/transaction up to some point and only keep states ...
user avatar
  • 193
3 votes
2 answers
42 views

Why does Substrate use rocksdb & paritydb over leveldb?

What are the benefits of rocksdb over leveldb? Can Substrate use leveldb? I understand that rocksdb was the database of choice for Parity Ethereum client, and paritydb aims to fix a lot of the ...
user avatar
3 votes
0 answers
45 views

How do I create a snapshot of the substrate database and load it on future runs? [duplicate]

I am making use of JS tests to check my contract calls however there is a large amount of setup required before each test. This means the tests take a very long time to run. I know the substrate ...
user avatar
  • 822
0 votes
1 answer
23 views

Off-chain DB indexing example

Where can I find Tomasz Drwięga Off-chain DB indexing example, implementing the following runtime function? fn on_finalize(_n: BlockNumberFor<T>){} TIA
user avatar
2 votes
1 answer
24 views

DB backup and restarting the node with the DB backed up file is not working as expected

We are trying to restart the nodes with the DB backup file such as chain data DB, keystore etc these are backed up regularly. But we are getting the below error : Error: Service(Client(Backend("...
user avatar
7 votes
1 answer
95 views

How expensive is it to access storage items?

How expensive are storage reads and writes? Does the cost depend on the size of the item?
user avatar
3 votes
2 answers
46 views

Persistent Offchain Worker Storage

Offchain workers storage comes in two flavors: Persistent and Local. pub enum StorageKind { /// Persistent storage is non-revertible and not fork-aware. It means that any value /// set by the ...
user avatar
8 votes
4 answers
104 views

How to configure a Substrate Network with Injected Block History from a snapshot or database backup?

Is it possible to use the chain specification file or some other mechanism to configure a Substrate network with injected block history? In this case, the motivation is CI/CD/testing, but I can see ...
user avatar
3 votes
2 answers
56 views

Does each block save a copy of a Storage item?

This is what I read from the substrate storage docs: https://docs.substrate.io/v3/runtime/storage/ Runtime storage allows you to store data in your blockchain that is persisted between blocks and can ...
user avatar