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

Node API health check error's out on a healthy Grin node. #32

Open
syntaxjak opened this issue Dec 12, 2024 · 0 comments
Open

Node API health check error's out on a healthy Grin node. #32

syntaxjak opened this issue Dec 12, 2024 · 0 comments

Comments

@syntaxjak
Copy link

syntaxjak commented Dec 12, 2024

EDIT: after closer examination, i have no idea why its not working, the ENDPOINT /v2/foreign in node.rs, doesn't seem to be the correct endpoint for the get_tip method. Maybe use v1/chain instead?

get_chain_tip ("get_tip") is not known by the grin node, or something, is causing the program to error out during the Node API health check on a healthy node.

mwixnet.rs
...

if let Err(e) = rt_handle.block_on(node.async_get_chain_tip()) {
	eprintln!("Node communication failure. Is node listening?");
	return Err(e.into());
};

This is the corresponding function with the "get_tip" method that is not found by the grin node? Maybe change to get_status?

Node.rs

async fn async_get_chain_tip(&self) -> Result<(u64, Hash), NodeError> {
	let params = json!([]);
	let tip_json = self
		.async_send_request::<serde_json::Value>("get_tip", &params)
		.await?;
	let tip =
		serde_json::from_value::<Tip>(tip_json).map_err(NodeError::DecodeResponseError)?;

	Ok((
		tip.height,
		Hash::from_hex(tip.last_block_pushed.as_str()).unwrap(),
	))
}
@syntaxjak syntaxjak changed the title Node API health check using a method not found by the Grin node in mwixnet.rs Node API health check using a method not found by the Grin node. Dec 12, 2024
@syntaxjak syntaxjak changed the title Node API health check using a method not found by the Grin node. Node API health check error's out on a healthy Grin node. Dec 13, 2024
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