> For the complete documentation index, see [llms.txt](https://plimsoll-protocol.gitbook.io/plimsoll-protocol-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plimsoll-protocol.gitbook.io/plimsoll-protocol-docs/developers/deploying.md).

# Deploying

```
Browser ──▶ static app (GitHub Pages / Vercel)
   │  └──────────────▶ indexer API (Render web service) ──▶ Postgres (Render, same region)
   │                          │
   └── reads/writes ──▶ Soroban RPC ◀── post_supply ──┘
                              ▲
                     Horizon ─┘ (supply source)
```

The browser talks to RPC directly for contract reads and for submitting signed transactions. The indexer is optional for the app and required for history, breakdowns and stellar.toml data.

## 1. Contracts

```bash
cd plimsoll-contracts
./scripts/deploy-testnet.sh
```

It deploys in dependency order, registers the poster and a demo auditor, issues a demo asset, lists assets, deploys the example vault, and prints:

```
REPORTER_REGISTRY_ID=C…
COVERAGE_LEDGER_ID=C…
COVERED_VAULT_ID=C…
```

## 2. Indexer on Render

1. In Render, **New → Blueprint**, and pick the `plimsoll-indexer` repo. It reads `render.yaml`: one Go web service and one Postgres database in the same region, connected by the internal URL.
2. When prompted, set `SUPPLY_POSTER_SECRET` to the poster's secret (`stellar keys show plimsoll-poster`). Leave it empty for read-only.
3. Deploy, then open `https://<service>.onrender.com/healthz`.

Build command: `go build -tags netgo -ldflags "-s -w" -o bin/plimsoll-indexer ./cmd/plimsoll-indexer`. Start command: `./bin/plimsoll-indexer`.

Free Render services sleep when idle, and the poster stops while asleep. Use a paid instance for a reliable poster.

## 3. App

**GitHub Pages** (current): the `pages.yml` workflow builds on every push to `main` with `NEXT_PUBLIC_BASE_PATH=/plimsoll-app`, deploys, and then fetches every page from the live URL. To connect the indexer, set a repository variable `NEXT_PUBLIC_INDEXER_URL` (Settings → Secrets and variables → Actions → Variables) and re-run the workflow.

**Vercel**: import the repo with root directory `apps/web`, install command `cd ../.. && npm ci`, build command `cd ../.. && npm run build`, output directory `out`. Set `NEXT_PUBLIC_*` variables in the project settings before deploying.

## If the app still calls localhost in production

`NEXT_PUBLIC_*` values are compiled into the static files. If you set `NEXT_PUBLIC_INDEXER_URL` after the build, the old value is still in the files. Set it in the platform's build environment and rebuild.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://plimsoll-protocol.gitbook.io/plimsoll-protocol-docs/developers/deploying.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
