Skip to main content

Getting Your API Key

1

Subscribe to Service

Subscribe to the gRPC service at $247/month to get access to:
  • EU endpoint: https://grpc.solanatracker.io
  • US endpoint: https://grpc-us.solanatracker.io
  • Accelerated by Jito Shreds
  • No bandwidth charges
2

Receive Credentials

After subscription, you’ll receive:
  • Your API token
  • Endpoint URLs
  • Configuration guidelines
3

Test Connection

Verify your credentials work by creating a simple test connection

Authentication Methods

Header-Based Authentication

Add your API token to the request headers:
x-token
string
required
Your API token for authenticating gRPC requests

Client Configuration

TypeScript/JavaScript

npm install @triton-one/yellowstone-grpc
import Client from "@triton-one/yellowstone-grpc";

const client = new Client(
  "https://grpc.solanatracker.io",  // or https://grpc-us.solanatracker.io
  "your-api-token",
  {
    // Recommended settings
    "grpc.max_receive_message_length": 64 * 1024 * 1024,  // 64MB
    "grpc.max_send_message_length": 64 * 1024 * 1024,     // 64MB
    "grpc.keepalive_time_ms": 30000,                      // 30 seconds
    "grpc.keepalive_timeout_ms": 5000,                    // 5 seconds
  }
);

Rust

[dependencies]
yellowstone-grpc-client = "9.0.1"
yellowstone-grpc-proto = "9.0.1"
tokio = { version = "1.0", features = ["full"] }
tonic = "0.10"
use yellowstone_grpc_client::GeyserGrpcClient;
use std::time::Duration;

let endpoint = "https://grpc.solanatracker.io";
let token = Some("your-api-token".to_string());

let client = GeyserGrpcClient::build_from_shared(endpoint)?
    .x_token(token)?
    .connect_timeout(Duration::from_secs(10))
    .timeout(Duration::from_secs(10))
    .max_decoding_message_size(64 * 1024 * 1024)
    .connect()
    .await?;

Go

go get github.com/rpcpool/yellowstone-grpc/examples/golang@latest
go get google.golang.org/[email protected]
import (
    "google.golang.org/grpc"
    "google.golang.org/grpc/metadata"
)

conn, err := grpc.Dial(
    "grpc.solanatracker.io:443",
    grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")),
    grpc.WithDefaultCallOptions(
        grpc.MaxCallRecvMsgSize(64 * 1024 * 1024),
        grpc.MaxCallSendMsgSize(64 * 1024 * 1024),
    ),
)

// Add authentication
ctx := metadata.AppendToOutgoingContext(context.Background(), "x-token", "your-api-token")

Endpoint Selection

Choose the endpoint that provides the best latency for your infrastructure:

Primary Endpoint

https://grpc.solanatracker.io
  • Best for global applications
  • Automatic routing
  • High availability

US Endpoint

https://grpc-us.solanatracker.io
  • Optimized for North America
  • Lower latency for US-based apps
  • Direct US routing
Test both endpoints and use the one with lower latency from your deployment region.

Configuration Best Practices

Message Size Limits

Set appropriate message size limits to handle large blocks and transaction batches:
{
  "grpc.max_receive_message_length": 64 * 1024 * 1024,  // 64MB
  "grpc.max_send_message_length": 64 * 1024 * 1024      // 64MB
}

Keepalive Settings

Configure keepalive to maintain persistent connections:
{
  "grpc.keepalive_time_ms": 30000,        // Send keepalive every 30s
  "grpc.keepalive_timeout_ms": 5000,      // Wait 5s for keepalive response
  "grpc.keepalive_permit_without_calls": 1 // Allow keepalive without active calls
}

Connection Timeouts

Set reasonable timeout values:
{
  "grpc.initial_reconnect_backoff_ms": 1000,  // Start with 1s backoff
  "grpc.max_reconnect_backoff_ms": 30000,     // Max 30s backoff
  "grpc.min_reconnect_backoff_ms": 1000       // Min 1s backoff
}

Testing Your Connection

Create a simple test to verify your setup:
import Client, { CommitmentLevel } from "@triton-one/yellowstone-grpc";

async function testConnection() {
  const client = new Client(
    "https://grpc.solanatracker.io",
    "your-api-token",
    {
      "grpc.max_receive_message_length": 64 * 1024 * 1024
    }
  );

  try {
    const stream = await client.subscribe();
    
    stream.on("data", (data) => {
      console.log("Connection successful! Received data:", data);
      stream.end();
      client.close();
      process.exit(0);
    });

    stream.on("error", (error) => {
      console.error("Connection error:", error);
      process.exit(1);
    });

    // Subscribe to slot updates (lightweight test)
    const request = {
      slots: { slotSubscribe: {} },
      commitment: CommitmentLevel.CONFIRMED
    };

    stream.write(request);

    console.log("Testing connection...");
  } catch (error) {
    console.error("Failed to connect:", error);
    process.exit(1);
  }
}

testConnection();

Troubleshooting

Error: UNAUTHENTICATED or Invalid tokenSolutions:
  • Verify your API token is correct
  • Check token is properly set in headers
  • Ensure subscription is active
Error: Connection times out or fails to establishSolutions:
  • Verify endpoint URL is correct (include https://)
  • Check firewall allows outbound gRPC connections
  • Try alternative endpoint
  • Increase connection timeout settings
Error: RESOURCE_EXHAUSTED or message size errorsSolutions:
  • Increase max_receive_message_length to 64MB
  • Increase max_send_message_length to 64MB
  • Use data slicing to reduce message sizes
  • Apply more specific filters

Security Best Practices

Protect Your API Token
  • Never commit tokens to version control
  • Use environment variables for tokens
  • Rotate tokens periodically
  • Implement token management system

Environment Variables

Store your credentials securely:
# .env file
GRPC_ENDPOINT=https://grpc.solanatracker.io
GRPC_API_TOKEN=your-api-token
import * as dotenv from 'dotenv';
dotenv.config();

const client = new Client(
  process.env.GRPC_ENDPOINT!,
  process.env.GRPC_API_TOKEN!,
  { /* ... */ }
);

Next Steps

I