Local Development
Use the pinned Node, pnpm, and Solidity versions before evaluating repository behavior.
#Requirements
- Node 22.23.2 from
.nvmrc. - pnpm 11.24.0 from the root package manager field.
- Foundry with Solidity 0.8.30 as pinned in foundry.toml.
- Docker Compose for PostgreSQL and packaged services when supported.
#Install
cd /root/weedswap
corepack enable
make bootstrapBootstrap installs pnpm packages and the pinned Foundry dependencies before creating a local example environment. Do not commit local env files, database credentials, private keys, or generated deployment secrets. Keep real values outside version control.
#Environment variables
| Variable | Purpose |
|---|---|
| NEXT_PUBLIC_DATA_MODE | Selects launch, live, local, or explicit fixture-free demo rendering. |
| NEXT_PUBLIC_SITE_URL | Sets the canonical HTTP(S) origin for metadata and the sitemap. |
| DATABASE_URL | Connects the indexer to PostgreSQL. |
| CHAIN_ID | Pins the chain expected by the indexer. |
| RPC_URL | Provides the server-side indexer RPC endpoint. |
| START_BLOCK | Sets the first block eligible for indexing. |
| CONFIRMATION_DEPTH | Sets how many confirmations the indexer waits. |
| INDEX_ADDRESSES | Lists verified deployed contracts whose logs may be indexed. |
| PORT | Sets the indexer HTTP health and metrics port. |
| POSTGRES_PASSWORD | Supplies the raw PostgreSQL service secret during VPS deployment; it must match the decoded DATABASE_URL password. |
| WEEDSWAP_DOMAIN | Configures the Caddy public host. |
Production indexer startup requires every listed server-side input and has no local fallback. The VPS preflight validates the external environment file before Compose starts, verifies its encoded database password against POSTGRES_PASSWORD, and Compose consumes that same URL. Never publish private keys, authenticated RPC credentials, or database secrets in browser-prefixed variables.
#Run package checks
pnpm format:check
pnpm lint
pnpm typecheck
pnpm test
NEXT_PUBLIC_DATA_MODE=launch NEXT_PUBLIC_SITE_URL=http://localhost:3000 pnpm build
NEXT_PUBLIC_DATA_MODE=launch NEXT_PUBLIC_SITE_URL=http://localhost:3000 pnpm e2e#Run contract checks
cd packages/contracts
forge fmt --check
forge build
forge test -vvv
forge coverage#Local stack
make bootstrap && make dev-local starts local PostgreSQL and Anvil, creates an ephemeral local mnemonic in a protected temporary directory, deploys local-only token and legacy v3 test identities, launches the indexer, and starts the web app. The mnemonic is removed on exit. These local contracts are accounting fixtures for the current implementation, not a deployable Pons integration or production market implementation.
#Data modes
The public pre-launch mode keeps values zero. Demo mode changes presentation without seeding protocol activity. Live mode never falls back to demo or launch values when a network or indexer read fails.
