bitcoin-canister icon indicating copy to clipboard operation
bitcoin-canister copied to clipboard

chore: expose main_chain_height endpoint for watchdog

Open maksymar opened this issue 2 years ago • 1 comments

This change exposes main_chain_height for the watchdog.

Currently watchdog canister gets the information about the latest block height from the bitcoin canister via metrics page parsing. It works fine in production, but it's a blocker for writing end-to-end tests with a fake bitcoin canister. The reason is that both canisters are running locally and have to send/receive HTTPS requests. Unfortunately making HTTPS outcalls locally is not currently supported by dfx.

The solution would be to switch from making HTTPS outcall to making an inter-canister call to the bitcoin canister. This does not have limitations on running locally. And conceptually it's the right thing to do to exchange information between canisters via inter-canister calls, and not by parsing HTML.

The goal is to switch from reading it via metrics page parsing to making an inter-canister call.

maksymar avatar May 15 '23 12:05 maksymar

... I’d hold off on that change for a bit ...

Ok, I'm turning this PR into a draft mode then.

maksymar avatar May 15 '23 13:05 maksymar