Closed Powersource closed 4 years ago
A bit more docs in the module's readme https://github.com/ssbc/ssb-ebt
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
}
}
}
}
Gonna call it good enough for now, improvement suggestions/PRs welcome.
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