-
Notifications
You must be signed in to change notification settings - Fork 37
[WIP] Add secio & move to pull-streams #67
Conversation
6d53c61
to
bf1574d
Compare
I'm pretty close to passing tests, there is just one issue left to fix. When initiating the --> /multistream/1.0.0
<-- /multistream/1.0.0
<-- /secio/1.0.0
listener ready
handle: QmVg942ZGNuGw7AFpiQAPsdRxzCK4J9e15NZGEBaixowQV
libp2p:secio 1. propose - start +0ms
libp2p:secio 1. propse - writing proposal +1ms
writing: <Buffer f3 02 0a 10 98 a4 3a fb f0 07 e4 74 09 8c 9c 14 28 43 b9 6a 12 ab 02 08 00 12 a6 02 30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 82 01 ... >
libp2p:secio 1. propose - proposal size 373 +8ms
I shall read: 373
--> /secio/1.0.0
dial: QmRRTGZEykibGGAEpSDh3fK2UnL746x5zHeQzNzERc74uM
libp2p:secio 1. propose - start +4ms
libp2p:secio 1. propse - writing proposal +0ms
writing: <Buffer f3 02 0a 10 1b c0 15 68 22 cd c6 e9 0d 99 7e ae 4e 64 d8 f3 12 ab 02 08 00 12 a6 02 30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 82 01 ... >
libp2p:secio 1. propose - proposal size 373 +6ms
I shall read: 373
reading <Buffer 0d 2f 73 65 63 69 6f 2f 31 2e 30 2e 30 0a f3 02 0a 10 98 a4 3a fb f0 07 e4 74 09 8c 9c 14 28 43 b9 6a 12 ab 02 08 00 12 a6 02 30 82 01 22 30 0d 06 09 ... >
reading msg <Buffer f3 02 0a 10 1b c0 15 68 22 cd c6 e9 0d 99 7e ae 4e 64 d8 f3 12 ab 02 08 00 12 a6 02 30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 82 01 ... >
libp2p:secio 1. propse - reading proposal +4ms <Buffer 0a 10 1b c0 15 68 22 cd c6 e9 0d 99 7e ae 4e 64 d8 f3 12 ab 02 08 00 12 a6 02 30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 82 01 0f 00 ... >
libp2p:secio 1.1 identify +1ms
libp2p:secio 1.1 identify - QmVg942ZGNuGw7AFpiQAPsdRxzCK4J9e15NZGEBaixowQV - identified remote peer as QmRRTGZEykibGGAEpSDh3fK2UnL746x5zHeQzNzERc74uM +6ms
libp2p:secio 1.2 selection +0ms
libp2p:secio 1. propose - finish +1ms
libp2p:secio 2. exchange - start +1ms
libp2p:secio 2. exchange - writing exchange +0ms
writing: <Buffer c6 02 0a 41 04 87 54 67 c3 15 ba f1 b6 ff b9 c3 0c 6f 8a e4 16 fc b6 7a 54 51 20 e6 ee 5d 63 c1 bd 89 f2 b0 59 15 4b dd 1b 4e 50 fc c2 81 24 42 79 96 ... >
I shall read: 328
# hangs.. The message that is lost is the first one with |
Adding the below snippet to https://github.com/diasdavid/js-multistream/blob/master/src/listener.js#L62 if (handlers[msg]) {
// Protocol supported, ACK back
encode.write(new Buffer(msg + '\n'));
if (conn.cork) {
conn.cork()
setTimeout(() => {
conn.uncork()
}, 100)
}
console.log('listener ready')
return handlers[msg](conn); fixes the issue. |
@dignifiedquire just to confirm, this just depends on merges and releases, all the rest is 👌 ? |
What was the magic to not need |
@@ -35,7 +38,7 @@ module.exports = function connection (swarm) { | |||
ms.select(identify.multicodec, (err, conn) => { | |||
if (err) { return cb(err) } | |||
|
|||
identify.exec(conn, (err, peerInfo, observedAddrs) => { | |||
identify.listen(conn, (err, peerInfo, observedAddrs) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: This will change to 'dialer', once identify CR is applied
Secio yes, but some of the other tests do not yet pass with all the new pull-stream things. Especially webrtc as that isn't migrated yet, and I'm having some issues with websockets, probably due to the halfOpen issue. |
|
All tests are now ported and mostly passing. Only some related to websockets are still failing: |
Started doing some fixes for the websocket problems in |
|
Last things before merge
|
|
||
const id = swarm._peerInfo.id | ||
if (id.privKey == null || swarm.encrypt === false) { | ||
return ms.select(tags.plaintex, cb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this typo is what was causing my issue in libp2p-ipfs
This is done, needs the new secio api: libp2p/js-libp2p-secio#17 |
All tests pass locally when using the above mentioned secio branch plus libp2p/js-libp2p-webrtc-star#19 |
bfbe84f
to
c6bd83b
Compare
Changes Unknown when pulling 6091e94 on secio into * on master*. |
Changes Unknown when pulling 6091e94 on secio into * on master*. |
@dignifiedquire why do we have coveralls badges all over again? |
Changes Unknown when pulling 6091e94 on secio into * on master*. |
trying to disable them one at a time, but they are enabled by default :( |
Not finished yet
Closes #63