substreams-sink

Build Substreams sinks with cursor persistence and reorg handling in Go, JavaScript, Python, and Rust.

15|1|Updated Jun 9, 2025
One-click install
npx skills add https://github.com/pinax-network/substreams-solana --skill substreams-sink
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: substreams-sink
Source: https://github.com/pinax-network/substreams-solana/tree/main/.github/skills/substreams-sink
Command: npx skills add https://github.com/pinax-network/substreams-solana --skill substreams-sink

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill enables building production-grade Substreams sinks to reliably stream and persist blockchain data.

Core Features & Use Cases

  • Cursor management: Implement robust cursor persistence to resume streams without data loss.
  • Reorg handling: Detect and correctly rewind data when chain reorganizations occur.
  • Production mode patterns: Apply best practices for atomic writes, error handling, and retries across multiple languages.
  • Multi-language guidance: Covers Go, JavaScript, Python, and Rust implementations to build end-to-end sinks.

Quick Start

Review the Go, JavaScript, Python, and Rust sink references under references/ to begin building production-grade Substreams sinks. Start with a minimal Go sink example and adapt the patterns to your target language of choice.

Frequently Asked Questions about substreams-sink

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle chain reorganizations when streaming Substreams data?

Handling chain reorganizations in Substreams requires implementing undo logic to correctly rewind and revert persisted data when reorgs occur. This skill provides production-mode patterns for detecting reorgs and executing safe data rollbacks across multiple languages.

What is the best way to persist Substreams cursors for reliable data streaming?

Persisting Substreams cursors requires storing stream progress durably so sinks can resume without data loss after interruptions. This skill covers cursor management techniques to save and reload stream positions reliably in production environments.

Can I build Substreams sinks in Python and JavaScript, or is it limited to Go?

Building Substreams sinks is supported across Go, JavaScript, Python, and Rust. This skill provides implementation references and production-mode streaming patterns tailored to each of these four languages using their official SDKs.

How do I implement atomic writes and error retries for a Substreams sink?

Implementing atomic writes and error retries for Substreams sinks involves applying production-mode patterns that ensure all-or-nothing database commits and resilient reconnection strategies. This skill details these best practices for robust data persistence.

Do I need the official Substreams SDKs to deploy a multi-network sink?

Deploying a multi-network Substreams sink requires the official Substreams SDKs and standard language tooling. This skill leverages those dependencies to implement atomic writes, undo logic, and resilient reconnection strategies across networks.