cosmos-sdk/store/kv/trace
Aleksandr Bezobchuk 20b1da7a2e
refactor(store/v2): Use Core Iterator (#18957)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
2024-01-08 19:26:10 +00:00
..
doc.go chore(store/v2): move kv stores to kv sub-package (#18243) 2023-10-24 21:02:53 +00:00
iterator.go refactor(store/v2): Use Core Iterator (#18957) 2024-01-08 19:26:10 +00:00
README.md chore(store/v2): move kv stores to kv sub-package (#18243) 2023-10-24 21:02:53 +00:00
store_test.go refactor(store/v2): Use Core Iterator (#18957) 2024-01-08 19:26:10 +00:00
store.go refactor(store/v2): Use Core Iterator (#18957) 2024-01-08 19:26:10 +00:00

Trace KVStore

The trace.Store implementation defines a store which wraps a parent KVStore and traces all operations performed on it. Each trace operation is written to a provided io.Writer object. Specifically, a TraceOperation object is JSON encoded and written to the writer. The TraceOperation object contains the exact operation, e.g. a read or write, and the corresponding key and value pair.

A trace.Store can also be instantiated with a store.TraceContext which can allow each traced operation to include additional metadata, e.g. a block height or hash.

Note, trace.Store is not meant to be branched or written to. The parent KVStore is responsible for all branching and writing operations, while a trace.Store wraps such a store and traces all relevant operations on it.