-
Notifications
You must be signed in to change notification settings - Fork 28
Kademlia forwarder peer query service #35
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
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.
Very well written. Approved.
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.
Great SWIP! Please assign number 35 to the document so we can merge it.
|
||
type SessionRPCInterface interface { | ||
NewForwardPeerSession(ctx context.Context) (context.Context, error) | ||
Subscribe(ctx context.Context, "kademlia", ch chan PeerEvent, "forward") (sub rpc.Subscription, err error) |
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.
can you explain why there are hardcoded values in the signature?
NewForwardPeerSession(ctx context.Context) (context.Context, error) | ||
Subscribe(ctx context.Context, "kademlia", ch chan PeerEvent, "forward") (sub rpc.Subscription, err error) | ||
GetForwardPeer(ctx context.Context, numberOfPeers int) (peers []ForwardPeer, err error) | ||
CloseForwardPeerSession(ctx context.Context) |
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.
maybe just CloseSession?
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.
Is it not more intiutive if it matches the constructor name?
SessionId string | ||
} | ||
|
||
type SessionRPCInterface interface { |
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.
interface
type name should not end with Interface
. I'd also vote to reshuffle this name altogether in favor of something more meaningful?
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.
ForwardSession
ForwardSessionAPI
@acud ?
|
||
## Rationale | ||
|
||
The component shall provide a service where given a specific Swarm Overlay Address, connected peers will be returned in the order of closest to farthest. |
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.
you mention a given Swarm Overlay Address
, however a pivot address is not mentioned in any of the function signatures you've defined. In layman terms: you need to know which peer to forward to given a content addressed hash and the peers to forward to would be ordered according to that reference, but that reference parameter is not mentioned in the signatures (or am i getting this all wrong?)
No description provided.