Developers

Run the app locally

Dapp, indexer and contracts on a fork of Robinhood Chain.

Repositories: pinarc-dapp (React Router v7 on Cloudflare Workers, Hono, D1, wagmi/viem) and pinarc-contracts (Foundry).

Contracts

cd pinarc-contracts
cp .env.example .env               # ROBINHOOD_RPC_URL — archive-capable, e.g. https://robinhood.drpc.org
forge build
set -a; source .env; set +a
forge test                         # fork tests against Robinhood Chain (real Uniswap V2)

Fork tests need historical state, so use an archive endpoint (publicnode prunes state after a few minutes). Deploying to Robinhood Chain mainnet:

set -a; source .env; source ~/.config/pinarc/deployer.env; set +a
forge script script/Deploy.s.sol --rpc-url "$ROBINHOOD_RPC_URL" --broadcast   # writes deployments/4663.json

The deploy script refuses to run on anything but chain id 4663 (or a local 31337 fork).

App

cd pinarc-dapp
pnpm install
cp .dev.vars.example .dev.vars     # RPC_URL (archive endpoint), SYNC_SECRET
pnpm db:migrate:local              # D1 schema into the local SQLite
pnpm dev

Without contract addresses the app renders empty. For a complete local environment — contracts deployed on an anvil fork of Robinhood Chain, a mintable USDG stand-in, funded wallets, .dev.vars filled in:

pnpm fork      # needs foundry and ../pinarc-contracts
pnpm dev

Deploying the app

Set the contract addresses (PINARC_FACTORY, PINARC_CONFIG, PINARC_BOND, PINARC_FLOOR, PINARC_LOCKER, PINARC_VAULT, PINARC_START_BLOCK) in wrangler.jsonc from deployments/4663.json, the D1 database_id, and the RPC_URL / SYNC_SECRET secrets, then pnpm db:migrate:remote and pnpm deploy. The cron trigger (* * * * *) runs the indexer. RPC_URL_PUBLIC (browser reads) defaults to https://robinhood-rpc.publicnode.com.