diff --git a/docs/testnet/DEFI_ORACLE_META_TESTNET_2138_RUNBOOK.md b/docs/testnet/DEFI_ORACLE_META_TESTNET_2138_RUNBOOK.md new file mode 100644 index 0000000..6ca7999 --- /dev/null +++ b/docs/testnet/DEFI_ORACLE_META_TESTNET_2138_RUNBOOK.md @@ -0,0 +1,118 @@ +# Defi Oracle Meta Testnet (Chain ID 2138) — Runbook + +**Last Updated:** 2026-03-27 +**Status:** Active +**Purpose:** Map creation and deployment of **Defi Oracle Meta Testnet** (EIP-155 chain ID **2138**) to this repository’s layouts, scripts, and docs. Use alongside mainnet Chain 138 material as a parallel path. + +--- + +## 1. Identifiers and EIP-155 + +| Item | Value | +|------|--------| +| **Chain ID (decimal)** | 2138 | +| **Chain ID (hex)** | `0x85a` | +| **CAIP-2 (namespaced)** | `eip155:2138` | +| **Legacy EIP-155 `v` (replay protection)** | `4311` or `4312` (= `2 × 2138 + 35 + {0,1}`) | +| **Chainlist-style metadata (this repo)** | `pr-workspace/chains/_data/chains/eip155-2138.json` | + +**Features:** The chainlist entry records **EIP-155** and **EIP-1559**. Wallets and SDKs should set `chainId: 2138` and use typed / EIP-1559 transactions as supported. + +**Network ID note:** `eip155-2138.json` lists `"networkId": 21` (devp2p wire identifier). For a **new** Besu network, align Besu `--network-id` (or TOML `network-id`) and any published metadata with your operator choice—either keep **21** if that is your live testnet convention or set **network-id = 2138** everywhere for simplicity. **Do not** mix mismatched `network-id` across nodes. + +--- + +## 2. Preconditions + +- Decide **topology** (validator count, sentries, RPC nodes)—mirror [Besu mainnet vs Chain 138 comparison](../05-network/BESU_MAINNET_VS_CHAIN138_COMPARISON.md). +- Separate **genesis and keys** from mainnet (`chainId` **138**): testnet must use its own `genesis.json`, static nodes, and data directories. +- Reference mainnet genesis shape: `smom-dbis-138/config/genesis.json` (`config.chainId` is **138** today). For 2138, produce a **new** genesis with `config.chainId: 2138` and QBFT `extraData` for **your** validators. + +--- + +## 3. Phase A — Genesis and keys + +| Step | Action | Repo pointers | +|------|--------|----------------| +| A1 | Generate QBFT genesis for **chainId 2138** | [BESU_OFFICIAL_REFERENCE.md](../06-besu/BESU_OFFICIAL_REFERENCE.md) (`quorum-genesis-tool --chainID 2138`, adjust validators/members/bootnodes) | +| A2 | Document validator addresses and `extraData` | Same patterns as [NEXT_STEPS_AFTER_GENESIS_UPDATE.md](../archive/NEXT_STEPS_AFTER_GENESIS_UPDATE.md) (archive—process only) | +| A3 | Node P2P keys, `static-nodes.json`, optional permissioning | [CHAIN138_BESU_CONFIGURATION.md](../06-besu/CHAIN138_BESU_CONFIGURATION.md), [BESU_CONFIGURATION_GUIDE.md](../04-configuration/BESU_CONFIGURATION_GUIDE.md) | + +Store testnet artifacts in a dedicated tree (example convention—create under operator control): + +- `smom-dbis-138/config/genesis-testnet-2138.json` (or separate repo/dir), **not** mixed into production `genesis.json` without review. + +--- + +## 4. Phase B — Proxmox / container deployment (LAN) + +Orchestration for Besu validated sets lives under **`smom-dbis-138-proxmox/`** (not the root `scripts/`). + +| Step | Action | Script / path | +|------|--------|----------------| +| B1 | Full stack: containers, config copy, bootstrap, validate | `smom-dbis-138-proxmox/scripts/deployment/deploy-validated-set.sh` (`--source-project` pointing at a tree that contains **testnet** genesis + keys) | +| B2 | Deploy nodes only | `smom-dbis-138-proxmox/scripts/deployment/deploy-besu-nodes.sh` | +| B3 | Copy configs and keys to VMs | `smom-dbis-138-proxmox/scripts/copy-besu-config.sh` or `copy-besu-config-with-nodes.sh` | +| B4 | Bootstrap / static peers | `smom-dbis-138-proxmox/scripts/network/bootstrap-network.sh`, `network/update-static-nodes.sh` | +| B5 | Validation | `smom-dbis-138-proxmox/scripts/validation/validate-deployment-comprehensive.sh`, `validate-validator-set.sh`, root-level `smom-dbis-138-proxmox/scripts/validate-besu-config.sh` | + +**Important:** Point `SOURCE_PROJECT` (or your copied config layout) at files where **`chainId` is 2138** and Besu `network-id` matches all nodes. + +--- + +## 5. Phase C — RPC, TLS, and public endpoints + +| Step | Action | Notes | +|------|--------|--------| +| C1 | Expose HTTP/WebSocket RPC | Same Besu RPC flags as Chain 138; restrict APIs on validators, full APIs on RPC tier ([BESU_MAINNET_VS_CHAIN138_COMPARISON.md](../05-network/BESU_MAINNET_VS_CHAIN138_COMPARISON.md)) | +| C2 | Reverse proxy / TLS | Align with public URLs you publish; chainlist currently lists `https://rpc.public-2138.defi-oracle.io` and `wss://…` (`pr-workspace/chains/_data/chains/eip155-2138.json`) | +| C3 | Verify | `curl -s POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' ` → `0x85a` | + +--- + +## 6. Phase D — Explorer + +| Step | Action | Repo pointers | +|------|--------|----------------| +| D1 | Deploy explorer UI stack | `smom-dbis-138-proxmox/scripts/deployment/deploy-explorer.sh` (adapt env for **2138** RPC) | +| D2 | Explorer monorepo / API | `explorer-monorepo/docs/EXPLORER_API_ACCESS.md`; aim Blockscout (or equivalent) at testnet RPC | + +Update **`eip155-2138.json`** `explorers` when the canonical explorer URL is final. + +--- + +## 7. Phase E — Contracts and apps (`smom-dbis-138`) + +| Step | Action | Repo pointers | +|------|--------|----------------| +| E1 | Env for RPC and chain ID | Copy `smom-dbis-138/terraform/phases/phase1/config/env.chain2138.example` → `.env.chain2138` (or merge into `smom-dbis-138/.env`); set `CHAIN_ID=2138`, `RPC_URL=…` | +| E2 | Deploy / verify | Forge scripts under `smom-dbis-138/script/` (mirror mainnet flow in [DEPLOYMENT_ORDER_OF_OPERATIONS.md](../03-deployment/DEPLOYMENT_ORDER_OF_OPERATIONS.md), [REMAINING_DEPLOYMENTS_FOR_FULL_NETWORK_COVERAGE.md](../03-deployment/REMAINING_DEPLOYMENTS_FOR_FULL_NETWORK_COVERAGE.md)); use `--rpc-url` for testnet | +| E3 | Bridge / CCIP | Only after Chainlink / router support for **2138** exists: fill selectors and addresses like `env.chain138.example` pattern in `env.chain2138.example` | +| E4 | Frontend / Wagmi | Add a `defineChain({ id: 2138, … })` entry parallel to `smom-dbis-138/frontend-dapp/src/config/networks.ts` | +| E5 | Wallet docs | Mirror [CHAIN138_WALLET_CONFIG_VALIDATION.md](../04-configuration/CHAIN138_WALLET_CONFIG_VALIDATION.md) with name **Defi Oracle Meta Testnet**, chain ID **2138**, `0x85a`, and testnet RPC/explorer URLs | + +--- + +## 8. Phase F — Registry and QA + +| Step | Action | +|------|--------| +| F1 | Keep `pr-workspace/chains/_data/chains/eip155-2138.json` accurate (RPC, explorers, faucets, `networkId`). | +| F2 | Optional: thirdweb / aggregator RPC URLs (compare `eip155-138.json`). | +| F3 | Run smoke tests: deploy contract, EIP-1559 fee tx, read `eth_chainId`. | +| F4 | Document funded test accounts or a **faucet** (currently empty in chainlist). | + +--- + +## 9. Solidity / Foundry test constants + +Use `smom-dbis-138/test/config/Chain2138TestnetConfig.sol` (parallel to `Chain138Config.sol`). Point `RPC_URL_2138` at your LAN or staging node when running fork or live tests. + +--- + +## 10. Related documents + +- Generic public testnets (Sepolia, etc.): [TESTNET_DEPLOYMENT.md](TESTNET_DEPLOYMENT.md) +- Mainnet wallet RPC: [CHAIN138_WALLET_CONFIG_VALIDATION.md](../04-configuration/CHAIN138_WALLET_CONFIG_VALIDATION.md) +- Besu index: [06-besu/MASTER_INDEX.md](../06-besu/MASTER_INDEX.md) +- Operational runbooks: [03-deployment/OPERATIONAL_RUNBOOKS.md](../03-deployment/OPERATIONAL_RUNBOOKS.md) diff --git a/docs/testnet/TESTNET_DEPLOYMENT.md b/docs/testnet/TESTNET_DEPLOYMENT.md index a74a895..6b61b55 100644 --- a/docs/testnet/TESTNET_DEPLOYMENT.md +++ b/docs/testnet/TESTNET_DEPLOYMENT.md @@ -1,13 +1,23 @@ # Testnet Deployment Guide -**Last Updated:** 2026-01-31 -**Document Version:** 1.0 +**Last Updated:** 2026-03-27 +**Document Version:** 1.1 **Status:** Active Documentation **Purpose:** Guide for deploying and testing on testnets. --- +## Defi Oracle Meta Testnet (chain ID 2138) + +For **this project’s** L1 testnet (EIP-155 chain ID **2138**, CAIP-2 `eip155:2138`), use the mapped runbook: + +- **[DEFI_ORACLE_META_TESTNET_2138_RUNBOOK.md](DEFI_ORACLE_META_TESTNET_2138_RUNBOOK.md)** — genesis, Besu/Proxmox scripts, RPC, explorer, contracts, chainlist +- **Env template:** `smom-dbis-138/terraform/phases/phase1/config/env.chain2138.example` +- **Chain metadata:** `pr-workspace/chains/_data/chains/eip155-2138.json` + +--- + ## 🧪 Testnet Options ### Recommended Testnets @@ -81,5 +91,5 @@ bash scripts/test-bridge-transfers.sh sepolia 0.01 weth9 --- -**Last Updated**: $(date) +**Last Updated:** 2026-03-27