Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

[Enhancement] Bare hash wantlist #388

Open
@bbappserver

Description

@bbappserver

It is entirely possible, especially as IPFS is not yet widely adopted that a peer may have a file, but does not know a corresponding IPFS url, because it just stores the full hash of the file in some file catalog(rather than a pointer to a magic DHT shard, as seems to be the case in bitswap).

To this end I think a peer should also be able to list want hashes to a connected peer.

Enquiry Setup

  1. A peer enquires to connected hosts about what form(s) of catalog hash they have (md5,sha1,sha512). [optional]
  2. The peer produces a bare hash wantlist of the form (hash_type_multicodec,hash)

Peering Algorithm

On another peer

  1. Read wantlist of peer p
  2. Ask a bare_wantlist_provider if that file is on file
  3. ipfs add --nocopy <file> if available
  4. Notify peer p of:
  • The corresponding ipfs url, or
  • File Unavailable

Bare wantlist provider

A bare wantlist provider is a program registered with the ipfs daemon. Some configuration or environment variable will be set to its path, and accepted hash types.

The wantlist provider will be invocable in the form
cmdName <hashName>://<hash>
And shall print the path of the corresponding file, then exit 0
or
If the file is not found (or any other condition for which the peer does not want to serve the file) exit 1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions