> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sint.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run SINT Protocol locally in under five minutes.

Clone the repo, install dependencies, boot the stack. Docker Compose runs the gateway, dashboard, Postgres, and Redis. Node.js 22+ and pnpm 9+ required.

## Prerequisites

<Steps>
  <Step title="Install Node.js 22+">
    ```bash theme={null}
    node --version   # v22.0.0 or higher
    ```
  </Step>

  <Step title="Install pnpm 9+">
    ```bash theme={null}
    npm install -g pnpm
    pnpm --version   # 9.0.0 or higher
    ```
  </Step>

  <Step title="Install Docker (optional, for full stack)">
    Docker Desktop or Docker Engine with Docker Compose v2.
  </Step>
</Steps>

## Clone and install

```bash theme={null}
git clone https://github.com/sint-ai/sint-protocol.git
cd sint-protocol

pnpm install
pnpm run build
pnpm run test           # 1,772 tests, takes ~2 minutes
```

## Option A — Full stack with Docker

```bash theme={null}
docker-compose up

# Gateway:     http://localhost:3100
# Dashboard:   http://localhost:3201
# Postgres:    localhost:5432
# Redis:       localhost:6379
```

Once the services are running, hit the health check:

```bash theme={null}
curl http://localhost:3100/v1/health
# → {"status":"ok","version":"0.2.0"}
```

## Option B — Gateway only (in-memory)

Fastest path for exploration. No Docker required.

```bash theme={null}
pnpm --filter @sint/gateway-server dev
# → http://localhost:3100/v1/health
# → http://localhost:3100/v1/ready
# → http://localhost:3100/v1/docs
```

The gateway runs with an in-memory ledger and in-memory revocation store. Data does not persist across restarts — fine for development, not for production.

## Your first intercept

Once the gateway is up, issue a capability token and intercept a request.

<Steps>
  <Step title="Issue a capability token">
    ```bash theme={null}
    curl -X POST http://localhost:3100/v1/tokens \
      -H "Content-Type: application/json" \
      -d '{
        "agentId": "did:key:z6MkExample",
        "scope": {
          "resources": ["ros2:///cmd_vel"],
          "actions":   ["publish"]
        },
        "physicalConstraints": {
          "maxLinearVelocity_ms": 1.0
        },
        "expiresIn": 3600
      }'
    # → {"tokenId":"tok_01HPX...","token":"ey..."}
    ```
  </Step>

  <Step title="Intercept a request">
    ```bash theme={null}
    curl -X POST http://localhost:3100/v1/intercept \
      -H "Content-Type: application/json" \
      -d '{
        "tokenRef":  "tok_01HPX...",
        "agentId":   "did:key:z6MkExample",
        "resource":  "ros2:///cmd_vel",
        "action":    "publish",
        "physicalContext": {
          "estimatedVelocity_ms": 0.8,
          "nearbyHumans":         false,
          "environmentClass":     "indoor_structured"
        }
      }'
    # → {
    #     "decision":   "ALLOW",
    #     "tier":       "T1",
    #     "ledgerHash": "sha256:a3f...",
    #     "budget_ms":  2000
    #   }
    ```
  </Step>

  <Step title="Inspect the ledger">
    ```bash theme={null}
    curl http://localhost:3100/v1/ledger?limit=10
    # → [{
    #     "eventType":   "POLICY_ALLOW",
    #     "tier":        "T1",
    #     "requestRef":  "req_01HPX...",
    #     "prevHash":    "sha256:...",
    #     "eventHash":   "sha256:a3f...",
    #     "timestamp":   "2026-04-17T02:40:12.123Z"
    #   }, ...]
    ```
  </Step>

  <Step title="Verify the hash chain">
    ```bash theme={null}
    curl -X POST http://localhost:3100/v1/ledger/verify \
      -H "Content-Type: application/json" \
      -d '{"from": 0, "to": 10}'
    # → {"valid": true, "verifiedAt": "..."}
    ```
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Explore the tiers" icon="layer-group" href="/protocol/tiers">
    Learn how T0–T3 tier assignment and Δ-factor escalation work.
  </Card>

  <Card title="Wire up MCP" icon="plug" href="/protocol/bridges">
    Put SINT in front of any MCP server as a security-enforcing proxy.
  </Card>

  <Card title="Wire up ROS 2" icon="robot" href="/protocol/bridges">
    Intercept topics, services, and actions with physics-aware policy.
  </Card>

  <Card title="Deploy to production" icon="server" href="/developers/deployment">
    Railway, Docker Compose, Kubernetes recipes.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="pnpm install fails with ERR_PNPM_UNSUPPORTED_ENGINE">
    You're on an older Node version. Upgrade to Node 22 or higher via nvm: `nvm install 22 && nvm use 22`.
  </Accordion>

  <Accordion title="Gateway starts but /v1/health returns 503">
    The gateway is up but the ledger or revocation store hasn't finished initializing. Wait 5–10 seconds. If it persists, check logs for database connection errors.
  </Accordion>

  <Accordion title="docker-compose fails with port 3100 in use">
    Another process is holding port 3100. Either stop it or set `SINT_GATEWAY_PORT=3101` in `.env` and update the docker-compose port mapping.
  </Accordion>

  <Accordion title="Tests fail with 'Module not found @sint/core'">
    Run `pnpm run build` before `pnpm test`. The workspace needs to build packages once before tests can resolve them.
  </Accordion>
</AccordionGroup>

<Tip>
  More questions? Join the community on [Discord](https://discord.gg/cYyeqVQ5j4) or open a [GitHub Discussion](https://github.com/sint-ai/sint-protocol/discussions).
</Tip>
