Skip to content

Commit b64f8b3

Browse files
authored
docs: update all documentation to match current codebase (#81)
* docs: update all documentation to match current codebase * docs: remove PRD.md
1 parent 8f89538 commit b64f8b3

9 files changed

Lines changed: 869 additions & 1285 deletions

File tree

‎README.md‎

Lines changed: 81 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,121 @@
11
# Atlas
22

3-
A lightweight Ethereum L2 blockchain explorer.
3+
Atlas is an EVM blockchain explorer for ev-node based chains. It runs a Rust indexer, REST API, background workers, PostgreSQL database, and Vite frontend as one deployable stack.
4+
5+
## Current Architecture
6+
7+
- `atlas-server`: one Rust binary that runs the indexer, API, live SSE stream, metrics endpoint, optional faucet, optional Data Availability tracking, NFT metadata worker, missed-block gap-fill worker, and optional snapshot scheduler.
8+
- `postgres`: stores indexed blocks, transactions, addresses, ERC-20 data, NFT data, logs, contract verification data, proxy metadata, and indexer state.
9+
- `atlas-frontend`: Vite app served by unprivileged nginx on port 8080 inside the container, exposed as host port 80 by Docker Compose.
410

511
## Quick Start
612

7-
### Prerequisites
13+
Requirements:
814

9-
- `just` 1.0+
1015
- Docker and Docker Compose
11-
- Bun 1.0+
12-
- Rust 1.75+
13-
14-
### Running with Docker
16+
- An EVM JSON-RPC endpoint
1517

1618
```bash
1719
cp .env.example .env
18-
docker-compose up -d
20+
# Edit RPC_URL and CHAIN_NAME in .env
21+
docker compose up -d
1922
```
2023

21-
Access the explorer at http://localhost:3000
24+
Default service URLs:
25+
26+
| Service | URL |
27+
| --- | --- |
28+
| Explorer UI | `http://localhost` |
29+
| API through frontend nginx | `http://localhost/api` |
30+
| Backend API when running `atlas-server` locally | `http://localhost:3000/api` |
31+
| Prometheus metrics when backend port is reachable | `http://localhost:3000/metrics` |
32+
| Liveness probe when backend port is reachable | `http://localhost:3000/health/live` |
33+
| Readiness probe when backend port is reachable | `http://localhost:3000/health/ready` |
2234

23-
### Local Development
35+
The `postgres` service binds to `127.0.0.1:5432` for local development access. Docker Compose does not publish `atlas-server:3000` to the host by default; the frontend proxies browser API traffic through `http://localhost/api`.
36+
37+
## Local Development
38+
39+
Start only PostgreSQL:
2440

2541
```bash
26-
cp .env.example .env
27-
docker-compose up -d postgres
28-
just frontend-install
42+
docker compose up -d postgres
2943
```
3044

31-
Start the backend:
45+
Run the backend:
3246

3347
```bash
34-
just backend-run
48+
cd backend
49+
export DATABASE_URL=postgres://atlas:atlas@localhost:5432/atlas
50+
export RPC_URL=http://localhost:8545
51+
cargo run --bin atlas-server -- run
3552
```
3653

37-
Start frontend:
54+
Run the frontend:
3855

3956
```bash
40-
just frontend-dev
57+
cd frontend
58+
bun install
59+
bun run dev
4160
```
4261

43-
### Useful Commands
62+
The Vite dev server runs on `http://localhost:5173` and proxies `/api` to `http://localhost:3000`.
63+
64+
## Operator Commands
65+
66+
Run these from `backend/` unless noted otherwise:
4467

4568
```bash
46-
just --list
47-
just frontend-lint
48-
just frontend-build
49-
just backend-fmt
50-
just backend-clippy
51-
just backend-test
52-
just ci
69+
cargo run --bin atlas-server -- check
70+
cargo run --bin atlas-server -- migrate
71+
cargo run --bin atlas-server -- run
72+
cargo run --bin atlas-server -- db dump /tmp/atlas.dump
73+
cargo run --bin atlas-server -- db restore /tmp/atlas.dump
74+
cargo run --bin atlas-server -- db reset --confirm
5375
```
5476

55-
## Configuration
77+
Useful validation commands:
5678

57-
Copy `.env.example` to `.env` and set `RPC_URL`. Common options:
79+
```bash
80+
cd backend && cargo test --workspace
81+
cd frontend && bun run build
82+
cd frontend && bun run lint
83+
```
5884

59-
| Variable | Description | Default |
60-
|----------|-------------|---------|
61-
| `RPC_URL` | Ethereum JSON-RPC endpoint | Required |
62-
| `DATABASE_URL` | PostgreSQL connection string | `postgres://atlas:atlas@localhost:5432/atlas` (local dev) |
63-
| `START_BLOCK` | Block to start indexing from | `0` |
64-
| `BATCH_SIZE` | Blocks per indexing batch | `100` |
65-
| `RPC_REQUESTS_PER_SECOND` | RPC rate limit | `100` |
66-
| `FETCH_WORKERS` | Parallel block fetch workers | `10` |
67-
| `RPC_BATCH_SIZE` | Blocks per RPC batch request | `20` |
68-
| `IPFS_GATEWAY` | Gateway for NFT metadata | `https://ipfs.io/ipfs/` |
69-
| `REINDEX` | Wipe and reindex from start | `false` |
85+
## Configuration
7086

71-
See [White Labeling](docs/WHITE_LABELING.md) for branding customization (chain name, logo, colors).
87+
Copy `.env.example` to `.env`. `RPC_URL` is required. When running without Docker, `DATABASE_URL` is also required.
88+
89+
Common variables:
90+
91+
| Variable | Purpose | Default |
92+
| --- | --- | --- |
93+
| `RPC_URL` | EVM JSON-RPC endpoint | required |
94+
| `DATABASE_URL` | PostgreSQL connection URL for local backend runs | required outside Docker |
95+
| `CHAIN_NAME` | Display name served by `/api/config` and `/api/status` | `Unknown` |
96+
| `START_BLOCK` | First block to index | `0` |
97+
| `BATCH_SIZE` | Blocks written per DB batch | `100` |
98+
| `FETCH_WORKERS` | Concurrent block fetch workers | `10` |
99+
| `RPC_BATCH_SIZE` | Blocks fetched per RPC batch call | `20` |
100+
| `RPC_REQUESTS_PER_SECOND` | RPC request rate limit | `100` |
101+
| `DB_MAX_CONNECTIONS` | Indexer pool size | `20` |
102+
| `API_DB_MAX_CONNECTIONS` | API pool size | `20` |
103+
| `IPFS_GATEWAY` | Gateway for IPFS NFT metadata | `https://ipfs.io/ipfs/` |
104+
| `METADATA_FETCH_WORKERS` | NFT metadata worker concurrency | `4` |
105+
| `METADATA_RETRY_ATTEMPTS` | Retry attempts for retryable metadata failures | `3` |
106+
| `REINDEX` | Wipe indexed data and restart from `START_BLOCK` | `false` |
107+
108+
Optional features include Data Availability tracking, faucet support, white-label branding, scheduled snapshots, JSON logging, CORS restriction, and a Solidity compiler cache. See [.env.example](.env.example) and [Backend](backend/README.md) for the full operator reference.
72109

73110
## Documentation
74111

75-
- [API Reference](docs/API.md)
76112
- [Architecture](docs/ARCHITECTURE.md)
113+
- [API Reference](docs/API.md)
114+
- [Features](docs/FEATURES.md)
77115
- [White Labeling](docs/WHITE_LABELING.md)
78-
- [Product Requirements](docs/PRD.md)
116+
- [Product and Roadmap](docs/PRD.md)
117+
- [Backend](backend/README.md)
118+
- [Frontend](frontend/README.md)
79119

80120
## License
81121

0 commit comments

Comments
 (0)