Skip to content

Consensus

POST/api/v1/consensus/challenges/{challenge_id}/resolve
POST
/api/v1/consensus/challenges/{challenge_id}/resolve

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

challenge_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/challenges/string/resolve" \  -H "Content-Type: application/json" \  -d '{    "decision": "uphold"  }'
{  "challenge_id": "string",  "determination": "undetermined",  "fact_id": "string",  "fact_status": "pending_validation",  "stake_returned": 0,  "status": "under_review",  "validators_rewarded": 0,  "validators_slashed": 0}
GET/api/v1/consensus/facts
GET
/api/v1/consensus/facts

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

q?string

Full-text search over this list's searchable fields.

Length1 <= length <= 200
sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: consensus_deadline, consensus_reached_at, created_at. Default: -created_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/facts"
{  "facts": [    {      "category": "string",      "consensus_deadline": "2019-08-24T14:15:22Z",      "consensus_reached_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "determination": "undetermined",      "evidence": {},      "fact_id": "string",      "phase": "proposal",      "proposed_by": "string",      "statement": "string",      "status": "pending_validation"    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
POST/api/v1/consensus/facts
POST
/api/v1/consensus/facts

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/facts" \  -H "Content-Type: application/json" \  -d '{    "category": "string",    "statement": "string"  }'
{  "consensus_deadline": "2019-08-24T14:15:22Z",  "current_validators": 0,  "fact_id": "string",  "proposed_at": "2019-08-24T14:15:22Z",  "required_validators": 0,  "statement": "string",  "status": "pending_validation"}
GET/api/v1/consensus/facts/{fact_id}
GET
/api/v1/consensus/facts/{fact_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/facts/string"
{  "category": "string",  "consensus_deadline": "2019-08-24T14:15:22Z",  "consensus_reached_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "determination": "undetermined",  "evidence": {},  "fact_id": "string",  "phase": "proposal",  "proposed_by": "string",  "statement": "string",  "status": "pending_validation"}
POST/api/v1/consensus/facts/{fact_id}/attest
POST
/api/v1/consensus/facts/{fact_id}/attest

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/facts/string/attest" \  -H "Content-Type: application/json" \  -d '{    "confidence": 0.1,    "vote": "confirm"  }'
{  "attestation_id": "string",  "consensus_update": {    "confirm_weight": 0.1,    "current_consensus": "undetermined",    "deny_weight": 0.1,    "total_attestations": 0,    "unclear_weight": 0.1  },  "fact_id": "string",  "validator": "string",  "vote": "confirm",  "weight": 0.1}
POST/api/v1/consensus/facts/{fact_id}/challenge
POST
/api/v1/consensus/facts/{fact_id}/challenge

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/facts/string/challenge" \  -H "Content-Type: application/json" \  -d '{    "reason": "string"  }'
{  "challenge_id": "string",  "challenger": "string",  "fact_id": "string",  "review_deadline": "2019-08-24T14:15:22Z",  "stake": 0,  "status": "under_review"}
GET/api/v1/consensus/facts/{fact_id}/status
GET
/api/v1/consensus/facts/{fact_id}/status

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/facts/string/status"
{  "consensus_status": {    "attestations": {      "confirm": 0,      "deny": 0,      "total": 0,      "unclear": 0    },    "confidence": 0.1,    "determination": "undetermined",    "phase": "proposal",    "weighted_votes": {      "confirm": 0.1,      "deny": 0.1,      "unclear": 0.1    }  },  "fact_id": "string",  "geographic_distribution": {    "continents": 0,    "countries": 0,    "distribution_score": 0.1  },  "statement": "string",  "status": "pending_validation",  "time_remaining_seconds": 0}
GET/api/v1/consensus/validators
GET
/api/v1/consensus/validators

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: total_attestations, stake_balance, reputation_score. Default: -reputation_score.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/validators"
{  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  },  "validators": [    {      "correct_attestations": 0,      "location": {        "continent": "string",        "country": "string",        "latitude": 0,        "longitude": 0      },      "reputation_score": 0.1,      "specializations": [        "string"      ],      "stake_balance": 0,      "total_attestations": 0,      "validator_id": "string"    }  ]}
POST/api/v1/consensus/validators
POST
/api/v1/consensus/validators

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/validators" \  -H "Content-Type: application/json" \  -d '{}'
{  "correct_attestations": 0,  "location": {    "continent": "string",    "country": "string",    "latitude": 0,    "longitude": 0  },  "reputation_score": 0.1,  "specializations": [    "string"  ],  "stake_balance": 0,  "total_attestations": 0,  "validator_id": "string"}
GET/api/v1/consensus/validators/{validator_id}
GET
/api/v1/consensus/validators/{validator_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

validator_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/validators/string"
{  "correct_attestations": 0,  "location": {    "continent": "string",    "country": "string",    "latitude": 0,    "longitude": 0  },  "reputation_score": 0.1,  "specializations": [    "string"  ],  "stake_balance": 0,  "total_attestations": 0,  "validator_id": "string"}
GET/api/v1/ws/consensus/{topic}
GET
/api/v1/ws/consensus/{topic}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

topic*string

Query Parameters

token?string

JWT token (alternative to the Authorization header for browser clients)

Response Body

curl -X GET "https://example.com/api/v1/ws/consensus/string"
Empty