npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

solana-ts

v0.1.3

Published

Zero-idle-CPU local Solana RPC simulator powered by LiteSVM

Readme

solana-ts

A zero-idle-CPU local Solana RPC simulator powered by LiteSVM. Drop-in replacement for solana-test-validator that starts instantly, uses no CPU when idle, and persists state to a SQLite file.

Why

solana-test-validator ships a full validator binary — PoH, gossip, turbine, replay, leader schedule, voting — and burns CPU even when nothing is happening. This project strips all of that away and keeps only what matters for local app testing: an in-process SVM execution engine behind a Solana-compatible JSON-RPC server.

  • Starts in under a second
  • Zero CPU at idle (no slot ticking, no block production loop)
  • Transactions execute synchronously and are immediately "confirmed"
  • State persists to a single SQLite file across restarts
  • Wire-compatible with @solana/web3.js v1 Connection

Quick start

# Node 22.13+ is required for the built-in `node:sqlite` module
pnpm install
pnpm dev

The server listens on http://127.0.0.1:8899 (HTTP JSON-RPC) and ws://127.0.0.1:8900 (WebSocket PubSub).

Connect from any Solana app:

import { Connection } from "@solana/web3.js";

const connection = new Connection("http://localhost:8899", "confirmed");

CLI

solana-ts [options]

Options:
  -H, --host <address>             Bind address (default: "127.0.0.1")
  -p, --port <number>              HTTP/WS port (default: 8899)
  -l, --ledger <path>              SQLite database path (default: ~/.solana-ts/ledger.db)
      --reset                      Clear ledger on start
      --transaction-history <n>    Max transactions to retain (default: 5000)
      --log-level <level>          error | warn | info | debug (default: "info")
  -q, --quiet                      Suppress all output except errors
  -V, --version                    Output version number
  -h, --help                       Display help

Examples:

# Start with default settings
pnpm dev

# Bind to all interfaces on port 9000, fresh ledger each time
pnpm dev -- --host 0.0.0.0 --port 9000 --reset

# Use a specific ledger file
pnpm dev -- --ledger ./my-ledger.db

Supported RPC methods

| Method | Notes | |---|---| | getVersion | | | getHealth | | | getSlot | | | getBlockHeight | | | getLatestBlockhash | | | isBlockhashValid | | | getBalance | | | getAccountInfo | base64 encoding | | getMultipleAccounts | base64 encoding | | getMinimumBalanceForRentExemption | | | requestAirdrop | | | sendTransaction | base58 and base64 encoding | | simulateTransaction | | | getSignatureStatuses | | | getTransaction | JSON-decoded format | | getEpochInfo | | | getGenesisHash | Static value | | getRecentBlockhash | Legacy compat | | getFeeForMessage | Returns 5000 | | getIdentity | |

WebSocket subscriptions:

| Method | Notes | |---|---| | signatureSubscribe / signatureUnsubscribe | Required by confirmTransaction |

Architecture

@solana/web3.js  ─── HTTP JSON-RPC ──→  RPC Dispatcher  ──→  Method Handlers
                 ─── WebSocket ──────→  Subscription Mgr ─┘        │
                                                               SVM Engine
                                                              ┌────┴────┐
                                                          LiteSVM    SQLite

Transactions execute synchronously inside LiteSVM. After each transaction, modified account state is persisted to SQLite via Node's built-in node:sqlite module. On restart, accounts and slot counter are restored from the database.

WebSocket runs on port+1 (e.g. 8900) to match the convention used by @solana/web3.js, which derives the WS URL as rpc_port + 1.

Persistence

State is stored in a single SQLite file (default ~/.solana-ts/ledger.db):

  • accounts — address, lamports, data, owner, executable flag, rent epoch
  • transactions — signature, slot, raw bytes, JSON metadata, block time
  • metadata — key-value pairs (slot counter, etc.)

Use --reset to clear all state on startup.

Tests

pnpm test

Runs 36 tests covering basic RPC methods, airdrop/transfer flows, and persistence across server restarts (balance restore, slot resume, transaction history, --reset behavior, transacting on restored state).

Project structure

src/
  index.ts              CLI entry point
  server.ts             HTTP + WebSocket server
  engine.ts             LiteSVM wrapper with persistence
  persistence.ts        SQLite storage layer
  types.ts              Shared types and logger
  rpc/
    dispatcher.ts       JSON-RPC 2.0 routing
    methods.ts          RPC method handlers
    subscriptions.ts    WebSocket subscription manager
  test.ts               Integration tests