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

dht.provide() doesn't accept strings #2573

Closed
@reasv

Description

@reasv
  • master:
  • Chrome/Windows:
  • DHT:

Type:

Bug

Severity:

Medium

Description:

ipfs.dht.provide() doesn't accept a string as input. It exclusively accepts a CID instance object.

This is inconsistent with how dht.findProvs() works, and it's not even hinted at in the documentation.

The error returned for giving it a string is "not a valid CID" which is also very opaque and confusing.

I would suggest to either update the documentation or to modify the function to do something like const cid = new CID(string_argument) in order to support a string-based argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Very low priorityexp/noviceSomeone with a little familiarity can pick upstatus/readyReady to be worked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions