dfuse services will be discontinued on September 25, 2024, as Pinax transitions to more advanced and efficient solutions for Antelope blockchain data sourcing. We encourage all users to migrate to Pinax's new services, including Substreams, Firehose, and comprehensive blockchain data services supporting dozens of chains like EOS, WAX, and Telos. Dfuse users can start building with a FREE Pinax Pro Plan.
Learn more and get started at https://pinax.network.
The bstream
package manages flows of blocks and forks in a blockchain
through a Handler-based interface similar to net/http
.
Flows are composed by assembling Handler
s:
type HandlerFunc func(blk *Block, obj interface{}) error
and are kicked off by passing them to a Source
All streaming features of streamingfast use this package.
Sources include:
- FileSource feeds from 100-blocks files in some dstore-based location (some object storage, or local filesystem files)
- LiveSource streams from a gRPC-based block streamer (fed from instrumented blockchain nodes directly).
- JoiningSource which bridges a FileSource and a LiveSource transparently, so you can stream from files and then handoff to a real-time stream.
Handlers include:
- Forkable (in
forkable/
) which manages chain reorganizations, undos, according to the chain's consensus (longest chain, etc..) - SubscriptionHub (in
hub/
): In-process hub to dispatch blocks from a remote source to all consumers inside a Go process - A few gates, that allow the flowing of blocks only upon certain conditions (BlockNumGate, BlockIDGate, RealtimeGate, RealtimeTripper, which can be inclusive or exclusive). See gates.go.
Issues and PR in this repo related strictly to the low-level functionalities of bstream
Report any protocol-specific issues in their respective repositories
Please first refer to the general StreamingFast contribution guide, if you wish to contribute to this code base.