Skip to content

add new api initTransports() #8693

Description

@r10s

instead of addTransportFromQr(), we need a dedicated api called initTransports(qrCode: Option<String>) 1.

the api adds automatically up to 3 relays, preferring relays from the QR code.

the new api does roughly:

  1. creates a randomized list of the hardcoded relays
  2. if the scanned qrCode is DCLOGIN: or DCACCOUNT:, pass it to addTransportFromQr()
  3. or if the scanned qrCode is a securejoin, add all relays to the beginning of relay candidates
  4. configure the first relay if not done in 2., going through the list. Multiple relays should be tried concurrently.
  5. other relays are added in the background as now with maybe_add_additional_relays()

Footnotes

  1. reason is that the qrCode passed there might be secure-join links, that are used as relay candidates. Config::Autorelay is completely internal afterwards for now (it might become interesting when we introduce automatic relay deletion/addition)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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