Skip to main content
Version: 0.14 (unstable)

How to Run

This guide covers running a Guardian server locally for development or testing.

Prerequisites

  • Docker and Docker Compose (recommended), or
  • Rust toolchain 1.90+ (to build from source)

The repository includes a Docker Compose configuration with PostgreSQL:

git clone https://github.com/OpenZeppelin/private-state-manager.git
cd private-state-manager
docker-compose up -d

This starts:

ServicePortDescription
Guardian HTTP APIlocalhost:3000REST endpoints
Guardian gRPC APIlocalhost:50051gRPC service
PostgreSQLlocalhost:5432Metadata and state storage

View logs:

docker-compose logs -f

Stop services:

docker-compose down

Building from source

git clone https://github.com/OpenZeppelin/private-state-manager.git
cd private-state-manager

# With filesystem storage (default)
cargo build --release --bin server
cargo run --release --bin server

# With PostgreSQL storage
DATABASE_URL=postgres://psm:password@localhost:5432/psm \
cargo run --features postgres --package private-state-manager-server

Ports

ProtocolDefault PortDescription
HTTP3000REST API
gRPC50051gRPC service

Both can be configured programmatically via the ServerBuilder:

use server::builder::ServerBuilder;

let builder = ServerBuilder::new()
.http(true, 3000)
.grpc(true, 50051);

Verifying the server

Once running, check the server's acknowledgment public key:

curl http://localhost:3000/pubkey
# Returns: { "pubkey": "0x..." }

This endpoint is unauthenticated and confirms the server is operational.