Konsens prüfen
curl --request GET \
--url https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"reached": true,
"attestation_count": 123,
"required": 123,
"signatures": [
"<string>"
]
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Vertrauen & Zeuge
Zeugen-Konsens abrufen
Rufen Sie das Konsensergebnis für eine Zeugenverifizierungsanfrage ab
GET
/
v1
/
witness
/
{witnessRequestID}
/
consensus
Konsens prüfen
curl --request GET \
--url https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/witness/{witnessRequestID}/consensus"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"reached": true,
"attestation_count": 123,
"required": 123,
"signatures": [
"<string>"
]
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Gibt den aktuellen Konsensstatus für eine Zeugenanfrage zurück, einschließlich Stimmenauszählungen und endgültiger Entscheidung. Verwenden Sie diesen Endpunkt, um das Ende des Konsenses abzufragen oder das Endergebnis abzurufen, nachdem Zeugen bestätigt haben.
Der Konsens wird automatisch berechnet, wenn die Anzahl der Bestätigungen den Schwellenwert
required_witnesses erreicht. Eine einfache Mehrheit von confirm oder deny Urteilen bestimmt das Ergebnis. abstain Stimmen zählen zum Quorum, beeinflussen aber nicht die Mehrheitsberechnung.
Authentifizierung
ErfordertX-API-Key Header oder Bearer JWT Token. Der Arbeitsbereich wird aus den authentifizierten Anmeldeinformationen abgeleitet; senden Sie X-Tenant-ID nicht.
Antwort
Aktueller Status der Zeugenanfrage. Einer von: -
pending — wartet noch
Bestätigungen – confirmed – Konsens erreicht, Anspruch bestätigt – denied
— Konsens erreicht, Anspruch wird abgelehnt - expired — TTL abgelaufen ohne
Erreichen des QuorumsISO 8601 Zeitstempel, wann Konsens erreicht wurde.
null, wenn noch ausstehend oder
abgelaufen ohne Konsens.Konsenslogik
| Szenario | Ergebnis |
|---|---|
Quorum erreicht, Mehrheit confirm | confirmed |
Quorum erreicht, Mehrheit deny | denied |
Quorum erreicht, gleich confirm/deny | Gewichtet nach Konfidenz-Scores; höchste aggregierte Konfidenz gewinnt |
| TTL läuft vor Quorum ab | expired |

