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: known peers integration #528

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat: known peers integration #528

wants to merge 7 commits into from

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 <[email protected]>
Signed-off-by: Amean Asad <[email protected]>
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