JSONRPC or REST interface to cardano-node, or a lightweight socket library

Is there any easy way to get 1) version 2) vrf vkey (or hash) via http request or socket w/o a full blown socket client?

I’m trying to do some monitoring but the total lack of JSON RPC (or any useful microservice http based endpoint at all, other than EKG and prom) on cardano-node is extremely frustrating

requiring cardano-cli is not feasible if you are using docker for both running the node and doing monitoring. All other protocols provide JSON or REST interfaces

Cardano inexplicably seems to be the notable exception, unless there are simple things one can do on the socket that don’t require a complex serdes.

I confess I don’t fully understand their design rationale, so I might be missing something obvious.

Alternately, are there sample socket clients or libraries in other languages (golang would be ideal)?

1 Like

Hi!

Could you please give an example what information you would like to get and prometheus not serving it?

“The GraphQL API provides a query interface to all the blockchain data via GraphQL, which is a convenient choice for client applications based on web technologies (applications written in JavaScript, or any other browser-based languages, for example) that use HTTP/REST APIs to talk to other services. It is an alternative to the database SQL interface. Application developers can choose between SQL and GraphQL for accessing the chain data.”

https://docs.cardano.org/en/latest/explore-cardano/cardano-architecture-overview/about-db-sync-and-its-components.html

I do not want to have to run db-sync in addition to the node, I just want to query cardano-node for version and vrf vkey (or hash). In particular, I do not think it suitable for running on a block producer.

finally, prometheus and EKG only provide numeric metrics, and paltry ones at that.

EKG could be trivially extended, though, since it is JSON based.

2 Likes

i know it is not a solution but as a workaround the version can be read from the log file of the node…
[dell:cardano.node.basicInfo.version:Notice:5] [2021-04-15 11:12:44.38 UTC] 1.26.1
json format can be set as well…

Parsing logs is not suitable, since the design here must be a client that makes http(s) RPC or REST requests to the node. Not only that, but parsing logs is fragile and subject to breakage since log formats change.

The version thrashing in cncli is a good example of why log parsing is a bad idea.

Is there a specification or example client library for the local socket interface?

what would you get from local socket interface you could get from cardano-db-sync…
but hope someone has better idea.

What I’m looking for is a spec for the socket interface, unless there is no spec and it drifts from version to version, in which case it is unsuitable.

I see this answers my question more or less, as a conclusive no, other than the Haskell native IPC API which I do not think has any non-haskell way of talking to it.

I second this, we need a proper JSONRPC API

1 Like

We definitely need this. The current stack is so over-engineered. Do not force developers to install all the dependencies needed by cardano-db-sync and learn GraphQL just to make queries to cardano-node.

3 Likes

This is not the way, answering a simple and very clear question with another question.
The question was, is there a way to interact with Cardano node over jsonrpc or Rest.
And you keep repeatedly asking what exactly the query is!

1 Like

We are in 2023 now.
Still no way of simple interacting with node, but the mandatory Monster cardano-db-sync (Terabytes of data feeding to postgresql) postgresql, graphql, got now hasura, node-ogmios, TypeScript package, apollo server stuff.
All of those efforts to circumvent a simple jsonrpc or Rest.
Well done.

1 Like

Whatt’s the problem with Ogmios? It’s quite exactly what was requested here: A lightweight wrapper to speak the protocol spoken on the socket over HTTP.

Yet another fancy project.
Lightweight solution with heavy weight library dependencies.
Just another few days for build and learn, then maybe you get lucky and can do your first REST query.

1 Like