|
38 | 38 |
|
39 | 39 | ## System Overview |
40 | 40 |
|
| 41 | +> **Note:** Platform now supports two operating modes: **Centralized Mode** (default, using platform-server) and **P2P Mode** (recommended, fully decentralized). See the [Decentralized P2P Mode](#decentralized-p2p-mode-recommended) section for the peer-to-peer architecture. |
| 42 | +
|
41 | 43 | Platform involves three main participants: |
42 | 44 |
|
43 | 45 | - **Miners**: Submit code/models to challenges for evaluation |
@@ -368,6 +370,54 @@ docker compose up -d |
368 | 370 |
|
369 | 371 | The validator will auto-connect to platform-server at `chain.platform.network` and sync. |
370 | 372 |
|
| 373 | +## Decentralized P2P Mode (Recommended) |
| 374 | + |
| 375 | +Platform supports a fully decentralized architecture where validators communicate via P2P without requiring a central server. |
| 376 | + |
| 377 | +### Benefits |
| 378 | +- **No single point of failure** - No dependency on chain.platform.network |
| 379 | +- **Fully trustless** - Validators reach consensus via PBFT |
| 380 | +- **Bittensor-linked state** - State changes are linked to Subtensor block numbers |
| 381 | +- **DHT storage** - Submissions and evaluations stored across the network |
| 382 | + |
| 383 | +### Quick Start (P2P Mode) |
| 384 | + |
| 385 | +```bash |
| 386 | +git clone https://github.com/PlatformNetwork/platform.git |
| 387 | +cd platform |
| 388 | +cp .env.example .env |
| 389 | +# Edit .env: add your VALIDATOR_SECRET_KEY (BIP39 mnemonic) |
| 390 | +docker compose -f docker-compose.decentralized.yml up -d |
| 391 | +``` |
| 392 | + |
| 393 | +### Architecture (P2P Mode) |
| 394 | + |
| 395 | +``` |
| 396 | +┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ |
| 397 | +│ VALIDATOR 1 │◄───►│ VALIDATOR 2 │◄───►│ VALIDATOR N │ |
| 398 | +│ (libp2p) │ │ (libp2p) │ │ (libp2p) │ |
| 399 | +└────────┬────────┘ └────────┬────────┘ └────────┬────────┘ |
| 400 | + │ │ │ |
| 401 | + └───────────────────────┼───────────────────────┘ |
| 402 | + │ |
| 403 | + ▼ |
| 404 | + ┌─────────────────────────┐ |
| 405 | + │ BITTENSOR CHAIN │ |
| 406 | + │ (Weight Commits) │ |
| 407 | + │ State linked to blocks │ |
| 408 | + └─────────────────────────┘ |
| 409 | +``` |
| 410 | + |
| 411 | +### P2P Configuration |
| 412 | + |
| 413 | +| Variable | Description | Default | |
| 414 | +|----------|-------------|---------| |
| 415 | +| `VALIDATOR_SECRET_KEY` | BIP39 mnemonic or hex key | - | |
| 416 | +| `SUBTENSOR_ENDPOINT` | Bittensor RPC endpoint | `wss://entrypoint-finney.opentensor.ai:443` | |
| 417 | +| `NETUID` | Subnet UID | `100` | |
| 418 | +| `P2P_LISTEN_ADDR` | libp2p listen address | `/ip4/0.0.0.0/tcp/9000` | |
| 419 | +| `BOOTSTRAP_PEERS` | Bootstrap peers (comma-separated) | - | |
| 420 | + |
371 | 421 | ## Hardware Requirements |
372 | 422 |
|
373 | 423 | | Resource | Minimum | Recommended | |
@@ -413,7 +463,7 @@ Standard REST endpoints for submissions, evaluations, and challenges. |
413 | 463 | | `SUBTENSOR_ENDPOINT` | Bittensor RPC endpoint | `wss://entrypoint-finney.opentensor.ai:443` | No | |
414 | 464 | | `NETUID` | Subnet UID | `100` | No | |
415 | 465 | | `RUST_LOG` | Log level | `info` | No | |
416 | | -| `PLATFORM_SERVER_URL` | Platform server URL | `https://chain.platform.network` | No | |
| 466 | +| `PLATFORM_SERVER_URL` | Platform server URL | `https://chain.platform.network` | No (centralized mode only) | |
417 | 467 | | `PLATFORM_PUBLIC_URL` | Public URL for challenge containers | - | Yes | |
418 | 468 | | `DATABASE_URL` | PostgreSQL connection (server only) | - | Yes (server) | |
419 | 469 | | `OWNER_HOTKEY` | Subnet owner hotkey | - | Yes (server) | |
|
0 commit comments