Skip to content

feat: known peers integration#528

Open
AmeanAsad wants to merge 7 commits intomainfrom
feat/known-peers
Open

feat: known peers integration#528
AmeanAsad wants to merge 7 commits intomainfrom
feat/known-peers

Conversation

@AmeanAsad
Copy link
Copy Markdown
Contributor

Changes

  • add known peers integration

Comment thread container/shim/src/utils/jwt.js Outdated
Comment thread container/shim/src/utils/jwt.js Outdated
Copy link
Copy Markdown
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

Comment thread container/shim/src/fetchers/lassie.js Outdated

knownPeerList.forEach((peer, idx) => {
const { peerID, multiaddr, protocol } = peer;
if (!peerID || !multiaddr || !protocol) {
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@AmeanAsad the lassie version is 0.22.0

Comment thread container/shim/src/fetchers/lassie.js Outdated
knownPeerList.forEach((peer, idx) => {
const { peerID, multiaddr, protocol } = peer;

if (multiaddr && multiaddr.startsWith("http")) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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