Skip to content

[circuit-relay] Circuit features/functionality discussion #425

@dryajov

Description

@dryajov

Here are some notes after my conversation with @diasdavid.

  1. We need a way to ask the relay for all its relayed peer connections (@diasdavid, I forgot why we needed this, can you please explain? Would this be related to point 2 in this list?)
    • After thinking about this a bit, I think what we discussed is:
      • When a peer connects to me, get its connected peers, and have it relay connection to those peers. That way we'll quickly form a mesh of peers over the same muxed channel.
      • One obvious use case I can see, for example, in orbit chat, getting peers that are trying to connect to the same channel to quickly interconnected over the already muxed channel. That should make accessing the same resource a lot quicker and reduce the number of physical connections.
  2. Enable/disable ls for available connections on relay nodes (see above ^^ @diasdavid)
  3. All peers are relays, but they can function in two modes:
    • active/proactive relays that dial into other nodes
      • this are explicitly enabled by config options
    • passive relays, which only relay over known connections, no explicit dialing. If no connection exists for the requested peer, the relay is refused.
  4. A peer can say that it's only available over a particular relay (can it be multiple relays?), by adding it to its swarm config - /p2p-circuit/< ma >
    • Useful in case of peers located in a private/slow network
    • What are the other use cases for this?
  5. Relays only relay connections from Peer A to Peer B, if there are more than one hop in the multiaddr (chaining/nesting), then its the dialer that initiates the connection to the next relay pair in the chain. This is needed so that we disclose the least possible amount of information to the network.

Here is an example of a possible circuit/relay config:

Swarm: {
  Addresses: [
    '/p2p-circuit/<multiaddr of the Relay>'
  ]
}
Relay: {
  Circuit: {
    Enabled: false,
    list-peers: false
    Proactive: false
  }
}

@lgierth @diasdavid @dignifiedquire

I'm going to start implementing some of this, in particular points 3, 4, 5, point 1 and 2 might need some discussion/clarification.

Also, lets use this issue for further discussion. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions