Giter VIP home page Giter VIP logo

ssb-ooo's Introduction

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

ssb-ooo's People

Contributors

dominictarr avatar christianbundy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.