This might come a bit late, but there's a test suite that runs handshakes over stdin/stdout, both correct ones and faulty ones. There's also a readable js implementation.
I don't know this part of the stack. Are the SHS docs that @duncan wrote any help ? https://github.com/ssbc/scuttlebutt-protocol-guide
(hey @duncan the link to the guide is broken in https://github.com/ssbc/scuttlebutt-guide)
@moid this bubbled up again because I saw @duncan's comment.
The reason is mainly the third that duncan mentions - It sends a single createHistoryStream to check if you are connecting as a replicating peer or as a rpc client (say, you are patchwork). If you are a client, that createHistoryStream
will error, and then sbot won't make any more replication requests. This is non-ebt replication, mind - if sbot receives a request from createHistoryStream it will then request all the feeds that it replicates.
ssb-ebt
has a similar behaviour were the initial request is only small, and doesn't send lots of data until the peer responds confirming they understand ebt.
One other reason for requesting your own feed, is that the remote who also requests it knows for sure how uptodate they are, which makes it possible to draw progress bars!