Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI command to check node status #206

Open
thobson88 opened this issue Oct 21, 2024 · 5 comments · May be fixed by #214
Open

CLI command to check node status #206

thobson88 opened this issue Oct 21, 2024 · 5 comments · May be fixed by #214
Labels
enhancement New feature or request

Comments

@thobson88
Copy link
Collaborator

thobson88 commented Oct 21, 2024

A new command:

trustchain-cli status

that reports something like:

IPFS...... ✅
MongoDB... ✅
Bitcoin... ❌ [Synching blocks: 3191562/3193183]

or (omitting HTTP Server if it hasn't been started):

IPFS......... ✅
MongoDB...... ✅
Bitcoin...... ✅
ION.......... ✅
HTTP Server.. ✅
@thobson88
Copy link
Collaborator Author

thobson88 commented Oct 21, 2024

Check whether the IPFS daemon is running with the query_ipfs function in trustchain-ion::utils (and a known CID). The result will be an error:

Client(hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })))

(Preferable to the alternative ipfs swarm peers.)

@thobson88
Copy link
Collaborator Author

To check for MongoDB, use the query_mongodb function in trustchain-ion::utils (with a known DID). It returns TrustchainMongodbError::QueryReturnedError if the daemon is not running.

@thobson88
Copy link
Collaborator Author

thobson88 commented Oct 21, 2024

Get Bitcoin node status by calling get_blockchain_info on the rpc_client in trustchain-ion::utils. This returns a struct containing fields for the number of blocks and headers.

@thobson88
Copy link
Collaborator Author

Get ION status by resolving a known DID.

@thobson88
Copy link
Collaborator Author

thobson88 commented Oct 31, 2024

In progress on branch 206-cli-status.

TODO:

  • Get ion_port from trustchain_config.toml for use in the ion_ok function.
  • Check trustchain-http server status (report only if positive).
  • Update the trustchain-api crate.

Decisions on the above:

  • the CLI status command should report only the status of components on which it depends, so should not include the HTTP server status
  • the API crate is for exposing Trustchain DID & VC functionality, so no updates are needed here.

@thobson88 thobson88 added the enhancement New feature or request label Nov 5, 2024
@thobson88 thobson88 linked a pull request Nov 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant