Skip to main content

Prerequisites

Use Node.js 24 or later, pnpm 10.33.0, Foundry 1.5.1, and PostgreSQL 16. Docker is convenient for the database. Use a disposable local wallet and database for development.

1. Clone and install

2. Start PostgreSQL

These are local development credentials. If this container already exists, start it with docker start spoke-postgres rather than creating a duplicate.

3. Create local environment files

The examples default to local Anvil and the local API. Keep real credentials out of Git. Do not put private provider URLs, signing keys, or database credentials in NEXT_PUBLIC_* variables.

4. Start Anvil

Run in its own terminal:
This starts a local chain on port 8545 with chain ID 31337.

5. Deploy the local contracts

In a second terminal, privately set DEPLOYER_PRIVATE_KEY to a funded, disposable Anvil account, then run:
Copy the printed protocol and token addresses into the API’s PROTOCOL_ADDRESS and TOKEN_ADDRESS, and the web application’s NEXT_PUBLIC_PROTOCOL_ADDRESS and NEXT_PUBLIC_DEMO_TOKEN_ADDRESS.

6. Run the application

Open http://localhost:3040. The API listens at http://localhost:8740; routes use the /v1 prefix. API startup runs its migrations against the configured database.

Configuration that must agree

The default local database URL uses 127.0.0.1:54332/spoke. The default local indexer mode is direct_rpc; the production deployment uses Envio ingestion and verified projection.

Verify your setup

Some API integration and gas-station tests require their documented disposable database or local chain fixtures. Consult the API README for those test-specific environments instead of pointing a test suite at production.

Reproduce settlement

The contract fixture guide explains how to create fresh demonstration wallets, fund test gas, seed paths and purchases, refund, finalize, and claim. Keep fixture signing material and full broadcast recovery files private. For deployment evidence without running transactions, use public proof.