Skip to content
Concepts

RPC server

Promote any session to a Solana-compatible JSON-RPC endpoint at http://localhost:8899/session/<id>. The wire shape matches Solana RPC byte-for-byte. Anything that speaks Solana will speak Reley.

Start the server

desktop
Inspector → Details → RPC endpoint → Start
cli
pnpm cli session serve --session <sid>
⠿ JSON-RPC live  http://127.0.0.1:8899/session/main

Connect a client

@solana/web3.js
import { Connection, Keypair, SystemProgram, Transaction } from '@solana/web3.js'

const connection = new Connection(
  'http://127.0.0.1:8899/session/main',
  'confirmed'
)

const payer = Keypair.generate()
await connection.requestAirdrop(payer.publicKey, 1e9)

const tx = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: payer.publicKey,
    toPubkey: Keypair.generate().publicKey,
    lamports: 1000,
  })
)
await connection.sendTransaction(tx, [payer])

Phantom dev mode

Phantom's dev RPC field accepts custom URLs. Point it at your session URL, switch the wallet to Devnet network slot, and connect any dApp running locally. Transactions will sign with the real Phantom keypair and execute in the SVM sandbox.

Implemented methods

  • getAccountInfo, getMultipleAccounts, getProgramAccounts
  • getBalance, getMinimumBalanceForRentExemption
  • getLatestBlockhash, getBlockHeight, getSlot, getEpochInfo
  • sendTransaction, simulateTransaction, getSignatureStatuses
  • requestAirdrop (synthetic, against the sandbox bank)
  • getTokenAccountBalance, getTokenAccountsByOwner
note
Subscription methods (accountSubscribe, signatureSubscribe, etc.) over WebSocket are on the roadmap. The HTTP surface covers the entire send-and-confirm path used by web3.js, Anchor, and most wallet adapters today.