- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains - Omit embedded publish git dirs and empty placeholders from index Made-with: Cursor
120 lines
4.4 KiB
Markdown
120 lines
4.4 KiB
Markdown
# Chain 138 – Wallet & SDK Config Validation
|
||
|
||
**Last Updated:** 2026-04-02
|
||
**Document Version:** 1.0
|
||
**Status:** Active Documentation
|
||
|
||
---
|
||
|
||
**Purpose**: Validated configs for MetaMask, ethers.js, and Ledger (Chain 138 – Defi Oracle Meta Mainnet).
|
||
**RPC**: `https://rpc-http-pub.d-bis.org`, `https://rpc.d-bis.org`, `https://rpc2.d-bis.org`, `https://rpc.public-0138.defi-oracle.io`, `https://rpc.defi-oracle.io`
|
||
**WS**: `wss://rpc-ws-pub.d-bis.org`, `wss://rpc.d-bis.org`, `wss://ws.rpc.d-bis.org`, `wss://ws.rpc2.d-bis.org`, `wss://rpc.public-0138.defi-oracle.io`, `wss://wss.defi-oracle.io` (order matches [ethereum-lists/chains `eip155-138.json`](https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-138.json))
|
||
**Chain ID**: 138 (`0x8a`)
|
||
|
||
---
|
||
|
||
## 1. MetaMask (custom network)
|
||
|
||
Use **Settings → Networks → Add network** (or “Add a network manually”) with:
|
||
|
||
| Field | Value |
|
||
|-------|--------|
|
||
| **Network name** | Defi Oracle Meta Mainnet |
|
||
| **RPC URL** | `https://rpc-http-pub.d-bis.org`, `https://rpc.d-bis.org`, `https://rpc2.d-bis.org`, `https://rpc.public-0138.defi-oracle.io`, or `https://rpc.defi-oracle.io` |
|
||
| **Chain ID** | `138` |
|
||
| **Currency symbol** | ETH |
|
||
| **Block explorer** | `https://explorer.d-bis.org` |
|
||
|
||
**JSON** (for programmatic add or import): see `docs/04-configuration/metamask/METAMASK_NETWORK_CONFIG.json`.
|
||
|
||
Validated: chainId `0x8a`, RPC URLs return `eth_chainId` → `0x8a`.
|
||
|
||
---
|
||
|
||
## 2. ethers.js (v5 / v6)
|
||
|
||
```javascript
|
||
// Chain 138 – Defi Oracle Meta Mainnet
|
||
const chain138 = {
|
||
chainId: 138,
|
||
name: "Defi Oracle Meta Mainnet",
|
||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
||
rpcUrls: {
|
||
default: {
|
||
http: [
|
||
"https://rpc-http-pub.d-bis.org",
|
||
"https://rpc.d-bis.org",
|
||
"https://rpc2.d-bis.org",
|
||
"https://rpc.public-0138.defi-oracle.io",
|
||
"https://rpc.defi-oracle.io"
|
||
]
|
||
},
|
||
webSocket: [
|
||
"wss://rpc-ws-pub.d-bis.org",
|
||
"wss://rpc.d-bis.org",
|
||
"wss://ws.rpc.d-bis.org",
|
||
"wss://ws.rpc2.d-bis.org",
|
||
"wss://rpc.public-0138.defi-oracle.io",
|
||
"wss://wss.defi-oracle.io"
|
||
]
|
||
},
|
||
blockExplorers: {
|
||
default: { name: "Blockscout", url: "https://explorer.d-bis.org" }
|
||
}
|
||
};
|
||
|
||
// ethers v6
|
||
import { JsonRpcProvider } from "ethers";
|
||
const provider = new JsonRpcProvider("https://rpc-http-pub.d-bis.org");
|
||
const chainId = await provider.getNetwork().then(n => Number(n.chainId)); // 138
|
||
|
||
// ethers v6 WebSocket
|
||
import { WebSocketProvider } from "ethers";
|
||
const wsProvider = new WebSocketProvider("wss://rpc-ws-pub.d-bis.org");
|
||
```
|
||
|
||
Validated: HTTP RPC returns chainId 138; WS endpoints route to same backend (VMID 2201).
|
||
|
||
---
|
||
|
||
## 3. Ledger (Chain 138)
|
||
|
||
Chain 138 is a custom chain. In Ledger Live / Ledger-compatible apps:
|
||
|
||
- **Network**: Add custom Ethereum-compatible network.
|
||
- **RPC**: `https://rpc-http-pub.d-bis.org`, `https://rpc.d-bis.org`, `https://rpc2.d-bis.org`, `https://rpc.public-0138.defi-oracle.io`, or `https://rpc.defi-oracle.io`
|
||
- **Chain ID**: `138`
|
||
- **Explorer**: `https://explorer.d-bis.org`
|
||
|
||
Ledger does not pre-list Chain 138; use “Add custom network” (or equivalent) with the values above.
|
||
**SLIP-44**: Chain 138 uses `slip44: 60` (ETH derivation path) in chain list; Ledger uses standard ETH path for EVM chains.
|
||
|
||
Validated: No collision with mainnet (1) or common testnets; chain list entry in `pr-workspace/chains/_data/chains/eip155-138.json` is correct for submission to chainlist.org / Ledger discovery if/when supported.
|
||
|
||
---
|
||
|
||
## 4. Quick verification
|
||
|
||
```bash
|
||
# HTTP RPC
|
||
curl -s -X POST https://rpc-http-pub.d-bis.org -H "Content-Type: application/json" \
|
||
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
|
||
# Expected: {"jsonrpc":"2.0","id":1,"result":"0x8a"}
|
||
|
||
# From LAN (if Split DNS or --resolve used)
|
||
curl -sk --resolve rpc-http-pub.d-bis.org:443:192.168.11.167 \
|
||
https://rpc-http-pub.d-bis.org \
|
||
-H "Content-Type: application/json" \
|
||
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
|
||
```
|
||
|
||
---
|
||
|
||
## 5. References
|
||
|
||
- **RPC verification**: `docs/04-configuration/RPC_CHAIN138_VERIFICATION.md`
|
||
- **MetaMask network JSON**: `docs/04-configuration/metamask/METAMASK_NETWORK_CONFIG.json`
|
||
- **Chain list (chainlist.org)**: `pr-workspace/chains/_data/chains/eip155-138.json`
|
||
- **Token list (chain 138)**: `token-lists/chainlists/chain-138.json`
|
||
- **Testnet (2138) wallet doc**: `docs/04-configuration/CHAIN2138_WALLET_CONFIG_VALIDATION.md`
|