plebbit / plebbit-js

A Javascript API to build applications using plebbit
GNU General Public License v2.0
41 stars 7 forks source link

Design idea for instant replies #17

Open estebanabaroa opened 1 year ago

estebanabaroa commented 1 year ago

Motivation: instant replies are important for sites like 4chan. The IPNS updates can only occur every X minutes. Also useful for reddit live threads.

Design idea for instant replies

a pubsub topic named "<subplebbitAddress><postCid>"

peers that want instant replies join the pubsub. whenever a peer receives the challenge verification for their reply, they publish the publication from the challenge verification to the pubsub (publication will now need to contain a comment update signature from sub owner)

whenever a peer receives a message in the pubsub, he validates the message with subplebbitAddress signature and postCid

whenever a peer joins the pubsub, he receives all messages posted in the last 10 minutes (older than 10 minutes are available in the comment update so not needed)

design idea for instant posts in a subplebbit

a pubsub topic named "<subplebbitAddress>timestamp600" (timestamp newer than 600 seconds)

same exact same strategy as replies, execpt what is being validated is timestamp instead of postCid

downsides

Rinse12 commented 11 months ago

Since we changed the plebbit.publishInterval, subplebbit updates are pretty fast. If I edit a subplebbit in CLI I can see the new ipns with the change propagated in the daemon in about 10s. So there may not be a need for this idea imo. We should wait and see

estebanabaroa commented 10 months ago

Since we changed the plebbit.publishInterval, subplebbit updates are pretty fast. If I edit a subplebbit in CLI I can see the new ipns with the change propagated in the daemon in about 10s. So there may not be a need for this idea imo. We should wait and see

that's true should wait and see, it'll probably only be needed when subs have tens of thousands of users. I guess it's low priority for now