libp2p/hydra-booster

Hydra Booster: help with some questions

shaheerbakali opened this issue · 2 comments

Hello,

I have just discovered Hydra Booster and I want to use it for my project.

So I have a few questions about the usage and outputs of Hydra Booster:

  1. When running Hydra Booster with the command go run ./main.go, this creates 1 head and assigns a Peer ID to that head. In addition to Hydra Booster head, I am also running IPFS node on my local machine with the command ipfs daemon. So now both nodes should connect to each other right? But when I run ipfs swarm peers on my local IPFS node, I cannot see the Peer ID of the head that Hydra Booster created. Did I do something wrong or ?
  2. Can I interact with the head that Hydra Booster has created? Like receive files or add files ?
  3. When using HTTP API, what does the command GET /records/list output mean? I know it returns a list of provider records. But the list is in this format: {"Key":"/providers/CIQA3J2WKKA57UENKRIJLB236L74NFIZSDZMMM4ZJP53CO2LLJFF3JQ/CIQFVBUR6S5EJ3GQ3TP7XXVEFDXTMA2Q6SIRPC7FKX3JEQODCRMQK7Y","Value":"wMPj0q3H7Zct","Expiration":"0001-01-01T00:00:00Z","Size":9}. What does this output mean? Provider Record maps a data identifier to a peer that has advertised that they have that content and are willing to provide. But I want to understand what the output means. Can someone please explain that to me.
  4. The command GET /records/fetch/{cid}?nProviders=1 looks for peers that can provide a specific CID, is that correct?

Thank you so much for your time and effort.
I really appreciate it.

Sorry for the delayed response here.

  1. They will not necessarily find and connect with each other, whether this happens is mostly random, and depends on things like their specific peer IDs and their subsequent locations in the DHT, how long they have been running, the traffic they've seen, etc. But you can force the IPFS node to connect to the hydra head using ipfs swarm connect <multiaddr>.

  2. What do you mean by "receive or add files"? Hydra heads aren't full IPFS nodes, they are only DHT nodes, and so are only applicable to the routing part of IPFS, not data transfer. Hydra heads aren't intended to be used to serve records other than those which are added to them by other nodes in the network, or are cached as a result of queries received from other nodes. From 1) and 2), it sounds like you might be trying to use Hydras for routing outside of the IPFS network, which isn't the intention of Hydras. If you want to reuse go-ipfs with different routing, you can write a new implementation of libp2p routing.Routing and wire it up in go-ipfs, but this will effectively create a new network.

  3. This is the raw output from the datastore that's storing the record. The key schema is /providers/<cid multihash>/<peerid> and the value is a varint-encoded int64 unix epoch timestamp in nanoseconds of when the record was written.

  4. Yes

Feel free to reopen if you want to discuss further