cosmos-sdk/store/tracekv
Aleksandr Bezobchuk 03bca7b791
feat(store/v2): Merge Feature Branch (#18150)
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
Co-authored-by: yihuang <huang@crypto.com>
2023-10-18 18:03:43 +00:00
..
doc.go feat(store/v2): Merge Feature Branch (#18150) 2023-10-18 18:03:43 +00:00
iterator.go feat(store/v2): Merge Feature Branch (#18150) 2023-10-18 18:03:43 +00:00
README.md feat(store/v2): Merge Feature Branch (#18150) 2023-10-18 18:03:43 +00:00
store_test.go feat(store/v2): Merge Feature Branch (#18150) 2023-10-18 18:03:43 +00:00
store.go feat(store/v2): Merge Feature Branch (#18150) 2023-10-18 18:03:43 +00:00

tracekv

The tracekv.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 tracekv.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, tracekv.Store is not meant to be branched or written to. The parent KVStore is responsible for all branching and writing operations, while a tracekv.Store wraps such a store and traces all relevant operations on it.