Shredstream gRPC

Benefits

If you're a trader or need to receive transaction data earlier than your competitors, simple subscription to Yellowstone gRPC endpointarrow-up-right to retrieve transactions data in real time might not be sufficient for you – Solana RPC node still needs to insert shreds, process and validate them, before sending them via Yellowstone gRPC subscription. To overcome this behavior, you can subscribe directly to shredstream using the gRPC interface.

RPC Fast infra receives shreds from Jito and other partner providers to boost the performance.

Shredstream gRPC endpoint is offered within the Aperture plan (SaaS) and a dedicated nodearrow-up-right offering at no add-on cost.

Using direct gRPC subscription to the shredstream endpoint, you will

  • receive transactions ~50-100ms earlier on average, compared to Yellowstone gRPC;

  • receive even more transactions, including failed and votes;

  • avoid time-consuming replay of transactions by RPC node.

circle-info

Check out Geyser vs Shredstream benchmark on our Githubarrow-up-right.

What's inside a Solana shred?

Shred is an essential component of Solana architecture. A shred is a fragment of a Solana block. Instead of transmitting entire blocks, Solana breaks them down into smaller pieces called shreds, which are easier to send and recover over the network.

Each shred contains unordered transactions data, slot number, it's index inside the slot.

circle-check

For more info about the format of Solana entry, please refer to Solana documentationarrow-up-right.

How to create a direct subscription to Jito Shredstream?

  1. If you already have a Solana dedicated node, you can use following endpoint for gRPC subscription: sol-shredstream-CUSTOMER.rpcfast.net:443

  2. To decode gRPC stream, you need protobuf files. You can get them here: https://github.com/jito-labs/mev-protosarrow-up-right

  3. Install grpcurlarrow-up-right software onto your machine.

  4. Launch grpcurl command from the directory where protobuf files has been downloaded:\

  5. You will start to receive encoded Solana entries.

How to decode Solana shreds into human-readable format?

  1. Run the following command inside repository to download code example

  2. Navigate to jito-shredstream-proxy/examples directory.

  3. Install Rust languagearrow-up-right tools onto your machine.

  4. Set environment variables

  5. Launch code example

  6. You will receive decoded transactions for each slot.

  7. If you want to integrate this to your application code or workflow, please use deshred.rs as an example.

Last updated