Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement MdnsDiscovery #177

Merged
merged 38 commits into from
Sep 19, 2023
Merged

feat: Implement MdnsDiscovery #177

merged 38 commits into from
Sep 19, 2023

Commits on Aug 14, 2023

  1. WIP: MdnsDiscovery

    Co-authored-by: tomasciccola <tomasciccola@users.noreply.github.com>
    gmaclennan and tomasciccola committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    913081f View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. feat: additions to discovery/mdns.js class add some tests

    Tomás Ciccola committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    ae3a8e3 View commit details
    Browse the repository at this point in the history
  2. chore: fixed bug on passing handler to net.connect

    Tomás Ciccola committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    154a3d0 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2023

  1. feat: handle two sets for deduplication, various changes

    Tomás Ciccola committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    11547ed View commit details
    Browse the repository at this point in the history
  2. feat: add check for 'error' event and more checks to dedup

    Tomás Ciccola committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    9e1f790 View commit details
    Browse the repository at this point in the history
  3. feat: actually test mdns connections and matching keys

    Tomás Ciccola committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    abf561b View commit details
    Browse the repository at this point in the history
  4. chore: add type declarations for dnssd from digidem/multicast-service…

    …-discovery
    
    try to use those declarations and failed
    Tomás Ciccola committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    ea42c92 View commit details
    Browse the repository at this point in the history
  5. feat: destroy noise sockets so connections don't hang

    Tomás Ciccola committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    66588fb View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2023

  1. trying to solve dedup

    Tomás Ciccola committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    3b694a8 View commit details
    Browse the repository at this point in the history
  2. WIP fixing bugs

    Co-authored-by: tomasciccola <tomasciccola@users.noreply.github.com>
    gmaclennan and tomasciccola committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    8e739cc View commit details
    Browse the repository at this point in the history
  3. fix types

    gmaclennan committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    a75e9e7 View commit details
    Browse the repository at this point in the history
  4. fix hanging open socket

    I dunno if this is the best solution (or if `secretStream` and `server`
    should share the same `close` handler), but it works...
    Tomás Ciccola committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    e739f9b View commit details
    Browse the repository at this point in the history
  5. lets make the ci happy for a while

    Tomás Ciccola committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    19f2807 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2023

  1. only allow privateIps for mdns connections

    Tomás Ciccola committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    e67713d View commit details
    Browse the repository at this point in the history
  2. add getter for noise stream connections

    Tomás Ciccola committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    a032b03 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2023

  1. add more tests.

    It seems that hypercore replication from on instance to another is failing.
    There's probably a bug I haven't catch yet...
    Tomás Ciccola committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    3de9a03 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2023

  1. solve dnssd type errors

    Tomás Ciccola committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    ebef801 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. add initial testing of multiple connection of peers

    Tomás Ciccola committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    7ad1676 View commit details
    Browse the repository at this point in the history
  2. move server 'close' handler to start method

    It was on the `handleConnection` which meant adding unnecessary handlers
    for the same event (for each peer connected)
    Tomás Ciccola committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    2ae76bf View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. various changes:

    * remove `this.#socketConnections`
    * attach listeners to `error` and `close` before `await once`
    * remove type annotation solved by type guard
    * start browser and advertiser 'together'
    * `await` closing of server
    Tomás Ciccola committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    b936c78 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. test connection between multiple peers

    The test added can fail (and others too probably), because sometimes
    `this.#browser.on('serviceUp')` will return a `service.addresses` with
    a IPv6 which yields the following error:
    ```bash
    node:events:491
          throw er; // Unhandled 'error' event
          ^
    
    Error: connect EINVAL fe80::fa9a:552c:fcb8:f2fb:41373 - Local (:::0)
        at internalConnect (node:net:1041:16)
        at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
        at node:net:1134:9
        at processTicksAndRejections (node:internal/process/task_queues:78:11)
    Emitted 'error' event on Socket instance at:
        at emitErrorNT (node:internal/streams/destroy:157:8)
        at emitErrorCloseNT (node:internal/streams/destroy:122:3)
        at processTicksAndRejections (node:internal/process/task_queues:83:21) {
      errno: -22,
      code: 'EINVAL',
      syscall: 'connect',
      address: 'fe80::fa9a:552c:fcb8:f2fb',
      port: 41373
    }
    ```
    Tomás Ciccola committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    b1457f9 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. the tcp client now only connects to IPv4 addresses

    Tomás Ciccola committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    ee70ca4 View commit details
    Browse the repository at this point in the history
  2. add comments to multiple peer tests and teardown

    Tomás Ciccola committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    e5a756e View commit details
    Browse the repository at this point in the history
  3. put timeout on ci workflow, update lockfile

    Tomás Ciccola committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    e5acbf3 View commit details
    Browse the repository at this point in the history
  4. merge and increase timeout

    Tomás Ciccola committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    4d15ac6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e8a3f63 View commit details
    Browse the repository at this point in the history
  6. cleanup

    Tomás Ciccola committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    c9e746d View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2023

  1. Configuration menu
    Copy the full SHA
    8104f5d View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2023

  1. Configuration menu
    Copy the full SHA
    25ba169 View commit details
    Browse the repository at this point in the history
  2. minor fix to test timing

    gmaclennan committed Sep 5, 2023
    Configuration menu
    Copy the full SHA
    cbe6943 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    748f431 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2023

  1. Merge branch 'main' into feat/mdns-discovery

    * main: (25 commits)
      add initial implementation of MemberApi (#232)
      feat: $blobs.getUrl and $blobs.create methods (#184)
      chore: update manager e2e tests (#237)
      feat: add capabilities (#231)
      feat: coreOwnership integration [3/3] (#230)
      feat: CoreOwnership class w getOwner & getCoreKey [2/3] (#229)
      feat: handle `coreOwnership` records in `IndexWriter` [1/3] (#214)
      fix: adjust storage options for MapeoManager and MapeoProject (#235)
      implement addProject method for MapeoManager class (#215)
      implement listProjects method for MapeoManager class (#208)
      feat: expose blobStore.writerDriveId (#219)
      implement wrapper client containing createProject and getProject methods (#199)
      add project settings functionality to MapeoProject (#187)
      feat: Add encode/decode for project keys [3/3] (#203)
      feat: update protobuf for RPC [2/3] (#202)
      chore: move protobuf messages into src/generated [1/3] (#201)
      feat: Add internal `dataType.createWithDocId()` (#192)
      chore: explicitly set "mode" opt for encryptionKeys column creation (#186)
      chore: fix linting and type checking (#183)
      chore: consolidate encryption key columns in projectKeys table (#181)
      ...
    gmaclennan committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    8fe03c7 View commit details
    Browse the repository at this point in the history
  2. fix lint error

    gmaclennan committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    402cecd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8cd04d3 View commit details
    Browse the repository at this point in the history
  4. private-ip -> bogon

    gmaclennan committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    d37f0e6 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. Make tests pass for now

    gmaclennan committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    8e6e2ea View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' into feat/mdns-discovery

    * main:
      chore: condense setup code in MemberAPI tests (#267)
      chore: replace queries opt in MemberAPI with dataType (#266)
      feat: add getMany method to member api (#263)
      feat: add getById method to member api (#262)
      chore: Update @digidem/types and remove patch (#269)
      feat: share all core keys via extension messages (#264)
      feat: send core "haves" bitfield on first connect (#254)
      fix: invite.encryptionKeys should be required (#260)
      feat: Add set & get deviceInfo & datatype (#250)
      expose member namespace in MapeoProject (#253)
      blobStore.createReadStream should not wait (#243)
      update MapeoManager to return and handle project public IDs (#247)
      return content hash from blobApi.create (#242)
    gmaclennan committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    c5d88c4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eba4935 View commit details
    Browse the repository at this point in the history