5

The IPFS cli/http api has an ipfs pin ls command that lists pinned hashes. However, this only works to query the local node. Is there a way to run the same command against a remote node, e.g., something like

$ ipfs pin ls <PeerID>

Which would act like ipfs pin ls but listing pins on the node identified by the Peer ID?

People running ipfs nodes are strongly discouraged (for good security reasons), from allowing remote access to the http api (which provides /api/v0/pin/ls).

Is there an internal ipfs function, or a libp2p function, which would enable an ipfs node to query a remote peer in this way?

Or conversely, is there a function to send a list of local pins (ie list of hashes) to an identified remote peer?

Thanks

  • 1
    Is the idea to run that query against peers you control? We don't have a way to do it to any peer on the network, but if yo have a constellation of peers you want to organize, we have some tech pretty close in Textile Cafes (they wrap IPFS peers with a bunch of utils, https://github.com/textileio/textile-go) and would love to help make it happen. – andrewxhill Jan 16 '19 at 16:40
  • Thanks very much - I certainly need to learn more about Textile. Re the question - It doesn't seem possible & perhaps my question betrayed a misunderstanding of the bittorrent-style p2p semantics, which are really about a node finding the blocks it needs. –  Jan 18 '19 at 14:48
  • @andrewxhill if you say "Nope, it can't be done" as an answer I'll accept, and you'll get the points :) –  Jan 18 '19 at 14:49

1 Answers1

0

There is not currently a way to do this through the IPFS API as of 0.4.20. I can't speak to an internal libp2p function, but I believe the answer is "no" there too. Unless you write the code into IPFS to do it, which is probably nontrivial.

michaelavila
  • 1,059
  • 7
  • 20