runicRPC Logo
runicRPCv0.1
Documentation

How to Use runicRPC from npm

For Developers (SDK)

1. Install the SDK

npm install @runic-rpc/sdk @solana/web3.js

2. Use in your project

import { RunicRPC } from '@runic-rpc/sdk';
import { PublicKey } from '@solana/web3.js';

const rpc = new RunicRPC({
  providers: {
    helius: { apiKey: 'YOUR_HELIUS_KEY' },
  },
  strategy: 'latency-based',
});

const balance = await rpc.request('getBalance', [new PublicKey('...')]);

For Quick Testing (CLI)

1. Install the CLI globally

npm install -g @runic-rpc/cli

2. Initialize a config file

runic-rpc init

3. Test your providers

runic-rpc test --providers helius,alchemy --env .env

For Monitoring (Dashboard)

1. Install the dashboard globally

npm install -g @runic-rpc/dashboard

2. Launch the dashboard

runic-rpc-dashboard --port 3000

3. Open http://localhost:3000

For Building Custom UIs (UI Components)

1. Install the UI package

npm install @runic-rpc/ui

2. Add the Tailwind preset (in tailwind.config.js)

module.exports = {
  presets: [require('@runic-rpc/ui/tailwind-preset')],
  // ...
}

3. Import styles (in your CSS)

@import '@runic-rpc/ui/styles';

4. Use components

import { Button, AppShell, Sidebar } from '@runic-rpc/ui';

export default function App() {
  return (
    <AppShell>
      <Sidebar>...</Sidebar>
      <Button>Click me</Button>
    </AppShell>
  );
}

Summary Table

PackageInstall CommandUse Case
@runic-rpc/sdknpm i @runic-rpc/sdk @solana/web3.jsAdd load-balanced RPC to your app
@runic-rpc/clinpm i -g @runic-rpc/cliTest providers from terminal
@runic-rpc/dashboardnpm i -g @runic-rpc/dashboardMonitor RPC infrastructure
@runic-rpc/uinpm i @runic-rpc/uiBuild custom monitoring UIs