diff --git a/docs/reference/kubo/rpc.md b/docs/reference/kubo/rpc.md index d024bf7c8..9862fee60 100644 --- a/docs/reference/kubo/rpc.md +++ b/docs/reference/kubo/rpc.md @@ -1131,24 +1131,15 @@ Argument `path` is of file type. This endpoint expects one or several files (dep ### Response -On success, the call to this endpoint will return with 200 and the following body: - -```json -{ - "Root": { - "Cid": { - "/": "" - }, - "PinErrorMsg": "" - }, - "Stats": { - "BlockBytesCount": "", - "BlockCount": "" - } -} +On success, the call to this endpoint will return with 200 and a +**JSONL** body (one JSON object per line, not a single JSON document): +```jsonl +{"Root":{"Cid":{"/":""},"PinErrorMsg":"string"}} +{"Stats":{"BlockCount":,"BlockBytesCount":}} ``` +The `Stats` record is only present when the `stats=true` argument is provided. ### cURL Example `curl -X POST -F file=@myfile "http://127.0.0.1:5001/api/v0/dag/import?pin-roots=&local-only=&silent=&stats=&fast-provide-root=&fast-provide-dag=&fast-provide-wait=&allow-big-block=false"` @@ -5015,6 +5006,17 @@ On success, the call to this endpoint will return with 200 and the following bod ``` +The `Type` field is an integer that indicates the kind of DHT query event: + +| Value | Meaning | +| ----- | ------- | +| `0` | `SendingQuery` — the query is being sent to a peer | +| `1` | `PeerResponse` — a peer responded with its closest peers | +| `2` | `FinalPeer` — the peer is the closest found to the target | +| `3` | `QueryError` — the query to a peer failed | + +See the [go-libp2p routing query type definitions](https://github.com/libp2p/go-libp2p/core/routing/query.go) for the authoritative list. + ### cURL Example `curl -X POST "http://127.0.0.1:5001/api/v0/dht/query?arg=&verbose="`