Skip to main content

POST /witnesses

Register a witness node with the oracle. Witnesses are nodes that provide reports about the liveness of other nodes in the system.

Request Body

id
uint64
required
The unique ID of the witness node to register

Request Example

{
  "id": 1
}

Response

status
string
Status of the registration (“registered”)

Response Example

{
  "status": "registered"
}

Error Codes

400 Bad Request
error
Invalid JSON in request body
405 Method Not Allowed
error
Request method is not POST

cURL Example

curl -X POST http://localhost:8080/witnesses \
  -H "Content-Type: application/json" \
  -d '{"id": 1}'

Notes

  • Witnesses must be registered before they can submit reports via the /report endpoint
  • Each witness should have a unique ID in the system
  • Registering the same witness ID multiple times is idempotent

Build docs developers (and LLMs) love