Skip to content

feat(cli): add check-status command to ping deployed contracts - #822

Closed
davidugorji wants to merge 1 commit into
BCPathway:mainfrom
davidugorji:feat/699-cli-check-status
Closed

feat(cli): add check-status command to ping deployed contracts#822
davidugorji wants to merge 1 commit into
BCPathway:mainfrom
davidugorji:feat/699-cli-check-status

Conversation

@davidugorji

Copy link
Copy Markdown
Contributor

Implements the check-status CLI utility.

Pings every contract declared under contracts in .bc-forge.json by reading its instance ledger entry, and reports per-contract reachability and latency. Distinct verdicts (responsive, not_deployed, unreachable, invalid) separate the failure modes; exits non-zero when any contract is not responsive so it can gate a deployment.

Verification: tsc clean, 10/10 unit tests pass, and the command was run live against Soroban testnet RPC.

Closes #699

Adds a `bc-forge check-status` command that pings every contract declared
under `contracts` in .bc-forge.json and reports per-contract reachability
and latency.

Each contract is probed by reading its instance ledger entry via
getLedgerEntries. An entry proves the contract is deployed and served by
the RPC node, so the check needs no contract-specific method and works
uniformly across token, wrapper and any future contract.

Four distinct statuses are reported rather than a single pass/fail, so an
operator can tell the failure modes apart:

- responsive   instance entry returned, with measured latency
- not_deployed RPC answered but holds no instance for that id
- unreachable  the RPC call itself failed
- invalid      contract id is malformed or absent from the config

Contract ids are validated locally before any network call, so a typo in
the config is reported immediately instead of as a spurious RPC failure.
The command exits non-zero when any contract is not responsive, making it
usable as a deployment gate in CI.

The clock is injected so latency assertions in tests are deterministic.

Closes BCPathway#699
@davidugorji
davidugorji force-pushed the feat/699-cli-check-status branch from b47b57f to 398c314 Compare August 26, 2026 15:24
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@davidugorji Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@davidugorji

Copy link
Copy Markdown
Contributor Author

Superseded by #829, which bundles all four issues (#699, #700, #701, #759) into a single PR. Closing in favour of that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLI] Utility: Check deployment status

1 participant