开发者社区> 镜像站> NPM> ssb-ooo
ssb-ooo
gossip requests for out-of-order messages on ssb
Last updated 6 months ago by arj03 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ssb-ooo 
SYNC missed versions from official npm registry.

ssb-ooo

retrive ssb messages Out Of Order.

overview

ssb messages are totally ordered by feed, and this is used to validate the integrity of a feed. In ssb it's also intended that you do not necessarily replicate the entire network's data, but just your local corner of it (your circle of friends)

However, sometimes there are messages that are just a little beyond these bounds. ssb-ooo gives you more nuanced control over how fuzzy the bounds of your network is.

In ooo you pull in a message by it's hash. You cannot request a message if you don't know the hash. Normally, when you replicate a feed, you validate those messages in the context of their public key and signatures - because of some expression of interest in the future of that feed. In ooo you only pull in messages that someone you replicate has responded to. So, the signature on the ooo message doesn't really matter, what matters is that the signature on your friends message signs the hash of the ooo message, and the ooo message has that hash. Who wrote the ooo message isn't really important, what's important is that your friend responded to it.

design

This module is just an adapter bring gossip-query into a secure scuttlebutt context. The design of the protocol in general is discussed there.

api

ooo.get (id | {id, timeout:ms?}, cb)

get a message with ooo. if it takes longer than timeout, an error will be returned. the message may still be retrived later.

by default, ssb-ooo also intercepts sbot.get any message that you try to retrive that is not in the log will be got via ooo, and once the timeout has been exceeded, it will check the log again, but let it callback directly that time. this can be disabled by setting ooo: { hook: false} in your config.

ooo.stream ()

called by the client to initiate a ooo protocol stream. (normally this happens automatically, when two peers connect)

configuration

{
  timeout: 5000, //how many ms to wait before calling back anyway.
  hook: true,    //disable hooking of sbot.get
}

License

MIT

Current Tags

  • 1.3.3                                ...           latest (6 months ago)

19 Versions

  • 1.3.3                                ...           6 months ago
  • 1.3.2                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago