| name | seed |
| description | Manage database seed data (PostgreSQL). Covers networks, tokens, auth providers, facilitator config, and any global_settings. Trigger: "seed", "add network", "add token", "update seed", "种子数据". |
Seed Data Manager
Single source of truth for all default data.
Seed File
| File | Dialect | Idempotent insert | Timestamp | Booleans |
|---|
deploy/seed/pg.sql | PostgreSQL | ON CONFLICT (...) DO NOTHING | NOW() | FALSE / TRUE |
Seed Data Categories
| Category | Table / Key | Conflict key |
|---|
| Networks | supported_networks | chain_id |
| Tokens | allowed_tokens | (symbol, network) |
| Facilitator config | global_settings key facilitator_config | (key) |
| Auth providers | global_settings key auth_providers | (key) |
| Admin accounts | admins + identities | (address) / (provider, provider_account_id, user_role) |
Steps
1. Read current seed file
cat deploy/seed/pg.sql
2. Determine the change
| Request example | Action |
|---|
| "Add Ethereum mainnet" | Add row to supported_networks |
| "Add USDT on Base" | Add row to allowed_tokens |
| "Remove Base Sepolia" | Remove row from supported_networks |
| "Enable GitHub login by default" | Update auth_providers JSON |
| "Change default facilitator URL" | Update facilitator_config JSON |
3. Look up required data
Networks:
| Field | Format |
|---|
chain_id | EVM chain ID (e.g., 1 = Ethereum, 42161 = Arbitrum) |
network_id | eip155:<chain_id> |
name | Human-readable (e.g., "Arbitrum One") |
short_name | Lowercase slug (e.g., "arbitrum") |
explorer_url | Block explorer root URL |
testnet | FALSE for mainnet, TRUE for testnet |
icon_url | https://icons.llamao.fi/icons/chains/rsz_<slug>.jpg |
Tokens:
| Field | Format |
|---|
symbol | Token symbol (e.g., "USDC") |
network | eip155:<chain_id> |
contract_address | On-chain address — verify from official docs |
Global settings (global_settings table):
Stored as key → value (JSON string). Current keys:
facilitator_config: {"facilitatorUrl":"...","cdpApiKeyId":"...","cdpApiKeySecret":""}
auth_providers: {"credentials":{"enabled":true},"google":{"enabled":false,...},"github":{"enabled":false,...}}
If unsure about a contract address, ask the user before writing.
4. Update seed file
Maintain:
- Section comment headers (
-- ── Facilitator defaults ──, etc.)
- Consistent column order matching existing rows
- Correct conflict keys per table
5. Update src/shared/tokens.ts (if tokens changed)
Check for KNOWN_ADDRESSES or similar maps and keep in sync.
6. Verify
7. Report
Output a summary:
| Table / Key | Action | Entry |
|-------------|--------|-------|
| supported_networks | Added | Arbitrum One (42161) |
| allowed_tokens | Added | USDC on Arbitrum (eip155:42161) |
Rules
- Always update the seed file — missing updates cause deploy inconsistency
- Every INSERT must be idempotent
- No hardcoded defaults in code — seed SQL is the only source of default data (see
rules/database.md)
- Contract addresses must be checksum-correct (EIP-55) or all-lowercase
- JSON values in
global_settings must be valid JSON strings (escape quotes)