Done
Details
Assignee
UnassignedUnassignedReporter
Tomislav GrospićTomislav GrospićPriority
MediumFix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Tomislav Grospić
Tomislav GrospićPriority
Fix versions
Created May 6, 2020 at 11:39 AM
Updated March 12, 2021 at 4:23 PM
Resolved March 12, 2021 at 4:23 PM
We need a way for node operators to get current state of the node, information not available via public API but also information about internals like deploys waiting in the queue or currently executing, or the status of databases.
We already have internal (admin) port on gRPC with propose command. So we need the same for Web API. Also Admin API should not have restrictions e.g. depth for getBlocks or listen for data at name.
What is needed to build the service:
Create service methods interface
WebAdminApi
with one methodpropose
. Implementation should callBlockAPI#createBlock
.https://github.com/rchain/rchain/blob/9b5c6e12296/node/src/main/scala/coop/rchain/node/api/WebApi.scala#L21
Create service HTTP routes mapped with service methods. Here we now have specification for JSON serializers.
https://github.com/rchain/rchain/blob/c142258a45b/node/src/main/scala/coop/rchain/node/web/WebApiRoutes.scala#L15
Create new HTTP server, because we are running on the new port.
https://github.com/rchain/rchain/blob/32a45f03d5d/node/src/main/scala/coop/rchain/node/web/package.scala#L19
Related Web API PR.
https://github.com/rchain/rchain/pull/2811
For additional improvements of the API (both public and admin) would be to get rid of manual specification of the JSON serializers (encoder/decoder pair) and use circe default implementation for
HList
.https://github.com/rchain/rchain/pull/2811#discussion_r355610199