-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
chore: adding default readme feat: reworking as a transport feat: getting peers communicating over relay (wip) feat: address in swarm [wip] feat: adding onion dial feat: adding onion dialing and tests feat: make circuit a full fledged transport refactor: split transport dialer and circuit logic test: adding dial tests feat: adding passive/active dialing test test: adding relay tests fix: several isues feat: consolidate and cleanup dialing feat: handle listenning circuit addresses correctly feat: make utils a factory feat: adding StreamHandler to aid with pull-stream read/write refactor: clean up and refactor relay and listener tests: adding more relay and listener tests tests: moving long multiaddr to a fixture feat: adding _writeErr to handle returning errors in relay.js fix: cleanup, moving setup code outside of dialer refactor: renaming Relay to Hop chore: fixing license chore: removing custom eslint config refactor: extract listening functionality into Stop handler fix: removing unused priority functionality fix: correct import of safe-buffer lint: remove unused import refactor: use async/setImmediate fix: remove unused constant refactor: move active/passive check out of _readDstAddr feat: initial readme write up fix: output correct circuit addresses feat: initial reimplementation of /hop /stop as a protobufs feat: reworking with protobufs feat: moving SUCCESS response to HOP from STOP feat: removing multihop (onion) dialing 0.0.3 fix: go-js integration test changes feat: adding dialer tests
8fe69a5
to
169be19
Compare
@dryajov could you update the first comment? Either remove the non-used checkboxes or fix them |
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.
Please update to latest aegir, @dryajov
@victorbjelkholm mind reviewing the whole PR and also check if the overall structure matches our common best practices? |
Will review this first thing tomorrow. |
circle.yml
Outdated
- sudo dpkg -i libnss3*.deb | ||
- sudo apt-get install -f | ||
- sudo apt-get install --only-upgrade lsb-base | ||
- sudo dpkg -i google-chrome.deb |
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 whole thing looks like a lot of fun, there is no simpler way? I seem to remember that one apt-get install -f
should be enough after trying to install the .deb, then try to install the .deb again.
Or, possibly try using gdebi
to figure out and install dependencies.
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 think that file is pretty old, I'll grab a more recent one from some related project.
src/circuit/dialer.js
Outdated
const strMa = ma.toString() | ||
if (!strMa.includes('/p2p-circuit')) { | ||
log.err('invalid circuit address') | ||
throw new Error('invalid circuit address') |
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.
Should return the error in the callback here
- circumventing NAT layers | ||
- route mangling for better privacy (matreshka/shallot dialing). | ||
|
||
It's also possible to use it for clients that implement exotic transports such as devices that only have bluetooth radios to be reachable over bluethoot enabled relays and become full p2p nodes. |
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.
tiny typo: bluethoot
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.
that readme needs some serious work tho...
|
||
### libp2p-circuit and IPFS | ||
|
||
Prior to `libp2p-circuit` there was a rift in the IPFS network, were IPFS nodes could only access content from nodes that speak the same protocol, for example TCP only nodes could only dial to other TCP only nodes, same for any other protocol combination. In practice, this limitation was most visible in JS-IPFS browser nodes, since they can only dial out but not be dialed in over WebRTC or WebSockets, hence any content that the browser node held was not reachable by the rest of the network even through it was announced on the DHT. Non browser IPFS nodes would usually speak more than one protocol such as TCP, WebSockets and/or WebRTC, this made the problem less severe outside of the browser. `libp2p-circuit` solves this problem completely, as long as there are `relay nodes` capable of routing traffic between those nodes their content should be available to the rest of the IPFS network. |
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.
TCP only nodes could only dial to other TCP only nodes
I don't think this is true (or badly worded at least). A node with a websocket and TCP transport could be dialed to from a TCP only node, or a websocket only node.
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.
Yeah, I was trying to convey the fact that if only speaking one protocol nodes could be only dialed over that protocol. Awesome stuff tho... I need to really rework the readme.
|
||
### Implementation rational | ||
|
||
This module is not a transport, however it implements `interface-transport` interface in order to allow circuit to be plugged with `libp2p-swarm`. The rational behind it is that, `libp2p-circuit` has a dial and listen flow, which fits nicely with other transports, moreover, it requires the _raw_ connection to be encrypted and muxed just as a regular transport's connection does. All in all, `interface-transport` ended up being the correct level of abstraction for circuit, as well as allowed us to reuse existing integration points in `libp2p-swarm` and `libp2p` without adding any ad-hoc logic. All parts of `interface-transport` are used, including `.getAddr` which returns a list of `/p2p-circuit` addresses that circuit is currently listening. |
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.
It looks like a transport, it quacks like a transport but it's not a transport?
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.
hrm... yeah :)
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.
So, it doesn't implement any transport protocol itself, it only hooks into the flow and delegates the communication to the underlying transports through swarm... There was some back and forth on why the interface was chousen, hence the explanation. This might need a bit more clarification as to why it is not a real transport.
README.md
Outdated
|
||
## License | ||
|
||
[MIT](LICENSE) © 2015-2016 Protocol Labs |
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.
Just put 2017
here instead
test/proto.spec.js
Outdated
}) | ||
|
||
it(`should source and dest`, () => { | ||
expect(message.srcPeer).to.not.be.null() |
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.
should be deep.equal
check rather than not.be.null
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.
hmm, there is nothing to deep.equal
to in this test, the message is the result of serializing an object literal to protobuf. I don't think it make sense to deep equal it to itself or de-serialize it one more time and then deep equal? Tho, I'm open to suggestions. 👌 🤔
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.
actually, I take that back! It makes perfect sense here ;-)
test/stop.spec.js
Outdated
id: `QmQvM2mpqkjyXWbTHSUidUAWN26GgdMphTh9iGDdjgVXCy`, | ||
addrs: [`/ipfs/QmQvM2mpqkjyXWbTHSUidUAWN26GgdMphTh9iGDdjgVXCy`] | ||
} | ||
}, new StreamHandler(conn), (conn) => { |
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.
seems the callback is missing err
here. Can we also assert that conn
is what we expect it to be? Same for the next test handle request with invalid multiaddr
NOTE: This
issuecomment is here for historic purposes, all further tracking is happening in ipfs/js-ipfs#830dependent PRs:
WIP - feat: Circuit Relay js-libp2p#116Awesome Endeavour: Circuit Relay ipfs/js-ipfs#830WIP - Feat/circuit interop js-libp2p-tcp#81feat: filter IPFS addrs correctly js-libp2p-websockets#62WIP - feat: add TCP and WS filtering with /ipfs fragment multiformats/js-mafmt#16feat: adding relay (#181) js-libp2p-switch#201test: adding circuit tests [wip] ipfs-inactive/js-libp2p-ipfs-nodejs#105feat: skip p2p-circuit addresses js-libp2p-tcp#80feat: skip p2p-circuit addresses js-libp2p-websockets#61Relevant issues:
CAN_HOP
message Type to circuit-relay to allow passive relay discovery specs#27Tasks:
Implement telescope dialing of chained relay addresses(we can do with onion dialing for now?)/libp2p/circuit/relay/1.0.0/stop
/libp2p/circuit/relay/1.0.0/hop
peer-id
andpeer-info
published to npmTests:
Dialer
Listener
Circuit relay
/libp2p/circuit/relay/1.0.0/hop
and forward connections to dst