Skip to content
This repository was archived by the owner on Feb 5, 2023. It is now read-only.

Normalized connectΒ #4

@dholms

Description

@dholms

Summary

Problem

Different daemons can only connect to certain addresses. Local daemons need tcp or ws, in-browser daemons need wss or webRTC (when over https).

Impact

When doing a swarm.connect, you first need to figure what context the node comes from and then connect to an address that fits that context

Solution

  • Add an additional property to the returned ipfs object that gives it's source.
    ie:
ipfs.source = 'local' | 'browser'
  • Add an additonal method that takes multiple address types and connects to the proper one depending on the source. Param can be similar to the peers passed on instantiation
    ie:
ipfs.normalized.swarm.connect({
peers: [],
localPeers: [],
browserPeers: []
})

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions