View Source MyspaceIPFS.Dht (Myspace IPFS v0.2.0-alpha.1)

MyspaceIPFS.Dht is where the dht commands of the IPFS API reside.

Link to this section Summary

Types

The response from the DHT Query command.

The response addresses list in the response from the DHT Query command.

Functions

Find the closest peers to a given key.

Link to this section Types

@type query_response() :: %MyspaceIPFS.DhtQueryResponse{
  extra: binary(),
  id: MyspaceIPFS.peer_id(),
  responses: [query_response_addrs()],
  type: binary()
}

The response from the DHT Query command.

Link to this type

query_response_addrs()

View Source
@type query_response_addrs() :: %MyspaceIPFS.DhtQueryResponseAddrs{
  addrs: [Path.t()],
  id: MyspaceIPFS.peer_id()
}

The response addresses list in the response from the DHT Query command.

Link to this section Functions

Link to this function

query(peer_id, opts \\ [])

View Source

Find the closest peers to a given key.

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-query

parameters

Parameters

peer_id - The peer ID to find the closest peers to.

options

Options

[
  `timeout` - <string>, # The timeout for the request.
]