---
title: "Receive Deshreds with Solana Stream SDK"
description: "Receive ERPC Deshreds in Rust or Node.js without waiting for receiver-node replay; configure the endpoint, correlate ordinary Geyser results and reconnect."
canonical: "https://erpc.global/en/doc/geyser-grpc/deshreds/"
locale: "en"
---

# Receive Deshreds with Solana Stream SDK

Use Solana Stream SDK for Rust to receive signed transactions involving an account you watch without waiting for replay on the receiving node to finish. The example prints the first signature and slot, then exits. After compilation, the program's 30-second timeout covers connection, subscription setup and receipt of the transaction.

## Prepare your source IP and endpoint

Register your application's source IP for Geyser gRPC in the ERPC Dashboard and check the assigned endpoint. [Geyser connection setup](https://erpc.global/en/doc/geyser-grpc/quickstart/)

Transaction delivery through Deshreds is verified on endpoints in Singapore, Tokyo, Amsterdam, London, New York and Frankfurt. If the Dashboard assigns an endpoint in another region, check that it supports Deshreds before using it.

The example connects to `https://grpc-sgp6-1.erpc.global:443`. The machine running it must have permission to connect to the relevant Geyser endpoint from its source IP.

Install Rust 1.98.1 or later, Cargo, a C/C++ toolchain and Make. The initial run also builds native dependencies. The example uses the published `solana-stream-sdk = 5.2.1` crate.

## Download the example

Download and extract the example, including its dependency lockfile. Run Cargo with `--locked` to use the dependencies recorded in `Cargo.lock`.

```bash
curl -fLO https://erpc.global/examples/deshreds-rust.zip
unzip deshreds-rust.zip
cd deshreds-rust
```

[Download the example](https://erpc.global/examples/deshreds-rust.zip)

The `src/main.rs` file connects through the SDK's `GeyserGrpcClient` and passes an account filter to `subscribe_deshred_with_request`. It keeps the request stream alive and responds to server Pings while waiting for a transaction. After printing the first signature and slot, returning from the function closes the stream and connection.

The sample filters for the PumpSwap program by default. `account_include` selects transactions referencing any address in the list, including addresses resolved from address lookup tables.

## Print a signature and slot

Replace the value of `GEYSER_ENDPOINT` below with your assigned endpoint.

```bash
export GEYSER_ENDPOINT=https://grpc-sgp6-1.erpc.global:443
cargo run --locked
```

The output is one line containing a base58 signature after `signature=` and the numerical slot after `slot=`. To select your own account, set `GEYSER_ACCOUNT_INCLUDE` to its public address. A quiet account may have no matching transaction during the 30-second window.

```bash
GEYSER_ACCOUNT_INCLUDE=YOUR_ACCOUNT_PUBLIC_KEY cargo run --locked
```

`GEYSER_X_TOKEN` is an optional setting for Yellowstone endpoints that require token authentication. This ERPC connection procedure uses the source IP registered in the Dashboard.

## Receive a transaction with Node.js on Linux

For Linux x86_64 with glibc, Node.js 24 and pnpm 10.9.0, a second example uses `GeyserClient` from the published TypeScript SDK `@validators-dao/solana-stream-sdk = 4.0.0`. Its ZIP includes the TypeScript source and a CommonJS build ready to run.

```bash
curl -fLO https://erpc.global/examples/deshreds-node.zip
unzip deshreds-node.zip
cd deshreds-node
pnpm install --frozen-lockfile
node first-deshred.cjs
```

[Download the Node.js example](https://erpc.global/examples/deshreds-node.zip)

This example also connects over TLS to `https://grpc-sgp6-1.erpc.global:443`. By default, it selects transactions involving the PumpSwap program, prints one signature and slot, then exits. Set `GEYSER_ENDPOINT` and `GEYSER_ACCOUNT_INCLUDE` to change the endpoint and filter. The 30-second deadline covers connection, subscription setup and receipt of the first transaction; connection or subscription errors may occur earlier.

Use Linux x86_64 with glibc for this example. The published SDK 4.0.0 failed to load its native module on macOS arm64; use the Rust example above on macOS. The Rust and TypeScript packages have separate version numbers.

## Join the observation to its execution result

A Deshred transaction contains its signature, slot, instructions and referenced accounts. Use the metadata from an ordinary Geyser `transactions` subscription for execution success or failure, logs, inner instructions, balance changes and compute usage. [Ordinary transaction subscription examples](https://erpc.global/en/doc/geyser-grpc/code-examples/)

Correlate observations by signature and retain their slot and arrival time. Handle either arrival order and do not overwrite observations from different slots or forks. Continue processing transactions received only on ordinary Geyser. Set a retention deadline for unmatched Deshreds observations and check a separate history source after expiry; an unmatched observation alone does not establish failure or absence.

Correlate ordinary Geyser execution results and commitment updates from the same source by `slot` and `bank_id`, retaining them separately per bank. Deshreds transaction updates do not contain `bank_id`. A `bank_id` identifies a bank within one node process. Do not equate IDs from different nodes or across a restart. For recording or completion notifications that depend on success, use the verified execution result and the required commitment of that bank. To reconcile failed transactions as well, omit `failed` from the ordinary transaction filter; `failed: false` excludes failed transactions.

## Handle long-running connections

This introductory example stops after one transaction. A production receiver should monitor connection state and last-message time. On disconnection, check the error and the provider's retry conditions. If retrying is permitted, reconnect with increasing backoff and submit the filter again. The `SubscribeDeshred` request has no `from_slot` field, so use a separate history source to reconcile executed transactions during a gap. [Running a client in production](https://erpc.global/en/doc/geyser-grpc/best-practices/)

If you receive no transaction, check the Dashboard's registered IP against the actual source address, availability on your assigned endpoint, the TLS hostname and port, and activity matching your filter. Record the gRPC status and UTC time to distinguish connection errors from an idle subscription.
