pinax-network / substreams-sink

Substreams Sink library
MIT License
4 stars 1 forks source link

Remove cursor logic from sink #25

Closed DenisCarriere closed 8 months ago

DenisCarriere commented 8 months ago
import { setup, fileCursor } from "substreams-sink"

...
// Get cursor from file
const cursor = fileCursor.readCursor("cursor.lock");

// Setup sink for Block Emitter
const { emitter } = await setup({...options, cursor});
...
// Save new cursor on each new block emitted
fileCursor.onCursor(emitter, "cursor.lock");