ssbc / ssb-ebt

secure scuttlebutt replication with epidemic-broadcast-trees
MIT License
18 stars 10 forks source link

horcrux #9

Closed mixmix closed 6 years ago

mixmix commented 6 years ago

@dominictarr here's the modification which allows client access to peers seq of you.

Here's the client side code I'm running to get output

var count = 0

  function getMySeq (server) {
    server.ebt.remoteFeedSequence((err, data) => {
      server.latestSequence(server.id, (err, seq) => {
        console.log(`${count} mins`)
        count = count + 1
        console.log('actual seq:', seq)
        console.log(JSON.stringify(data, null, 2))
        console.log('------------------')
      })
    })

    setTimeout(() => getMySeq(server), 60000)
  }

For out context the Ticktack pubs are

        console.log('ticktack pubs', [
          '@7xMrWP8708+LDvaJrRMRQJEixWYp4Oipa9ohqY7+NyQ=.ed25519',
          '@MflVZCcOBOUe6BLrm/8TyirkTu9/JtdnIJALcd8v5bc=.ed25519'
        ])
dominictarr commented 6 years ago

I would rather this took an id sbot.ebt.remoteSequences(sbot.id, function (err, map) {...}) because then it will work with multiple identities. probably should just return the value not cache it in ssb-ebt module, I think needing to cache that belongs to horcrux not ebt.

mixmix commented 6 years ago

yeah that's fine. this is the hello world, I hadn't forgotten your request. I mainly wanted to see how many peers there were and individually where they were up to.

what does the map do in this context?

anyway the API of this is one issue, the important issue before that is "why are the seq not updating fast" and "why only 2 peers for many minutes"

dominictarr commented 6 years ago

fixed in 5.2.0