Giter VIP home page Giter VIP logo

koios-cli's People

Contributors

mkungla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

3dmintlab mkungla

koios-cli's Issues

Empty response on compressed API response

Describe the bug
For some endpoint it does not return any valid data because missing decompression of the response.

To Reproduce

  • $ koios-cli api pool-info -p pool1gxvkc0576e75065p5k0csvwme9y2qrefd5ga66nx0z65xxjt8jk
{
 "request_url": "https://api.koios.rest/api/v0/pool_info",
 "request_method": "POST",
 "status_code": 200,
 "status": "200 OK",
 "date": "Wed, 24 Jan 2024 07:31:44 GMT",
 "content_range": "0-0/*",
 "error": {
  "message": "invalid character '\\x1f' looking for beginning of value: invalid character '\\x1f' looking for beginning of value"
 },
 "data": null
}
  • $ koios-cli api account-info --cached -a stake1ux0636uasyuwfpzhrf8907cp8t6dakvq7lr67ckwfewmu8sq5ryxf
{
 "request_url": "",
 "request_method": "",
 "status_code": 0,
 "status": "",
 "data": null
}

Expected behavior
Properly parse the compressed response

Desktop (please complete the following information):

  • OS: GNU/linux
  • Go version: go1.21.0
  • Koios version: v1.3.1

Additional context
This looks like related to the cardano-community/koios-go-client#46 bug

Health Check against an instance using CLI

It would be nice to have a a healthcheck ping from CLI against a specific instance (eg: -b http://127.0.0.1:8053/api/v0 , that will check and report stats below behind the scenes (currently achieved via bash script grest-poll.sh ):

  • Query target's tip to check that the last block known to instance is within 600 seconds, use timeout of 2 seconds to establish connection to this endpoint (anything more being too slow to accept connection)
  • Be able to verify (using <baseURL>/ endpoint) that each path from spec is available at the target instance (current implementation here)
  • Check every record in control table to check they're relatively recent (see here )
  • Check Observation limit is uniform
  • Do a Get/POST to test a sample request
  • Optionally - at the end of it all, with a debug argument (eg: -d ), provide a summary of the endpoint results.
  • Exit with return code 1 if any of the tests fail, and 0 if they all pass.

If all of the above is achievable, this will help us use something like koios-cli healthcheck [-d] for actual healthcheck from haproxy itself, as an alternative to using bash script we currently use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.