Skip to main content

POST /report

Submit a witness report containing belief values about a target node’s liveness. The oracle uses these reports to aggregate and determine the overall status of nodes in the system.

Request Body

witness
uint64
required
The ID of the witness node submitting the report
target
uint64
required
The ID of the target node being reported on
alive
float64
required
Confidence score that the target is alive (0.0 to 1.0)
dead
float64
required
Confidence score that the target is dead (0.0 to 1.0)
unknown
float64
required
Confidence score representing uncertainty (0.0 to 1.0)

Request Example

{
  "witness": 1,
  "target": 42,
  "alive": 0.9,
  "dead": 0.0,
  "unknown": 0.1
}

Response

status
string
Status of the report submission (“accepted”)

Response Example

{
  "status": "accepted"
}

Error Codes

400 Bad Request
error
  • Invalid JSON in request body
  • Invalid belief values (must sum to 1.0 and be between 0.0 and 1.0)
405 Method Not Allowed
error
Request method is not POST

cURL Example

curl -X POST http://localhost:8080/report \
  -H "Content-Type: application/json" \
  -d '{
    "witness": 1,
    "target": 42,
    "alive": 0.9,
    "dead": 0.0,
    "unknown": 0.1
  }'

Notes

  • The three belief values (alive, dead, unknown) must sum to 1.0
  • Each belief value must be between 0.0 and 1.0
  • The report is accepted asynchronously with a 202 status code

Build docs developers (and LLMs) love