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 · 4 comments
Open

CLI command to check node status #206

thobson88 opened this issue Oct 21, 2024 · 4 comments

Comments

@thobson88
Copy link
Collaborator

A new command:

trustchain-cli --status

that reports something like:

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

or

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" })))

@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.

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

No branches or pull requests

1 participant