Skip to main content

Getting CosmosHub RPC


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 useCosmoshubMainnet() {

const cosmoshubMainnet = await LavaSDK.create({
privateKey: process.env.PRIVATE_KEY, //hide your private key in an environmental variable
chainIds: 'COS5',
});

const cosmoshubBlockResponse = await cosmoshubMainnet.sendRelay({
method: "GET",
url: "/node_info",
rpcInterface: "rest",
});

console.log(cosmoshubBlockResponse);
}

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