Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
misc: clean up diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Jun 5, 2017
1 parent 3f07259 commit 14d3df1
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,38 +146,36 @@ Both for dialing and listening.
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.

```
libp2p libp2p-circuit
+-------------------------------------------------+ +---------------------------------------------------------+
| | | |
| +---------------------------------+ | | |
| | | | | +------------------------+ |
| | | |circuit-relay registers the /hop | | | |
| | | | circuit-relay registers the /hop | | | |
| | libp2p-swarm |<----------------------------------------------------->| circuit-relay | |
| | | |multistream handler with the swarm | | | |
| | | |to handle incomming dial requests | +------------------------+ |
| +---------------------------------+ |from other nodes | transport |
| ^ ^ ^ ^ ^ ^ | | +-------------------------------------------+ |
| | | | | | | | | | +----------------------------------+ | |
| | | | | | | |dialer uses the swarm to dial to a | | | | | |
| | | +--------|--------------------------------------------------------------------->| dialer | | |
| | |transports| | | |relay node listening on the /hop | | | | | |
| | | | | | |multistream endpoint | | +----------------------------------+ | |
| | | | | | | | | | |
| v v v | v | | | | |
|+-----------------------------|-----------------+| | | +----------------------------------+ | |
|| | | || || | | | | | |
||libp2p-tcp |libp2p-ws | ....||libp2p-circuit ||listener registers a /stop multistream | | listener | | |
|| | | +--------------------------------------------------------------------> | | | |
|| | | |plugs in just ||handler with the swarm to handle | | +----------------------------------+ | |
| | | | multistream handler with the swarm | | | |
| | | | to handle incomming dial requests | +------------------------+ |
| +---------------------------------+ | from other nodes | |
| ^ ^ ^ ^ ^ ^ | | +-------------------------------------------+ |
| | | | | | | | | | +----------------------------------+ | |
| | | | | | | | dialer uses the swarm to dial to a | | | | | |
| | | | +------------------------------------------------------------------------------>| dialer | | |
| | |transports | | relay node listening on the /hop | | | | | |
| | | | | | | multistream endpoint | | +----------------------------------+ | |
| | | | | | | | | | |
| v v | v v | | | | |
|+------------------|----------------------------+| | | +----------------------------------+ | |
|| | | | | || | | | | | |
||libp2p-tcp |libp2p-ws | .... |libp2p-circuit ||listener registers a /stop multistream | | listener | | |
|| | +-------------------------------------------------------------------------------->| | | |
|| | | |pluggs in just ||handler with the swarm to handle | | +----------------------------------+ | |
|| | | |as any other ||incomming relay connections | | | |
|| | | |transport || | +-------------------------------------------+ |
|+-----------------------------------------------+| +---------------------------------------------------------+
| |
| |
+-------------------------------------------------+
|+-----------------------------------------------+| | |
| | | |
| | | |
+-------------------------------------------------+ +---------------------------------------------------------+
```

Expand Down

0 comments on commit 14d3df1

Please sign in to comment.