Versions in this module Expand all Collapse all v0 v0.2.0 Mar 13, 2019 v0.1.0 Jul 23, 2018 Changes in this version + var ErrBadResponseType = errors.New("bad response type") + type Encoder interface + Encode func(interface{}) error + type P2P interface + RequestBlockByHash func(ctx context.Context, peerID peer.ID, hash []byte) (*pb.Block, error) + RequestBlocksByNumber func(ctx context.Context, peerID peer.ID, from, amount uint64) ([]*pb.Block, error) + RequestHeaderByHash func(ctx context.Context, peerID peer.ID, hash []byte) (*pb.Header, error) + RequestHeadersByNumber func(ctx context.Context, peerID peer.ID, from, amount uint64) ([]*pb.Header, error) + RespondBlockByHash func(ctx context.Context, req *pb.BlockRequest, enc Encoder, chain chain.Reader) error + RespondBlocksByNumber func(ctx context.Context, req *pb.BlocksRequest, enc Encoder, c chain.Reader) error + RespondHeaderByHash func(ctx context.Context, req *pb.HeaderRequest, enc Encoder, chain chain.Reader) error + RespondHeadersByNumber func(ctx context.Context, req *pb.HeadersRequest, enc Encoder, c chain.Reader) error + func NewP2P(host ihost.Host, p protocol.ID) P2P