Fierro-Labs / Fierro

IPNS API and pinning service
https://www.fierro.io
MIT License
34 stars 4 forks source link

IPNS Pinning - IPNS watching/listening/following #12

Open mrodriguez3313 opened 2 years ago

mrodriguez3313 commented 2 years ago

Create endpoint that accepts a IPNS Path ("/ipns/k51...") and resolves it. This function should return the data that was resolved as confirmation. (think gateway.ipfs.io/ipfs/Qm....)

Expectations: This will take a while to resolve, for example: if you publish anything to IPNS, then try to go to gateway.ipfs.io/ipns/<k51...>. It will not resolve it, and may not ever resolve it. One way to mitigate this would be to enable IPNSPubSub. As I understand it, that would enable quick discovery, but will auto download everything published to IPNS by anyone as well. This would obviously not be the best solution because then storage would fill up extremely quick and be costly (thinking about web2 cloud storage costs).

For the purposes of putting a name of this functionality I will call it IPNS Following (giving credit to Jorropo where I first saw it being mentioned here discuss.ipfs.io.

Theoretically, the functionality should be as follows:

Spit balling solutions:

The easiest way to resolve and follow IPNS records is if they were to be originally published by the API, then user can take their key and publish later on on their own OR optionally choose for us to keep alive for them. (IPNS Republishing)

mrodriguez3313 commented 2 years ago

Okay first implemented here: #18

mrodriguez3313 commented 2 years ago

One idea for keeping track of only specific IPNS records to be tracked is. Whenever someone hits the "Follow()" endpoint that IPNS name will be added to a queue. The record at HEAD, once resolved, will move to the end of the list. And this will happen indefinitely until user says otherwise or 't' amount of time has passed or content has come back unresolved x times. This will can be a go-script running at all times.

mrodriguez3313 commented 2 years ago

I need to add delete support for the queue. but basic IPNS following has been implemented here https://github.com/mrodriguez3313/IPNSGoServer/pull/20

mrodriguez3313 commented 2 years ago

Basic delete support added here https://github.com/mrodriguez3313/IPNSGoServer/pull/22