substreams-sink-kv

Crates.iosubstreams-sink-kv
lib.rssubstreams-sink-kv
version0.1.3
sourcesrc
created_at2023-01-10 14:57:20.300365
updated_at2023-03-22 13:45:19.712477
descriptionSubstreams kv sink module
homepagehttps://substreams.streamingfast.io/
repositoryhttps://github.com/streamingfast/substreams-database-change
max_upload_size
id755453
size57,494
ArnaudBger (ArnaudBger)

documentation

README

substreams-sink-kv

This crate is a simple wrapper around formatting substreams output to a kv store.

Create a kv_out module in your substreams

// lib.rs

use substreams_sink_kv::pb::kv::KvOperations;

...

pub fn kv_out(
    ... some stores ...
) -> Result<KvOperations, Error> {

    let mut kv_ops: KvOperations = Default::default();

    // process your data, push to your KV
    kv_ops.push_new(someKey, someValue, ordinal);
    kv_ops.push_delete(anotherKey, anotherOrdinal);

    Ok(kv_ops)
}
Commit count: 58

cargo fmt