REST: gridnode

The endpoints under /gridnode start or stop the announcement of this node as a gridnode, list the gridnodes the node knows and tell the collateral required for the number of active ones. They are part of the REST interface and need the bearer token like every other endpoint. The announcements are signed with the gridnode key that the daemon was given with --gridnode and sent to the peers.

A gridnode has status (ACTIVE or INACTIVE), id, the public key of the gridnode, hostName, the address it announces, sealingKey, the SOCKS proxy key in hex, and timestamp, in Unix milliseconds. The signature is kept out of the answer.

After 0.0.8. These endpoints are on the master branch and not part of a release yet. Release 0.0.9 answers each of them with 503 and This release does not include the gridnode part unless the node runs with the hidden --preview switch, which turns on the parts the release leaves off. gridnode-start and gridnode-stop then print Gridnodes are not part of this release.

GET /gridnode

Answers 200 with the list of the gridnodes the node knows, also those that are inactive. The list is empty when the node knows none.

GET /gridnode/collateral

Answers 200 with the collateral, as a number of coins, that a gridnode has to hold now. It is 3000 while fewer than 500 gridnodes are active, and falls with each further 500 active gridnodes the node knows.

PUT /gridnode/start

Announces this node as an active gridnode: the node signs an entry and sends it to its peers.

Answer Meaning
202 The entry is signed and sent
409 The node has no gridnode key, as it was started without --gridnode, so there is nothing to sign; gridnode-start and gridnode-stop print This daemon is not running as a gridnode

PUT /gridnode/stop

Announces this node as inactive in the same way, with the same answers.

In the source

  • application/src/main/java/org/unigrid/hedgehog/server/rest/GridnodeResource.java: the four endpoints.
  • application/src/main/java/org/unigrid/hedgehog/model/network/GridnodeAnnouncer.java: signs and keeps the own entry fresh.
  • application/src/main/java/org/unigrid/hedgehog/model/gridnode/Collateral.java: the collateral for a number of active gridnodes.