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

purgatory

v0.0.6

Published

A local mempool proxy for Ethereum that intercepts, holds, and controls transaction forwarding to upstream nodes. Perfect for debugging, testing, and understanding mempool behavior.

Downloads

433

Readme

Purgatory

A local mempool proxy for Ethereum that intercepts, holds, and controls transaction forwarding to upstream nodes. Perfect for debugging, testing, and understanding mempool behavior.

Overview

Purgatory acts as an RPC proxy between your application and an Ethereum node. It intercepts eth_sendRawTransaction calls, stores transactions in a local mempool, and gives you full control over when and how they're forwarded to the actual network.

Key Features

  • Transaction Interception: Captures all eth_sendRawTransaction calls
  • Gas Price Filtering: Set minimum gas price thresholds
  • Auto-Forward Control: Toggle automatic forwarding to upstream node
  • Transaction Replacement: Configurable replacement bump requirements (like EIP-1559 pools)
  • Batch Operations: Include or drop multiple transactions at once
  • REST API: Full mempool management via REST endpoints
  • Web Dashboard: Visual UI for monitoring and managing transactions
  • Multi-Platform: Deploy on Node.js or Cloudflare Workers

Quick Start

Prerequisites

  • Node.js 18+
  • pnpm

Installation

npm i purgatory

Using it

purgatory [options]

Options:
  -p, --port <port>    Port to listen on (default: 8545)
  --db <sqlite.db>     Path to SQLite database file (default: in-memory)
  --rpc-url <url>      RPC URL for the upstream Ethereum node
  --reset-db           Reset the database on startup

Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Your DApp     │────▶│    Purgatory    │────▶│  Ethereum Node  │
│                 │     │   (port 8545)   │     │  (port 8546)    │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                              │
                              ▼
                        ┌───────────┐
                        │  SQLite   │
                        │  Storage  │
                        └───────────┘

API Reference

JSON-RPC Endpoint

POST /

Standard Ethereum JSON-RPC proxy. All methods are forwarded to the upstream node except for intercepted methods:

Intercepted Methods

  • eth_sendRawTransaction: Transactions are decoded, validated, and stored in the local mempool. Forwarding depends on the autoForward setting.

  • eth_getTransactionByHash: Returns transactions from local mempool if pending locally, otherwise queries upstream.

  • eth_getTransactionCount: Accounts for local pending transactions when blockTag is "pending".

REST API

State Management

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /api/mempool/state | Get current mempool state | | POST | /api/mempool/gas-price | Set minimum gas price | | POST | /api/mempool/auto-forward | Enable/disable auto-forwarding | | POST | /api/mempool/replacement-mode | Enable/disable transaction replacement | | POST | /api/mempool/replacement-bump | Set minimum replacement bump percentage |

Transaction Queries

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /api/mempool/stats | Get mempool statistics | | GET | /api/mempool/pending | List all pending transactions | | GET | /api/mempool/history | Get transaction history | | GET | /api/mempool/tx/:hash | Get specific transaction | | GET | /api/mempool/sender/:address | Get transactions by sender |

Transaction Management

| Method | Endpoint | Description | |--------|----------|-------------| | POST | /api/mempool/include/:hash | Forward a specific transaction | | POST | /api/mempool/drop/:hash | Drop a pending transaction | | POST | /api/mempool/include-batch | Forward multiple transactions | | POST | /api/mempool/drop-batch | Drop multiple transactions | | POST | /api/mempool/flush | Forward all pending transactions | | DELETE | /api/mempool/clear | Clear all pending transactions |

Health

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /health | Health check | | GET | /health/upstream | Upstream node health check |

Web Dashboard

Access the visual dashboard at /ui to:

  • View pending, forwarded, and dropped transactions
  • Monitor mempool statistics
  • Control auto-forward and gas price settings
  • Manually include or drop transactions

Development

Running Tests

# Run all tests
pnpm test

# Run server tests
cd packages/server
pnpm test

Development Mode

# Start with hot reload
pnpm nodejs:dev

# Or run the full local setup with Zellij
pnpm start:nodejs

Formatting

pnpm format        # Format all files
pnpm format:check  # Check formatting

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.