-
Notifications
You must be signed in to change notification settings - Fork 49
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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
@AmeanAsad the lassie version is 0.22.0 |
knownPeerList.forEach((peer, idx) => { | ||
const { peerID, multiaddr, protocol } = peer; | ||
|
||
if (multiaddr && multiaddr.startsWith("http")) { |
There was a problem hiding this comment.
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"
}
]
},
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
Changes