kadena-io / kda-tool

CLI interface to the the Kadena blockchain
https://kadena.io/
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

Allow using non-HTTPS nodes, and work with newer GHC and Pact #19

Closed edmundnoble closed 1 year ago

edmundnoble commented 1 year ago

Looks like the logic for selecting HTTP vs HTTPS for a node relies on being sent an error status code when querying HTTPS, but usually you'll just get a timeout. So I just caught any (synchronous) exceptions and considered them failures.

EnoF commented 1 year ago

The http networks seem to be callable now with this change. However I'm receiving the following error:

{"localhost:8080":[{"error":"Error in $: Failed reading: not a valid json value at '<html>'"}]}
edmundnoble commented 1 year ago

This seems to be because we consider an HTTP-only server to be a "Pact server", which doesn't have the same API route root. Maybe this is a heuristic which used to apply universally? Perhaps we should specify this explicitly then on the CLI.

mightybyte commented 1 year ago

This seems to be because we consider an HTTP-only server to be a "Pact server", which doesn't have the same API route root. Maybe this is a heuristic which used to apply universally? Perhaps we should specify this explicitly then on the CLI.

Agreed. I don't think this heuristic is correct in all circumstances. Will merge this PR though and implement a more general solution in a follow-on.