serve
Start the Piri server and begin participating in the Storacha network.
This is a long-running process that operates your storage node. Once started, Piri will:
- Accept storage requests - Receive and store data from clients via the UCAN protocol
- Generate PDP proofs - Create Provable Data Possession proofs on a regular schedule to demonstrate you're storing data correctly
- Respond to challenges - Submit proofs to the on-chain PDP smart contract during challenge windows
- Publish to IPNI - Announce stored content to the InterPlanetary Network Indexer for discoverability
- Handle retrievals - Serve stored data back to clients on request
The server runs continuously, writing logs to the terminal. For production deployments, you should run it as a systemd service or use a process manager to ensure it restarts on failure.
Prerequisites
Before running this command:
- Run
piri initto generate a configuration file - this registers your node with the network and creates your proof set - Ensure your TLS reverse proxy is running (Nginx with SSL certificates)
- Verify your Lotus node is synced and accessible
Configuration
The server reads its configuration from a TOML file generated by piri init. You can specify the config file path with --config, or place it in the default location (~/.config/piri/config.toml) for automatic loading.
Most flags below are already set in your config file - you typically only need --config to start the server. See the Configuration docs for details on all available settings.
Usage
Flags
| Flag | Description | Default |
|---|---|---|
--config <path> |
Path to configuration file | ~/.config/piri/config.toml |
--host <host> |
Host to listen on | localhost |
--port <port> |
Port to listen on | 3000 |
--public-url <url> |
URL the node is publicly accessible at | |
--network <network> |
Network the node operates on | |
--proof-set <id> |
Proof set ID to use with PDP | |
--lotus-url <url> |
WebSocket URL for Lotus node | |
--owner-address <address> |
Ethereum address to submit PDP proofs with (must be in piri wallet) |
Example
▗▄▄▖ ▄ ▄▄▄ ▄ ▗
▐▌ ▐▌▄ █ ▄ █▌
▐▛▀▘ █ █ █ ▗█▘
▐▌ █ █ ▀▘
v0.2.1
did:key:z6MkhaXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Piri Running on: localhost:3000
Piri Public Endpoint: https://piri.example.com
Stopping the Server
Use Ctrl+C to gracefully stop the server. On shutdown, Piri will:
- Wait for any active retrievals to finish
- Wait for any in-progress chain tasks (proving, message sends) to complete
- Force stop after 1 minute if tasks haven't completed
Before stopping for maintenance or upgrades, check if it's safe using piri status to ensure you're not in the middle of a challenge window.
See the Setup Guide for complete setup instructions and the Upgrading guide for safe update procedures.