8 releases (5 breaking)

0.14.1 Oct 18, 2024
0.14.0 Oct 16, 2024
0.13.0 Aug 28, 2024
0.12.0 Aug 23, 2024
0.1.1 Jul 7, 2023

#13 in #streamingfast

Download history 3/week @ 2024-07-27 7/week @ 2024-08-03 1/week @ 2024-08-10 100/week @ 2024-08-17 176/week @ 2024-08-24 21/week @ 2024-08-31 21/week @ 2024-09-07 23/week @ 2024-09-14 13/week @ 2024-09-21 45/week @ 2024-09-28 7/week @ 2024-10-05 258/week @ 2024-10-12 92/week @ 2024-10-19 19/week @ 2024-10-26 18/week @ 2024-11-02 9/week @ 2024-11-09

251 downloads per month
Used in substreams-solana

Apache-2.0

110KB
1.5K SLoC

Substreams Solana

Substreams development kit for Solana chains, contains Rust Firehose Block model and helpers

Usage

  • Cargo.toml:
[package]
name = "my-package"
version = "0.1.0"

[lib]
crate-type = ["cdylib"]

[dependencies]
substreams-solana = "0.13"

Protobuf Extern paths

If you have other protobuf objects that refer to the sf.solana.type.v1 types, like the Solana Substreams Foundational Modules you must inform the Protobuf code generator to generate subtreams_solana::pb::sf::solana::type::v1 for messages pointing to sf.solana.type.v1.

Add or modify the buf.gen.yaml file so that it has an extern_path=... option defined like this:

version: v1
plugins:
- plugin: buf.build/community/neoeinstein-prost:v0.2.2 # check compatibility with your 'prost' crate
  out: ./src/pb
  opt:
    - file_descriptor_set=false
    - extern_path=.sf.solana.type.v1=::substreams_solana::pb::sf::solana::type::v1

- plugin: buf.build/community/neoeinstein-prost-crate:v0.3.1 # check compatibility with your 'prost' crate
  out: ./src/pb
  opt:
    - no_features

When you run substreams protogen or buf generate proto, it will generate links to substreams-solana library enabling you to leverage all helpers added by the library to Solana types.

Development

We manually keep in sync the rendered Rust Firehose Block models with the actual Protocol Buffer definitions file found in sf-solana and we commit them to Git.

This means changes to Protobuf files must be manually re-generated and commit, see below for how to do it.

Regenerate Rust Firehose Block from Protobuf

./gen.sh

Community

Need any help? Reach out!

License

Apache 2.0

Dependencies

~0.5–2.2MB
~31K SLoC