|
| 1 | +# Foreign-chain RPC config tester |
| 2 | + |
| 3 | +A standalone tool that checks the foreign-chain RPC providers in an MPC node |
| 4 | +config, so a misconfiguration (unreachable URL, wrong/expired API key, or a |
| 5 | +provider pointed at the wrong network) is caught before the node hits it in |
| 6 | +production. |
| 7 | + |
| 8 | +For each configured provider it runs a fixed request against a known reference |
| 9 | +transaction — the same inspector and auth handling the node uses — and compares |
| 10 | +the result against a known-good value. Every provider is checked independently: |
| 11 | +one bad provider does not stop the others from being reported. |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +```bash |
| 16 | +cargo run -p foreign-chain-config-tester -- --config /path/to/user-config.toml |
| 17 | +``` |
| 18 | + |
| 19 | +`--config` accepts any of the config shapes the project uses, in YAML or TOML |
| 20 | +(format is inferred from the extension): |
| 21 | + |
| 22 | +- the dstack `user-config.toml` (`foreign_chains` under `mpc_node_config.node`); |
| 23 | +- the launcher config (`foreign_chains` under `node`); |
| 24 | +- the legacy `config.yaml` (`foreign_chains` at the top level). |
| 25 | + |
| 26 | +### Network |
| 27 | + |
| 28 | +Reference transactions are network-specific. The network is auto-detected from |
| 29 | +the config (`chain_id`, falling back to `mpc_contract_id`). Override it — or set |
| 30 | +it for configs that carry no such field — with `--network`: |
| 31 | + |
| 32 | +```bash |
| 33 | +cargo run -p foreign-chain-config-tester -- --config user-config.toml --network testnet |
| 34 | +``` |
| 35 | + |
| 36 | +## Output |
| 37 | + |
| 38 | +A row per provider, plus a summary line. The process exits non-zero if any |
| 39 | +provider failed. |
| 40 | + |
| 41 | +``` |
| 42 | +CHAIN PROVIDER RESULT |
| 43 | +abstract public ✓ ok |
| 44 | +bitcoin public ✓ ok |
| 45 | +starknet public ✗ inner network client failed to fetch: Transaction hash not found |
| 46 | +aptos public – skipped (no testnet reference transaction for this chain) |
| 47 | +
|
| 48 | +3 passed, 1 failed, 1 skipped |
| 49 | +``` |
0 commit comments