Skip to main content

Getting Solana RPC

API Reference

curl -X POST -H "Content-Type: application/json" https://g.w.lavanet.xyz:443/gateway/solana/rpc-http/3dc655f970c930f1d3e78ee71beece18 --data '{"jsonrpc":"2.0","method":"getBlockHeight","params":[],"id":1}'

Gateway

To learn more about using the Lava Gateway visit the Getting Started guide



SDK

Input 📥

// Install lavaSDK with the following command:
// npm i @lavanet/lava-sdk
const { LavaSDK } = require("@lavanet/lava-sdk");

async function useSolanaMainnet() {
const solanaMainnet = await LavaSDK.create({
privateKey: process.env.PRIVATE_KEY, //hide your private key in an environmental variable
chainIds: "SOLANA",
});

const solanaBlockResponse = await solanaMainnet.sendRelay({
method: "getBlockHeight",
params: [],
});

console.log(solanaBlockResponse);
}

(async () => {
await useSolanaTestnet();
})();

Output 📤

To learn more about our SDK visit the Getting Started guide