RapidNode Docs
Back to WebsiteX/Twitter
  • Welcome
    • What is RapidNode?
  • Solana RPC Nodes
    • RapidNode RPCs Overview
    • Dedicated Nodes
      • Getting Started with Dedicated Nodes
    • Dedicated Staked Connections
    • Common Error Codes
  • RPC
    • HTTP
      • getAccountInfo
      • getBalance
      • getBlock
      • getBlockCommitment
      • getBlockHeight
      • getBlockProduction
      • getBlockTime
      • getBlocks
    • Websocket
  • Data Streaming
    • gRPC
    • Webhooks
  • Solana APIs
    • Priority Fee API
    • Enhanced Transaction API
    • Token Metadata API
  • Guides
    • RPC Proxy — Protect Your Keys
    • Sending Transactions on Solana
  • Resources
    • RapidNode Blog
    • SDKs
    • Transaction Types
    • Status Page
Powered by GitBook
On this page
  • Working With Your Node
  • Set up your gRPC Plugin
  1. Solana RPC Nodes
  2. Dedicated Nodes

Getting Started with Dedicated Nodes

Restricted to Institutional Clients Only

Working With Your Node

RPC and Websocket Each dedicated node comes with an RPC URL that you can use, as shown in the example below.

Here, we are using Solana web3.js to call getSlot using our dedicated node:

// Using @solana/web3.js const { Connection } = require('@solana/web3.js');
const connection = new Connection('https://your-dedicated-rapidnode-rpc.com?api-key=YOUR_API_KEY');
// Get the current slot const getSlot = async () => { const slot = await connection.getSlot(); console.log('Current slot:', slot); };
getSlot();

This is how you would set up a native WebSocket connection to stream new slots:

const message = "hello world";
console.log(messageconst Websocket = require('ws'); const ws = new Websocket('wss://your-dedicated-rapidnode-rpc.com?api-key=YOUR_API_KEY');
ws.onopen = () => { ws.send(JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'slotSubscribe' })); };
ws.onmessage = (event) => { console.log(JSON.parse(event.data)); };

Set up your gRPC Plugin

To begin using the gRPC plugin, you need to clone the repo:

git clone https://github.com/rapidnode/yellowstone-grpc.git

Using the CLI

cd yellowstone-grpc/examples/rust/ cargo run --bin client -- -e "https://your-dedicated-rapidnode-rpc.com:2053" --x-token YOUR_API_TOKEN subscribe --slots

Once complete, you should see the terminal output new slots. Don't forget to replace the URL and Token with your own.

PreviousDedicated NodesNextDedicated Staked Connections

Last updated 4 months ago