nim-libp2p
nim-libp2p copied to clipboard
[WIP] Test webrtc multiaddr
Running into a bug where identify protocol can't parse r2 field (addr): Result: IncorrectBlob [ResultDefect]
This happens when node is connected from Node JS with the following options: listen: ['/ip4/0.0.0.0/tcp/0', '/ip4/0.0.0.0/tcp/13579/wss/p2p-webrtc-star']
and means identify information isn't exchanged.
Can't get the nim-libp2p tests to run locally with Nimble, so using CI to test if multiaddr is parsed correctly.
Output
[Suite] MultiAddress test suite
/home/travis/gopath/src/github.com/status-im/nim-libp2p/tests/testmultiaddress.nim(301) testmultiaddress
/home/travis/.nimble/pkgs/stew-0.1.0/stew/results.nim(288) get
/home/travis/.nimble/pkgs/stew-0.1.0/stew/results.nim(279) raiseResultDefect
Unhandled exception: Trying to access value with err Result: multiaddress: Unsupported protocol 'wss' [ResultDefect]
[FAILED] go-multiaddr success test vectors
Would expect this to be valid and saved, without support for e.g. wss
.
Nevermind, it seems like it works as expected. I thought the identify exchange failed, but seems like it was a separate issue. The node can connect with TCP regardless of the unknown multiaddr. Can't reproduce.
In any case it is valid multiaddr, but I suppose the test is meant for supported cases and not valid? @dryajov can you confirm?
I do see things like "/onion/timaq4ygg2iegci7:1234",
though in valid vector, and I don't think nim-libp2p supports onion routing yet...
Update: see https://github.com/multiformats/go-multiaddr/commit/7bffa3759773e8f0e8dc2585d9e7c2f1f79e63c2#diff-2bf09b7aeb4b7b3ba3e7eec8b0cb02b9 for new test vectors
@oskarth list of supported MultiAddress types is here https://github.com/status-im/nim-libp2p/blob/master/libp2p/multiaddress.nim#L313-L398
And unsupported protocol ws
means that it do not supported - e.g. not implemented in MultiAddress.