-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement instant replies #24
Comments
Are we able to implement this at the moment or do we need to modify Kubo? |
I believe we would implement this in javascript only for now, because writing it in go would be pretty complicated, and most people use the browser/mobile version anyway. I wrote an example of how to use the fetch protocol here to add persistence to ipns over pubsub (@helia/ipns doesnt have it yet) https://github.com/estebanabaroa/custom-pubsub/blob/master/demo3.js It works but I wasn't able to make it interoperate with kubo, so I might be doing something wrong. I will write a more direct example of how we would use pubsub and the fetch protocol when I have time, so you could wait for that to start working on it. I think instant replies is fairly high priority to get a prototype working though, so that plebchan can work more like 4chan. We should work on it soon imo. |
we probably actually want to send the full which means
|
steps to get instant replies:
assuming the user calls
plebbit.createComment({pubsub: true, cid: 'Qm...'})
andcomment.update()
join pubsub
/last-reply/Qm...
/last-reply/Qm...
using libp2p fetch protocolthe value received is (all peers must store the last answer they have and answer the fetch protocol with it)
validate the sub comment update signature
the last reply has the highest
reply.sequenceNumber
(property added by sub owner)whenever the last reply changes, download all the replies you don't yet have by scrolling
reply.previousCid
emit comment
'update'
event by adding the new replies to thecomment.replies
for as long as the user is joined to the pubsub, keep listening for new replies and emitting updates. possibly implement comment.pubsubStop() or just use comment.stop() which already exists to leave the pubsub.
steps to publish instant replies:
assuming the user calls
plebbit.createComment({pubsub: true, parentCid: 'Qm...'})
andcomment.publish()
publish comment normally, and wait for challenge verification. challenge verifications must contain
challengeVerificationMessage.publication.update
:join pubsub
/last-reply/Qm...
/last-reply/Qm...
using libp2p fetch protocolif
sequenceNumber
is lower than your sequence number, publish your own comment update received from the sub ownerspam mitigation
random people can't spam because all the comment updates are signed by the sub owner and have a sequence number, so not signed or duplicate comments can be ignored/blocked from the pubsub
The text was updated successfully, but these errors were encountered: