Documentation ¶
Index ¶
- Variables
- type ChunkDelivery
- type Peer
- type Retrieval
- func (r *Retrieval) APIs() []rpc.API
- func (r *Retrieval) Protocols() []p2p.Protocol
- func (r *Retrieval) RequestFromPeers(ctx context.Context, req *storage.Request, localID enode.ID) (*enode.ID, func(), error)
- func (r *Retrieval) Run(bp *network.BzzPeer) error
- func (r *Retrieval) Spec() *protocols.Spec
- func (r *Retrieval) Start(server *p2p.Server) error
- func (r *Retrieval) Stop() error
- type RetrieveRequest
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoPeerFound = errors.New("no peer found")
)
Functions ¶
This section is empty.
Types ¶
type ChunkDelivery ¶
ChunkDelivery is the protocol msg for delivering a solicited chunk to a peer
func (*ChunkDelivery) Price ¶
func (cd *ChunkDelivery) Price() *protocols.Price
Price is the method through which a message type marks itself as implementing the protocols.Price protocol and thus as swap-enabled message
type Retrieval ¶
type Retrieval struct {
// contains filtered or unexported fields
}
Retrieval holds state and handles protocol messages for the `bzz-retrieve` protocol
func New ¶
func New(kad *network.Kademlia, ns *storage.NetStore, baseKey *network.BzzAddr, balance protocols.Balance) *Retrieval
New returns a new instance of the retrieval protocol handler
func (*Retrieval) RequestFromPeers ¶
func (r *Retrieval) RequestFromPeers(ctx context.Context, req *storage.Request, localID enode.ID) (*enode.ID, func(), error)
RequestFromPeers sends a chunk retrieve request to the next found peer. returns the next peer to try, a cleanup function to expire retrievals that were never delivered
type RetrieveRequest ¶
RetrieveRequest is the protocol msg for chunk retrieve requests
func (*RetrieveRequest) Price ¶
func (rr *RetrieveRequest) Price() *protocols.Price
Price is the method through which a message type marks itself as implementing the protocols.Price protocol and thus as swap-enabled message