Getting Started with Prism

This guide will help you install, configure, and run Prism, the high-performance Ethereum JSON-RPC aggregator.

Table of Contents


Prerequisites

Before installing Prism, ensure you have the following:

Required

  • Rust Nightly Toolchain: Prism uses nightly Rust features

    # Install rustup if you don't have it
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    # Install and set nightly as default for this project
    rustup install nightly
    rustup default nightly
  • cargo-make: Build automation tool

    cargo install cargo-make
  • cargo-nextest: Fast test runner

  • Docker and Docker Compose: For running the local devnet

System Requirements

  • CPU: 2+ cores recommended

  • RAM: Minimum 4GB, 8GB+ recommended for production

  • Disk: 10GB+ free space (more if caching large amounts of data)

  • Network: Stable internet connection for upstream RPC providers


Installation

  1. Clone the repository

  2. Development build

    This builds all workspace crates with default optimizations.

  3. Production build

    This creates optimized binaries with full release optimizations. The binaries will be located in:

    • Server: target/release/server

    • CLI: target/release/cli

Option 2: Docker

Prism can also run in Docker (configuration pending - see deployment guide).


First Configuration

Prism uses TOML configuration files. You can specify the config path via the PRISM_CONFIG environment variable or use the default config/config.toml.

Minimal Configuration

Create a file config/config.toml with the following minimal setup:

Replace YOUR_API_KEY and YOUR_PROJECT_ID with your actual RPC provider credentials.

Configuration with Free Public Endpoints

If you don't have API keys, you can start with public endpoints:

Note: Public endpoints have rate limits and may not be suitable for production use.

Validate Configuration

Before running Prism, validate your configuration:

This will check:

  • At least one upstream is configured

  • URLs are properly formatted

  • All required fields are present

  • Numeric values are valid


Running Prism

Start the Server

Using cargo-make (recommended):

Or directly with cargo:

Verify It's Running

The server should start and display:

Check the health endpoint:

Expected response:


Your First Request

Basic RPC Call

Make a simple eth_blockNumber request:

Response:

Cached Request

Try a request that will be cached:

Look for the X-Cache-Status header in the response. First request shows MISS, subsequent identical requests show FULL.

Get Logs with Partial Caching

Batch Requests

Send multiple requests in one HTTP call (send array to / endpoint):


Understanding Cache Status

Every response includes an X-Cache-Status header:

Status
Meaning

MISS

Request served entirely from upstream (not cached)

FULL

Complete cache hit, no upstream call needed

PARTIAL

Some data from cache, rest fetched from upstream

EMPTY

Cached empty result (e.g., no logs in range)

PARTIAL_WITH_FAILURES

Partial cache hit with some upstream failures

Example: Observing Cache Behavior


Monitoring Your Instance

Prometheus Metrics

Metrics are exposed at /metrics:

You'll see metrics like:

Health Checks

The /health endpoint provides detailed status:


Next Steps

Now that you have Prism running:

  1. Configure Advanced Features

  2. Optimize Caching

  3. Set Up Monitoring

    • Configure alerting for upstream failures

    • Monitor cache hit rates

  4. Add More Upstreams

    • Configure multiple RPC providers

    • Set up WebSocket subscriptions for real-time updates

  5. Production Hardening

    • Enable authentication

    • Configure rate limiting

    • Set up proper logging


Common Issues

Port Already in Use

If port 3030 is already taken:

Upstream Connection Failures

Check your upstream URLs and network connectivity:

Cache Not Working

Ensure caching is enabled and methods are cacheable:

Only these methods are cached:

  • eth_getBlockByHash

  • eth_getBlockByNumber

  • eth_getLogs

  • eth_getTransactionByHash

  • eth_getTransactionReceipt

High Memory Usage

Reduce cache sizes in configuration:


Getting Help


Quick Reference

Useful Commands

Default Ports

  • HTTP Server: 3030

  • Prometheus Metrics: 9090 (if enabled)

Important Files

  • Configuration: config/config.toml

  • Database: db/auth.db (if auth enabled)

  • Logs: Stdout/stderr (configure in logging section)


Ready to go deeper? Continue with the Configuration Reference to learn about all available options.

Last updated