Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ POSTGRES_DB=yaci
POSTGRES_HOST=localhost
POSTGRES_PORT=5432

# Derived connection string for reset guard / scripts (leave blank to auto-build)
RESET_GUARD_DB_URI=
# Set to true automatically by scripts/configure-env.sh after prompting once
SKIP_ENV_PROMPTS=false

Expand Down Expand Up @@ -61,9 +59,6 @@ VITE_ANALYTICS_NETWORK_BLOCK_WINDOW=100
VITE_ANALYTICS_NETWORK_TX_WINDOW=1000
VITE_ANALYTICS_NETWORK_MSG_WINDOW=2000
VITE_ANALYTICS_NETWORK_REFRESH_MS=10000
VITE_RESET_NOTICE_ENABLED=true
VITE_RESET_NOTICE_REFETCH_MS=30000
VITE_RESET_NOTICE_HASH_CHECK_HEIGHT=5

# -----------------------------------------------------------------------------
# Chain metadata overrides (optional)
Expand All @@ -87,9 +82,3 @@ VITE_LINK_GITHUB=
VITE_LINK_DISCORD=
VITE_LINK_TWITTER=

# -----------------------------------------------------------------------------
# Reset guard (optional)
# -----------------------------------------------------------------------------
ENABLE_CHAIN_RESET_GUARD=false
RESET_GUARD_RPC_ENDPOINT=
RESET_GUARD_AUTO_TRUNCATE=true
12 changes: 0 additions & 12 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,10 @@ SKIP_CONFIRM=1 ./scripts/reset-devnet.sh

Bare metal:
```bash
yarn reset:full
# Full redeploy with rebuild:
yarn redeploy:systemd
```

### Automatic Reset Guard

Set in .env:
```bash
ENABLE_CHAIN_RESET_GUARD=true
CHAIN_RPC_ENDPOINT=http://localhost:26657
RESET_GUARD_AUTO_TRUNCATE=true
```

Detects genesis hash change and height rewind, automatically truncates tables or warns for manual intervention.

## Database Schema

- `blocks_raw`: id (bigint), data (jsonb)
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ bun run lint # Lint code
| Variable | Purpose | Default |
| -- | -- | -- |
| `CHAIN_GRPC_ENDPOINT` | Chain gRPC endpoint | `localhost:9090` |
| `CHAIN_RPC_ENDPOINT` | Tendermint RPC (used by reset guard/banner) | `http://localhost:26657` |
| `CHAIN_RPC_ENDPOINT` | Tendermint RPC | `http://localhost:26657` |
| `POSTGRES_USER` | Database role used by PostgREST/Yaci | `yaci` |
| `POSTGRES_PASSWORD` | DB password | `changeme` |
| `VITE_POSTGREST_URL` | PostgREST base URL for the UI | `http://localhost:3000` |
| `VITE_CHAIN_REST_ENDPOINT` | REST endpoint for IBC denom traces | unset |
| `CHAIN_ID`, `CHAIN_NAME` | Override auto-detection | auto |
| `YACI_IMAGE` | Yaci image tag | `ghcr.io/cordtus/yaci:main` |
| `ENABLE_CHAIN_RESET_GUARD` | Auto-wipe DB when chain restarts | `false` |
| `RESET_GUARD_AUTO_TRUNCATE` | Whether the guard truncates automatically | `true` |

### Frontend config overrides (`VITE_*`)
All UI timing/limit constants can be tuned via env vars (see `.env.example`). Highlights:
Expand All @@ -84,7 +82,6 @@ All UI timing/limit constants can be tuned via env vars (see `.env.example`). Hi
| `VITE_TX_PAGE_SIZE` | Transactions per page | `20` |
| `VITE_SEARCH_ADDRESS_LIMIT` | Max address results checked | `20` |
| `VITE_ANALYTICS_*` | Lookbacks + refresh intervals for charts/cards | (various) |
| `VITE_RESET_NOTICE_ENABLED` | Toggle the chain-reset banner | `true` |
| `VITE_QUERY_*` | React Query cache timings | `10s` / `5m` |

Multi-chain: run separate compose stacks with unique `POSTGRES_PORT`, `POSTGREST_PORT`, `EXPLORER_PORT`.
Expand Down Expand Up @@ -126,8 +123,6 @@ curl "http://localhost:3000/messages_main?mentions=cs.{ADDRESS}"
- Docker: Stops services, removes postgres volume, restarts
- Bare-metal: Truncates index tables via psql

**Auto-detection:** Set `ENABLE_CHAIN_RESET_GUARD=true` + `CHAIN_RPC_ENDPOINT` for automatic reset on chain restart.

## License

MIT
25 changes: 0 additions & 25 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,6 @@ services:
networks:
- yaci-network

chain-reset-guard:
image: alpine:3.19
container_name: yaci-explorer-reset-guard
command: ["/bin/sh", "/scripts/chain-reset-guard.sh"]
environment:
ENABLE_CHAIN_RESET_GUARD: ${ENABLE_CHAIN_RESET_GUARD:-false}
CHAIN_RPC_ENDPOINT: ${CHAIN_RPC_ENDPOINT:-}
RESET_GUARD_RPC_ENDPOINT: ${RESET_GUARD_RPC_ENDPOINT:-}
RESET_GUARD_DB_URI: ${RESET_GUARD_DB_URI:-}
RESET_GUARD_AUTO_TRUNCATE: ${RESET_GUARD_AUTO_TRUNCATE:-true}
POSTGRES_USER: ${POSTGRES_USER:-yaci}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-yaci}
POSTGRES_HOST: postgres
depends_on:
postgres:
condition: service_healthy
volumes:
- ../scripts/chain-reset-guard.sh:/scripts/chain-reset-guard.sh:ro
networks:
- yaci-network
restart: "no"

yaci:
image: ghcr.io/cordtus/yaci:main
container_name: yaci-indexer
Expand All @@ -83,8 +60,6 @@ services:
depends_on:
postgres:
condition: service_healthy
chain-reset-guard:
condition: service_completed_successfully
restart: unless-stopped
networks:
- yaci-network
Expand Down
3 changes: 0 additions & 3 deletions public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
"networkMessageWindow": 2000,
"networkRefetchMs": 10000
},
"resetNotice": {
"enabled": false
},
"branding": {
"footerText": "Manifest Network Explorer"
},
Expand Down
5 changes: 0 additions & 5 deletions public/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
"networkMessageWindow": 2000,
"networkRefetchMs": 10000
},
"resetNotice": {
"enabled": true,
"refetchIntervalMs": 30000,
"hashCheckHeight": 5
},
"branding": {
"logoUrl": "",
"faviconUrl": "",
Expand Down
167 changes: 0 additions & 167 deletions scripts/chain-reset-guard.sh

This file was deleted.

6 changes: 1 addition & 5 deletions scripts/configure-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ pg_db="$(sanitize "$pg_db")"
pg_host="$(sanitize "$pg_host")"
pg_port="$(sanitize "$pg_port")"

db_uri="postgres://${pg_user}:${pg_password}@${pg_host}:${pg_port}/${pg_db}"

python3 - <<'PY' "$ENV_FILE" "$pg_user" "$pg_password" "$pg_db" "$pg_host" "$pg_port" "$db_uri"
python3 - <<'PY' "$ENV_FILE" "$pg_user" "$pg_password" "$pg_db" "$pg_host" "$pg_port"
import pathlib, shlex, sys
env_path = pathlib.Path(sys.argv[1])
updates = {
Expand All @@ -106,7 +104,6 @@ updates = {
"POSTGRES_DB": sys.argv[4],
"POSTGRES_HOST": sys.argv[5],
"POSTGRES_PORT": sys.argv[6],
"RESET_GUARD_DB_URI": sys.argv[7],
"SKIP_ENV_PROMPTS": "true",
}
lines = env_path.read_text().splitlines()
Expand All @@ -133,4 +130,3 @@ echo "[configure-env] Updated .env with:"
echo " POSTGRES_USER=$pg_user"
echo " POSTGRES_DB=$pg_db"
echo " POSTGRES_PASSWORD=<hidden>"
echo " RESET_GUARD_DB_URI=$db_uri"
Loading