Skip to content

Commit 953ff45

Browse files
bajtosjuliangruber
andauthored
docs: add basic use (#34)
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net> Co-authored-by: Julian Gruber <julian@juliangruber.com>
1 parent 984cb20 commit 953ff45

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@ A lightweight IPNI node mapping Filecoin PieceCID → payload block CID.
44

55
- [Design doc](./docs/design.md)
66

7+
## Basic use
8+
9+
Note: this will change soon, see
10+
https://github.com/filecoin-station/piece-indexer/issues/33
11+
12+
## `GET /sample/{provider-id}/{piece-cid}
13+
14+
Sample a set of multihashes ingested by IPNI for a given ContextID, matching the
15+
route eventually to be exposed by an IPNI reverse index.
16+
17+
_This is an alternative implementation of the IPNI Reverse Index as specified in
18+
[xedni/openapi.yaml](https://github.com/ipni/xedni/blob/526f90f5a6001cb50b52e6376f8877163f8018af/openapi.yaml)._
19+
20+
Parameters:
21+
22+
- `provider-id` - the peer ID of the storage provider (index publisher)
23+
- `piece-cid` - the Filecoin deal's PieceCID as advertised by the provider in
24+
Graphsync retrieval metadata
25+
26+
Response:
27+
28+
- `samples` - a list of exactly one payload block CID contained inside the piece
29+
identified by the requested PieceCID.
30+
31+
Example:
32+
33+
https://pix.filspark.com/sample/12D3KooWHKeaNCnYByQUMS2n5PAZ1KZ9xKXqsb4bhpxVJ6bBJg5V/baga6ea4seaqlwzed5tgjtyhrugjziutzthx2wrympvsuqhfngwdwqzvosuchmja
34+
35+
```json
36+
{
37+
"samples": ["bafkreigrnnl64xuevvkhknbhrcqzbdvvmqnchp7ae2a4ulninsjoc5svoq"]
38+
}
39+
```
40+
41+
## `GET /ingestion-status/{provider-id}`
42+
43+
Return the index status for the given provider.
44+
45+
Example:
46+
47+
https://pix.filspark.com/ingestion-status/12D3KooWHKeaNCnYByQUMS2n5PAZ1KZ9xKXqsb4bhpxVJ6bBJg5V
48+
49+
```json
50+
{
51+
"providerId": "12D3KooWHKeaNCnYByQUMS2n5PAZ1KZ9xKXqsb4bhpxVJ6bBJg5V",
52+
"ingestionStatus": "All advertisements from baguqeeralhduow57bhqo5zgiwe6swgjrqw2nuckvnch6nlylaensfzf3bfyq to the end of the chain were processed.",
53+
"lastHeadWalkedFrom": "baguqeeralhduow57bhqo5zgiwe6swgjrqw2nuckvnch6nlylaensfzf3bfyq",
54+
"adsMissingPieceCID": 0,
55+
"entriesNotRetrievable": 0,
56+
"piecesIndexed": 6344
57+
}
58+
```
59+
760
## Development
861

962
```bash

0 commit comments

Comments
 (0)