## Migrating

*from Helius, QuickNode, Triton or rpc.carbium.io*

A client built for Helius, QuickNode or rpc.carbium.io moves by changing the URL; every key form works: query (`?api-key=` or `?apiKey=`), leading path segment, `x-token` header. One key and one bare domain, standard TLS, no region, for RPC, WebSocket and the carbon stream; only the stream adds `:9443`.

| plane | what you have | what to paste |
|---|---|---|
| **helius** |  |  |
| rpc | https://mainnet.helius-rpc.com/?api-key=\<YOUR_KEY> | https://services.carbium.sh/?api-key=\<YOUR_KEY> |
| websocket | wss://mainnet.helius-rpc.com/?api-key=\<YOUR_KEY> | wss://services.carbium.sh/?api-key=\<YOUR_KEY> |
| stream | https://laserstream-mainnet-\<region>.helius-rpc.com | https://services.carbium.sh:9443 |
| **quicknode** |  |  |
| rpc | https://\<name>.solana-mainnet.quiknode.pro/\<YOUR_KEY> | https://services.carbium.sh/\<YOUR_KEY> |
| websocket | wss://\<name>.solana-mainnet.quiknode.pro/\<YOUR_KEY> | wss://services.carbium.sh/\<YOUR_KEY> |
| stream | \<name>.solana-mainnet.quiknode.pro, x-token metadata | https://services.carbium.sh:9443, x-token metadata |
| **rpc.carbium.io** |  |  |
| rpc | https://rpc-service.carbium.io/?apiKey=\<old key> | https://services.carbium.sh/?api-key=\<YOUR_KEY> |
| websocket | wss://wss-rpc.carbium.io/?apiKey=\<old key> | wss://services.carbium.sh/?api-key=\<YOUR_KEY> |
| stream | grpc.carbium.io, x-token metadata | https://services.carbium.sh:9443, x-token metadata |

> A key from rpc.carbium.io does not work here. Sign up, create a key on [KEYS](https://carbium.sh/) and paste it with the new URL. The query name can stay `?apiKey=`, so on RPC and WebSocket only the host and key change. The stream also takes the port `:9443`.

> web3.js v1 derives its subscription URL from the HTTP one: set `wsEndpoint` on each `Connection`.

### clients

```
// web3.js v1: the subscription url is DERIVED from the http one, so set it
import { Connection } from "@solana/web3.js";
const conn = new Connection("https://services.carbium.sh/?api-key=<YOUR_KEY>", {
  commitment: "confirmed",
  wsEndpoint: "wss://services.carbium.sh/?api-key=<YOUR_KEY>",
});
await conn.getSlot();

// @solana/kit: two clients, one key. path carrier shown, query works the same
import { createSolanaRpc, createSolanaRpcSubscriptions } from "@solana/kit";
const rpc = createSolanaRpc("https://services.carbium.sh/<YOUR_KEY>");
const subs = createSolanaRpcSubscriptions("wss://services.carbium.sh/<YOUR_KEY>");
await rpc.getSlot().send();

# solana-py: header carrier, bare url. AsyncClient takes the same argument
from solana.rpc.api import Client
client = Client("https://services.carbium.sh", extra_headers={"x-api-key": "<YOUR_KEY>"})
client.get_slot().value

// rust: no sdk needed for the rpc plane
let body = serde_json::json!({"jsonrpc":"2.0","id":1,"method":"getSlot"});
let out: serde_json::Value = reqwest::Client::new()
    .post("https://services.carbium.sh")
    .header("x-api-key", "<YOUR_KEY>")
    .json(&body).send().await?.json().await?;
```

### carbon stream

```
// node: @triton-one/yellowstone-grpc. the type wants EVERY filter
// field present, so send the empty ones too. connect() first; the
// first request fixes the filters for the stream's life
import Client, { CommitmentLevel } from "@triton-one/yellowstone-grpc";
const client = new Client("https://services.carbium.sh:9443", "<YOUR_KEY>", {});
await client.connect();
const stream = await client.subscribe({
  accounts: {}, slots: { s: { filterByCommitment: true } }, transactions: {},
  transactionsStatus: {}, blocks: {}, blocksMeta: {}, entry: {},
  accountsDataSlice: [], commitment: CommitmentLevel.CONFIRMED,
});
stream.on("data", (u) => console.log(u));

// rust: yellowstone-grpc-client, same proto, same credential
let mut client = GeyserGrpcClient::build_from_shared("https://services.carbium.sh:9443")?
    .x_token(Some("<YOUR_KEY>"))?
    .tls_config(ClientTlsConfig::new().with_native_roots())?
    .connect().await?;
let mut req = SubscribeRequest::default();
req.slots.insert("s".into(), SubscribeRequestFilterSlots {
    filter_by_commitment: Some(true), ..Default::default() });
req.commitment = Some(CommitmentLevel::Confirmed as i32);
let (mut _tx, mut rx) = client.subscribe_with_request(Some(req)).await?;
while let Some(update) = rx.next().await { println!("{:?}", update?); }
```

> Also served: `getTransactionsForAddress`, the ten DAS methods ([DAS API](https://carbium.sh/docs/das.md)), `blockSubscribe`, the stream's unary calls `GetSlot`, `GetVersion`, `GetLatestBlockhash`, `GetBlockHeight`, `IsBlockhashValid`, `Ping` and `SubscribeReplayInfo`, and priority-fee estimates under Helius and QuickNode names and shapes (rates: [rate limits](https://carbium.sh/docs/limits.md)). A `getTransactionsForAddress` walk (full details, ascending, or any filter) bills per upstream call ([RPC](https://carbium.sh/docs/rpc.md)).

> History has a floor. `getSignaturesForAddress` pages come from an address index that keeps up to 30 days, so they reach below the validator's ledger floor. An empty page past 30 days marks the index's age limit; the address may have older transactions. `getFirstAvailableBlock` (the slot `getTransactionsForAddress` reports as `historyFloor`) is the ledger floor: the oldest slot `getTransaction` and `getBlock` serve. Signatures listed below it may not be fetchable with `getTransaction`.

### not served

| feature | provider | here |
|---|---|---|
| enhanced transactions REST | helius | decode getTransaction, getSignaturesForAddress or getTransactionsForAddress client side |
| metis REST | quicknode | the quote and swap JSON-RPC methods |
| swap API REST paths (api.carbium.io/api/v2/quote, /api/v1/swap) | carbium.io | the quote and swap JSON-RPC methods |
| gRPC Enhanced WebSocket (wss://grpc.carbium.io/?apiKey=, accountSubscribe and transactionSubscribe at finalized) | carbium.io | accountSubscribe: WebSocket endpoint, finalized unless you pass a commitment. transactionSubscribe is not served: use logsSubscribe with mentions, or a carbon stream transactions filter |
| requestAirdrop | helius, quicknode | mainnet only, no faucet |
| DAS proofs and compressed NFTs (getAssetProof, getAssetProofs, getAssetProofBatch, getAssetSignatures, getSignaturesForAsset) | helius, quicknode | unknown methods (-32601): do not retry |

> Unlike LaserStream or Yellowstone: an owner filter must name a provisioned owner or is refused. An account list takes any address and delivers only accounts the feed carries; a plain SOL wallet stays silent, so use transactions.accountInclude. `from_slot` replay: initial subscribe only, processed commitment. To change filters, reconnect. Heavy shapes (an owner with no account, the transaction firehose, blocks, entry) need a heavy-streams plan and share a node-wide ceiling ([rate limits](https://carbium.sh/docs/limits.md)). Frames are uncompressed; egress is metered as sent.

> Read [errors](https://carbium.sh/docs/errors.md) before porting a switch-case. The long form, with the gRPC status and WebSocket close-code tables, is the [SKILL.md](https://carbium.sh/docs/agents.md).

### from triton

#### Moving from Triton



The stock Yellowstone clients work on the carbon stream with a new endpoint and key. Your client library stays, and most Subscribe requests carry over as they are; the shapes refused here are listed below.

| what | what you have | what to paste |
|---|---|---|
| url clients | https://\<your-endpoint>.mainnet.rpcpool.com | https://services.carbium.sh:9443 |
| host:port clients | \<your-endpoint>.mainnet.rpcpool.com:443 | services.carbium.sh:9443, TLS |
| token | x-token: \<your-token> | x-token: \<YOUR_KEY>, or authorization: Bearer |

> One domain, no region to pick. Send the whole key: the short prefix the dashboard lists is a label and is refused as `unknown api key`. The stream reads `x-token` or `authorization: Bearer`; `x-api-key`, `?api-key=` and a key in the path work on RPC and WebSocket only.

##### your client

```
// node: @triton-one/yellowstone-grpc. the client stays; only the
// endpoint and the key change. before:
//   new Client("https://<your-endpoint>.mainnet.rpcpool.com",
//              "<your-token>", { ... })
import Client from "@triton-one/yellowstone-grpc";
const client = new Client("https://services.carbium.sh:9443", "<YOUR_KEY>", {
  grpcMaxDecodingMessageSize: 64 * 1024 * 1024,
});
await client.connect();

// rust: yellowstone-grpc-client. before:
//   build_from_shared("https://<your-endpoint>.mainnet.rpcpool.com")
//     .x_token(Some("<your-token>"))
let mut client = GeyserGrpcClient::build_from_shared("https://services.carbium.sh:9443")?
    .x_token(Some("<YOUR_KEY>"))?
    .tls_config(ClientTlsConfig::new().with_native_roots())?
    .max_decoding_message_size(64 * 1024 * 1024)
    .connect()
    .await?;
```

> Set the receive limit to 64 MiB or more, as above: block and transaction frames can be several MiB. On the grpc-js releases (5.0.0 and older) the channel option is `grpc.max_receive_message_length`.

##### rules to check in your code

| rule | what to do |
|---|---|
| 1 first request | It fixes the stream for its life: filters, `commitment`, `accountsDataSlice` and `fromSlot`. Send it at once: a stream with no request for 10 s ends with `DEADLINE_EXCEEDED` (a request with no filter, ping, `fromSlot` or `accountsDataSlice` counts as none). With `client.subscribe()` and then `stream.write(request)`, the write is the first request. |
| 2 later requests | A later request that changes a filter is ignored, with no error. For new filters open a new Subscribe, then close the old one. Only a ping is applied. |
| 3 size | Keep each request under 4 MiB. |
| 4 compression | Frames arrive uncompressed. Compressed requests (gzip, zstd) are accepted on Subscribe only, so send the unary calls uncompressed. |
| 5 ping | Ping every 10 s (`ping: { id }`) and a `pong` answers. Ping no more often: a ping that finds the control queue full (8 messages) ends the stream with `RESOURCE_EXHAUSTED`. The server's own `ping` frame comes every 15 s; ignore it. |
| 6 slow reader | A reader that stops taking frames is cut once the stream's send buffer is full and no frame is taken for 10 s. A reader that takes frames more slowly than they arrive is cut once it falls behind the feed's ring. Either way the stream ends with `RESOURCE_EXHAUSTED` `consumer_lagged`. Hand frames to a queue and keep the `data` handler non-blocking. |

##### where moved clients trip

> No startup snapshot, and `x-request-snapshot` does nothing here: seed state with RPC `getMultipleAccounts`, then apply updates, keeping the highest `(slot, writeVersion)` per pubkey.

> An `account` list delivers only writes the feed carries, so a plain SOL wallet stays silent. Follow a wallet with `transactions` and `accountInclude: [wallet]`, reading `meta.preBalances` and `meta.postBalances`.

> An `owner` filter with no `account` list is refused when it names an owner outside the covered ones; Stake and Vote are outside. A `blocks` frame carries only the transactions of 9 liquidity programs: for full blocks use RPC `getBlock` with `maxSupportedTransactionVersion: 1`.

> Refused before any charge: a bare transaction filter (`{}`), `tokenAccounts`, cuckoo filters (the client's `CompressedAccountFilterSet` emits one: send explicit `account` lists), a non-empty `blockFooter` and `entry[*].includeUpdateParent`. `SubscribeDeshred` and server reflection answer `UNIMPLEMENTED`.

> Credit costs, heavy shapes, limits and the covered owners: [carbon stream](https://carbium.sh/docs/stream.md), [rate limits](https://carbium.sh/docs/limits.md) and the [SKILL.md](https://carbium.sh/docs/agents.md).

##### plan and key

> Subscribe needs DEV, BUSINESS or PRO; FREE is refused. The key needs the GRPC scope: on [KEYS](https://carbium.sh/), press SCOPE on the key, select GRPC and Save. The starter key, and a key made on KEYS while on FREE, lack it and do not gain it on an upgrade. A key's IP allowlist applies to the stream too.

##### reconnect and replay

> `fromSlot` works only in the first request (else `INVALID_ARGUMENT` `from_slot is only supported on the initial subscribe request`) and only at processed commitment (else `PERMISSION_DENIED` `from_slot replay is available only at processed commitment`).

> The replay floor moves with traffic: use `fromSlot >= firstAvailable` from `SubscribeReplayInfo`. Below it the stream ends with `OUT_OF_RANGE` `gap: re-seed required`: re-seed over RPC and subscribe without `fromSlot`. A resume overlaps what you already have: dedupe transactions on `(slot, signature)` and accounts on `(pubkey, slot, writeVersion)`.

> The client's reconnect is off unless you turn it on (the fourth constructor argument in 5.x, `subscribeWithReconnect()` from 8.0.0, `subscribe_with_reconnect` from crate 14.0.0). It resubscribes with `fromSlot`, so these rules apply; we checked 5.0.9 only. The node admits 128 resumes in any 10 s: one past that is refused `too many streams are resuming from a past slot; retry shortly`. Retry with backoff, or re-seed over RPC and subscribe without `fromSlot`.

##### check the switch

```
# Carbon Stream  gRPC. No server reflection: pass geyser.proto and
# solana-storage.proto from rpcpool/yellowstone-grpc (yellowstone-grpc-proto/proto) in ./proto
grpcurl -import-path ./proto -proto geyser.proto -H 'x-token: <YOUR_KEY>' \
  -d '{"slots":{"s":{}},"accounts":{},"transactions":{}}' \
  services.carbium.sh:9443 \
  geyser.Geyser/Subscribe
# -> stream: slot updates, and a ping every 15 s
# authorization: Bearer <YOUR_KEY> also accepted
```

> Slot updates arrive, with the server's `ping` every 15 s. The response metadata carries `x-subscription-id` (32 hex characters): log it, and quote it when you report a problem.

##### if your consumer is refused

| status | message | fix |
|---|---|---|
| UNAUTHENTICATED | unknown api key | send the full key as x-token or authorization: Bearer |
| UNAUTHENTICATED | api key is not enabled for grpc | turn on GRPC for the key |
| PERMISSION_DENIED | streaming is not included in this tier; upgrade the plan | move to DEV, BUSINESS or PRO |
| PERMISSION_DENIED | heavy streams are not included in this plan; upgrade to BUSINESS | use a narrow shape (an account list, a narrowed transaction filter, blocksMeta in place of blocks), or upgrade |
| PERMISSION_DENIED | filter not in v1 coverage; request provisioning | an owner filter on an uncovered owner with no account list, a bare transaction filter, or a request with a ping, fromSlot or accountsDataSlice but no filter: fix the filter |
| RESOURCE_EXHAUSTED | max subscription limit exceeded | close idle streams, merge filters into fewer Subscribes, or upgrade |
