This repository was archived by the owner on Oct 23, 2022. It is now read-only.
This repository was archived by the owner on Oct 23, 2022. It is now read-only.
Support for /refs endpoints #92
Description
References:
- https://github.com/ipfs/js-ipfs/blob/master/packages/interface-ipfs-core/src/refs.js
- https://docs-beta.ipfs.io/reference/http/api/#api-v0-refs
- https://github.com/ipfs/interop (no occurrences)
/refs
List links (references) from an object.
curl "http://localhost:5001/api/v0/refs?arg=<ipfs-path>&format=<dst>&edges=<value>&unique=<value>&recursive=<value>&max-depth=-1"
- Requires
object.put
Need to refactor tests. - Arguments
- arg [string]: Path to the object(s) to list refs from. Required: yes.
- format [string]: Emit edges with given format. Available tokens: . Default: . Default: "". Required: no.
- edges [bool]: Emit edge format: -> . Required: no.
- unique [bool]: Omit duplicate refs from output. Required: no.
- recursive [bool]: Recursively list links of child nodes. Required: no.
- max-depth [int]: Only for recursive refs, limits fetch and listing to the given depth. Default: "-1". Required: no.
- On success, the call to this endpoint will return with 200 and the following body:
{
"Err": "<string>",
"Ref": "<string>"
}
/refs/local
List all local references.
curl "http://localhost:5001/api/v0/refs/local"
- Test requires IPFS add, perhaps we can refactor to
ipfs.dag.put
- This endpoint takes no arguments.
- On success, the call to this endpoint will return with 200 and the following body:
{
"Err": "<string>",
"Ref": "<string>"
}