-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
Couldn't push to this branch, so here is a PR with the latest changes - #204 |
This PR: #216 is already merged here because I need this functionality in circuit, but it is its own PR. |
@dryajov mind squashing the commits on this branch? The commit history is a bit messy making it harder to review. We have the best practice of using |
@diasdavid will do! |
04b4150
to
135526d
Compare
135526d
to
d4b595a
Compare
@diasdavid both #216 and #217 are already merged with this PR, we should be able to safely close those. |
src/connection.js
Outdated
@@ -55,7 +57,7 @@ module.exports = function connection (swarm) { | |||
} | |||
const b58Str = peerInfo.id.toB58String() | |||
|
|||
swarm.muxedConns[b58Str] = { muxer: muxedConn } | |||
swarm.muxedConns[b58Str] = {muxer: muxedConn} |
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.
unnecessary cosmetic change
src/connection.js
Outdated
@@ -92,6 +94,11 @@ module.exports = function connection (swarm) { | |||
}) | |||
}, | |||
|
|||
relay (config) { | |||
swarm.relay = true | |||
swarm.transport.add(Circuit.tag, new Circuit.Dialer(swarm, config)) |
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.
I rather prefer to make relay specific and not a 'transport' like this. The transport interface will evolve and that doesn't necessarily need to trickle to relay.
On the dial.js, after trying all transports, then it should try relay to get that first conn.
src/index.js
Outdated
const dial = require('./dial') | ||
const protocolMuxer = require('./protocol-muxer') | ||
const plaintext = require('./plaintext') | ||
const assert = require('assert') | ||
|
||
const DEFAULT_TRANSPORT_PRIORITY = 1 |
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 should be removed now.
As I mentioned here:
The relay listener never gets used. |
389b73b
to
4326ea6
Compare
@diasdavid We still need this for listening on specific relays, overall I think this makes sense as it allows extending and plugin with the swarm more easily. |
feat: adding default priority for transports feat: limit dialer cb should be called only once feat: push circuit to be the last transport dialed misc: rename relay method to enableRelayDialing style: revert formatting
4efaa3c
to
16bcb2a
Compare
@diasdavid @lgierth @dignifiedquire Closing this since we're not doing multihop dialing anymore. |
No description provided.