Run Server

Run the Server

The Node.js server provides the REST API for managing cap tables. It connects to MongoDB for storage and to the blockchain for on-chain operations.

Development mode

If you used pnpm docker:up, the server is already running in Docker. You can view logs with pnpm docker:logs.

For local development with hot-reload, run the server outside Docker:

Start the server locally

pnpm dev

This runs the server with hot-reloading and the event poller enabled.

Verify it's running

curl http://localhost:8293/

You should see a response confirming the server is up.

Tip: For local server development, use ./scripts/dev.sh --no-server to run MongoDB + app in Docker, then run pnpm dev separately for hot-reload.

What is the event poller?

The event poller watches the blockchain for contract events (like stock issuances, transfers, etc.) and syncs them to MongoDB. This keeps your off-chain database in sync with on-chain state.

  • pnpm dev - Server with event poller (recommended for development)
  • pnpm prod - Server without event poller
  • pnpm prod-poller - Standalone event poller only (for production, processes finalized blocks)

For local development, use pnpm dev which includes the poller. In production, you'd typically run the server and poller as separate processes.

Next steps

With the server running, you can deploy your first cap table using the API.