ssbc / ssb-first-aid-kit

A user-friendly app for diagnosing and fixing problems with your Scuttlebutt installation
GNU Affero General Public License v3.0
15 stars 3 forks source link

Make the ebt view more informative and useful #7

Closed Powersource closed 4 years ago

Powersource commented 4 years ago

Right now it's not very clear what it's telling us.

Some notes in this issue https://github.com/ssbc/ssb-first-aid-kit/issues/3

Powersource commented 4 years ago

A bit more docs in the module's readme https://github.com/ssbc/ssb-ebt

Powersource commented 4 years ago

Dumping all the datastructure related docs I have to get an overview

// example code for ebt polling

var seq = 0
var replication = {}

server.ebt.peerStatus(server.id, (err, data) => {
  if (err) return console.error(err)

  seq = data.seq // this is my actual sequence

  for (var peer in data.peers) {
    replication[peer] = data.peers[peer]
  } // update what the peer says my sequence is at
})
{
  "id": "@EMovhfIrFk4NihAKnRNhrfRaqIhBv1Wj8pTxJNgvCCY=.ed25519",
  "seq": 13293, //the sequence we have locally.
  "peers": {
    //where each of these peers are up to:
    "@TRE4lNNXrtx3KK9Tgks2so2PjCP6w9tRvsy7wyqiyo4=.ed25519": {
      "seq": 13293, //the sequence this peer has acknowledged, we definitely know they have this number.
      "replicating": {
        "tx": true,
        "rx": true,
        "sent": 13293, //the sequence we have sent to this peer. They _probably_ have this, but not gauranteed.
        "requested": 13293 //the sequence we requested from this peer
      }
    },
    "@h1fDsZgwBtZndnRDHCFV84TMZYl16m3zhyTTQsE/V94=.ed25519": {
      "seq": 13293,
      "replicating": {
        "tx": true,
        "rx": false,
        "sent": 13293,
        "requested": 13293
      }
    }
  }
}
Powersource commented 4 years ago

Gonna call it good enough for now, improvement suggestions/PRs welcome.

image