Lewati ke isi

Phase 2 — Private Testnet

Jaringan invite-only untuk tim internal Garuda Prime dan partner terpilih sebelum public testnet.

Spesifikasi

Parameter Nilai
Chain ID 8845
Konsensus IBFT 2.0 PoS
Validators 5
Block Time 2 detik
Akses Invite-only (API Key)
Token GAT

Arsitektur

Partner App → RPC Gateway (8540) → Validator 1 (8545)
                    ↓ API Key Auth
              Allowlist Check
                    ↓
         Validator 2-5 (sync via bootnode)

Quick Start

# 1. Start private testnet (5 validators + gateway)
npm run private:up

# 2. Monitor validators
npm run private:monitor

# 3. Deploy smart contracts
npm run contracts:deploy:private

# 4. Start apps (gunakan env private testnet)
cp .env.private-testnet .env
npm run dev:explorer
npm run dev:api
npm run dev:gateway

Akses RPC (Invite-Only)

Semua request ke gateway memerlukan header X-API-Key:

curl -X POST http://localhost:8540 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: garuda-private-dev-key-change-in-production" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

API Keys Default

Key Team Permissions
garuda-private-dev-key-change-in-production Garuda Prime Dev rpc, faucet, explorer
garuda-partner-qa-key-change-in-production Partner QA rpc, explorer

Penting: Ganti semua API key sebelum production deployment.

MetaMask Configuration

{
  "chainId": "0x2285",
  "chainName": "Garuda Chain Private Testnet",
  "nativeCurrency": {
    "name": "Garuda Asset Token",
    "symbol": "GAT",
    "decimals": 18
  },
  "rpcUrls": ["http://localhost:8540"],
  "blockExplorerUrls": ["http://localhost:3000"]
}

Gunakan RPC Gateway (port 8540) dengan API key support via custom RPC proxy, atau internal RPC (8545) untuk development lokal.

Validator Endpoints

Validator RPC Port P2P Port
Validator 1 (bootnode) 8545 30303
Validator 2 8547 30304
Validator 3 8549 30305
Validator 4 8551 30306
Validator 5 8553 30307

Contract Registry

Setelah deploy, alamat kontrak tersimpan di:

chain/deployments/private-testnet.json

Partner Onboarding

  1. Tambahkan wallet partner ke chain/config/private-testnet/allowlist.json
  2. Generate API key baru untuk partner
  3. Bagikan RPC gateway URL + API key
  4. Bagikan konfigurasi MetaMask
  5. Arahkan ke dokumentasi SDK

Monitoring

# Cek status semua validator
npm run private:monitor

# Logs
npm run private:logs

# Stop network
npm run private:down

Security

  • RPC admin/debug methods diblokir di gateway
  • Rate limiting per API key
  • IP allowlist untuk akses internal
  • Wallet allowlist untuk faucet
  • Multi-sig treasury (3-of-5)

Next: Phase 3

Public Testnet dengan faucet publik, explorer publik, dan validator program terbuka.