Documentation ¶
Index ¶
- Constants
- Variables
- func ReadInt(r io.Reader) (int64, error)
- func ReadSlice(r io.Reader) ([]byte, error)
- func ReadSliceWithMaxSize(r io.Reader, maxSize uint64) ([]byte, error)
- func SendRequestType(reqType int64, w io.Writer) error
- func WriteInt(value int64, w io.Writer) error
- type ConfirmRequest
- type ConfirmResponse
- type DisHashResponse
- type DisRequest
- type DisTrResponse
- type GetBodiesRequest
- type GetBodyResponse
- type MaxBlockRequest
- type MaxBlockResponse
- type RequestType
- type SelfReaderWriter
- type StopNetworkRequest
- type StopNetworkResponse
Constants ¶
View Source
const ( RequestTypeFullNode = 1 RequestTypeNotFullNode = 2 RequestTypeStopNetwork = 3 RequestTypeConfirmation = 4 RequestTypeBlockCollection = 7 RequestTypeMaxBlock = 10 // BlocksPerRequest contains count of blocks per request BlocksPerRequest int32 = 1000 MaxBlockSize = 10485760 )
Types of requests
Variables ¶
View Source
var ErrMaxSize = errors.New("Size greater than max size")
View Source
var ErrNotAccepted = errors.New("Not accepted")
Functions ¶
Types ¶
type ConfirmRequest ¶
type ConfirmRequest struct {
BlockID uint32
}
ConfirmRequest contains request data
type ConfirmResponse ¶
type ConfirmResponse struct { // ConfType uint8 Hash []byte `size:"32"` }
ConfirmResponse contains response data
type DisHashResponse ¶
type DisHashResponse struct {
Data []byte
}
DisHashResponse contains response data
type GetBodiesRequest ¶
GetBodiesRequest contains BlockID
type MaxBlockResponse ¶
type MaxBlockResponse struct {
BlockID int64
}
MaxBlockResponse is max block response
type RequestType ¶
type RequestType struct {
Type uint16
}
RequestType is type of request
type SelfReaderWriter ¶
SelfReaderWriter read from Reader to himself and write to io.Writer from himself
type StopNetworkRequest ¶
type StopNetworkRequest struct {
Data []byte
}
type StopNetworkResponse ¶
type StopNetworkResponse struct {
Hash []byte
}
Click to show internal directories.
Click to hide internal directories.