ethersphere/bee

Multiple Small API Fixes

NoahMaizels opened this issue · 1 comments

Summary

After reviewing the health and status related endpoints in order to write a guide for node operators I came across a variety of bugs / difficult to understand responses from multiple endpoints. Most are very small fixes, for those which are more in depth I will submit separate issues. In this issue, I will only include those which have very simple fixes.

Details

  1. /status endpoint returns the value of "0" for the proximity of the node with itself, the proximity should actually be 256
  2. For the object returned from the /status endpoint, if the object will be used both for /status and /status/peers it would be better to not use "peer" for the key name, and rather use "overlay" in both, since it is confusing when it used for the node which is making the request itself, since a node cannot be a peer of itself.
  3. For /redistributionstate, change lastSampleDuration value from nanoseconds to seconds
  4. For /redistributionstate, change lastSampleDuration key name to lastSampleDurationSeconds
  5. for /health, in the results the version number for the Debug API is zero. This should probably be updated to reflect whatever the current version number is.

{
"status": "ok",
"version": "1.18.1-ed24b890",
"apiVersion": "5.1.0",
"debugApiVersion": "0.0.0"
}

  1. For the return object from /status and /status/peers, there is an entry with the key name "neighborhoodSize". The typical meaning of "neighborhood size" would include both the node itself and all its neighbors, however the returned value is not inclusive of the node itself. So either the value should include the node itself, or the name of the entry should be changed to "neighborsCount". I think keeping the entry name the same and changing the value to include the node itself is probably the less ambiguous method and so is better.