This is a command line tool to quickly sync a substreams with a kv database.
Install substreams-sink-kv
(Installation from source required for now):
bash
go install ./cmd/substreams-sink-kv
Add a 'map' module to your substreams.yaml
with an output type of proto:substreams.kv.v1.KVOperations
:
modules:
Run the sink to a local 'badger' database
To connect to substreams you will need an authentication token, follow this guide to obtain one,
shell
substreams-sink-kv run \
"badger3:///home/user/sf-data/my-badger.db" \
"mainnet.eth.streamingfast.io:443" \
"substreams.yaml" \
kv_out
devel/local/start.sh
cd proto && buf generate