Shredstream gRPC
Benefits
If you're a trader or need to receive transaction data earlier than your competitors, simple subscription to Yellowstone gRPC endpoint 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 node 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.
Check out Geyser vs Shredstream benchmark on our Github.
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.
When using Shredstream gRPC, shreds are already reconstructed to Solana entries, which contain already ordered and serialized transactions.
For more info about the format of Solana entry, please refer to Solana documentation.
How to create a direct subscription to Jito Shredstream?
If you already have a Solana dedicated node, you can use following endpoint for gRPC subscription:
sol-shredstream-CUSTOMER.rpcfast.net:443To decode gRPC stream, you need protobuf files. You can get them here: https://github.com/jito-labs/mev-protos
Install grpcurl software onto your machine.
Launch grpcurl command from the directory where protobuf files has been downloaded:\
You will start to receive encoded Solana entries.
How to decode Solana shreds into human-readable format?
Clone the repository https://github.com/dysnix/solana-test
Run the following command inside repository to download code example
Navigate to
jito-shredstream-proxy/examplesdirectory.Install Rust language tools onto your machine.
Set environment variables
Launch code example
You will receive decoded transactions for each slot.
If you want to integrate this to your application code or workflow, please use
deshred.rsas an example.
Last updated