Skip to content

Conversation

AmeanAsad
Copy link
Contributor

Changes

  • add known peers integration

Copy link
Contributor

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment


knownPeerList.forEach((peer, idx) => {
const { peerID, multiaddr, protocol } = peer;
if (!peerID || !multiaddr || !protocol) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if multiaddr starts with http, peerID and protocol do not need to be set

@hannahhoward
Copy link
Contributor

@AmeanAsad the lassie version is 0.22.0

knownPeerList.forEach((peer, idx) => {
const { peerID, multiaddr, protocol } = peer;

if (multiaddr && multiaddr.startsWith("http")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be checking multiaddr or protocol for http?

The peer structure i'm working with is

"knownPeers": {
    "web3.storage": [
      {
        "peerID": "QmUA9D3H7HeCYsirB3KmPSvZh3dNXMZas6Lwgr4fv1HTTp",
        "protocol": "http",
        "multiaddr": "/dns4/dag.w3s.link/tcp/443/https"
      }
    ]
  },

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The final url with the current logic will result in "/dns4/dag.w3s.link/tcp/443/https/p2p/QmUA9D3H7HeCYsirB3KmPSvZh3dNXMZas6Lwgr4fv1HTTp+http" which seems off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to @hannahhoward's description, we pass the raw multiaddr only if the actual multiaddr starts with http

Co-authored-by: Eric Guan <guanzo91@gmail.com>
Signed-off-by: Amean Asad <amean.asad1999@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants