मुख्य सामग्री पर जाएं

Making Solana gRPC Requests with TypeScript

को अपडेट
Jun 01, 2026
Performance Consideration for High-Volume Data Streams

If using Solana gRPC on Node.js for very large quantities of data, it is possible to overwhelm a single CPU. If you're building systems that need to process all transactions from busy programs or track multiple programs simultaneously, consider the following high performance alternatives:

  • Using multiple threads. Node.js has two modules: cluster (multi-process, one thread per process) and worker (single process, multiple threads). Either will solve the problem of node overloading a single core, but cluster is simpler as each process is memory isolated. Divide the Solana gRPC subscriptions between multiple instances of cluster या worker to distribute the load.

  • Using Solana gRPC on Rust (see also Solana gRPC on Rust guide)

  • Using Solana gRPC on Go (see also Solana gRPC on Go guide).

अवलोकन

TypeScript is a strongly-typed superset of JavaScript, offering improved developer experience and tooling support. This document provides a step-by-step process for setting up a TypeScript environment for interacting with Solana gRPC (Yellowstone-compatible Geyser gRPC), including setting up a project, configuring dependencies, and implementing authentication mechanisms.

Authentication Required for TypeScript

Creates a client in order to communicate with Solana gRPC. It uses an endpoint URL and an authentication token for secure access.

import { Client } from '@rpcpool/yellowstone-grpc';

// For HTTP Provider URL: https://example-guide-demo.solana-mainnet.quiknode.pro/123456789/

const ENDPOINT = 'https://example-guide-demo.solana-mainnet.quiknode.pro:10000';
const TOKEN = '123456789';
const client = new Client(ENDPOINT, TOKEN, {});


Note:

To learn how to split your सोलाना जीआरपीसी-enabled URL into endpoint और टोकन, refer to this section - Endpoint and Token Configuration

Setting up TypeScript

To run our TypeScript code examples, you'll need to have Node.js installed, as TypeScript is built on top of JavaScript. Ensure you also have TypeScript installed globally by running:

npm install -g typescript

Install Yellowstone gRPC Node Package

npm install @triton-one/yellowstone-grpc

अतिरिक्त संसाधन

For more information about working with Solana gRPC in TypeScript, refer to Monitor Solana Programs with Solana gRPC (TypeScript). This guide provides an in-depth overview of setting up gRPC endpoints, managing authentication tokens, and understanding key concepts like commitment levels.

हमें आपकी प्रतिक्रिया बहुत पसंद है!

यदि इस दस्तावेज़ के बारे में आपके कोई सुझाव या प्रश्न हैं, तो कृपया हमें बताएं । हमें आपकी प्रतिक्रिया जानकर खुशी होगी!

इस दस्तावेज़ को साझा करें