Documentation
¶
Overview ¶
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
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 BroadcastNodeConnInfoRequest
- type BroadcastNodeConnInfoResponse
- type CandidateNodeVotingRequest
- type CandidateNodeVotingResponse
- type ConfirmRequest
- type ConfirmResponse
- type DisHashResponse
- type DisRequest
- type GetBodiesRequest
- type GetBodyResponse
- type MaxBlockResponse
- type ReqTypesFlag
- type RequestType
- type SelfReaderWriter
- type StopNetworkRequest
- type StopNetworkResponse
- type VoteMsg
Constants ¶
View Source
const ( RequestTypeHonorNode ReqTypesFlag = iota + 1 RequestTypeNotHonorNode RequestTypeStopNetwork RequestTypeConfirmation RequestTypeBlockCollection RequestTypeMaxBlock RequestTypeVoting RequestSyncMatchineState // BlocksPerRequest contains count of blocks per request BlocksPerRequest int = 10 )
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 BroadcastNodeConnInfoRequest ¶
type BroadcastNodeConnInfoRequest struct {
Data []byte
}
type BroadcastNodeConnInfoResponse ¶
type BroadcastNodeConnInfoResponse struct {
Data []byte
}
type CandidateNodeVotingRequest ¶
type CandidateNodeVotingRequest struct {
Data []byte
}
type CandidateNodeVotingResponse ¶
type CandidateNodeVotingResponse struct {
Data []byte
}
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 ReqTypesFlag ¶
type ReqTypesFlag uint16
type RequestType ¶
type RequestType struct {
Type ReqTypesFlag
}
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
}
type VoteMsg ¶
type VoteMsg struct { CurrentBlockHeight int64 `json:"currentBlockHeight"` LocalAddress string `json:"localAddress"` TcpAddress string `json:"tcpAddress"` EcosystemID int64 `json:"ecosystemID"` Hash []byte `json:"hash"` Agree bool `json:"agree"` Msg string `json:"msg"` Time int64 `json:"time"` Sign []byte `json:"sign"` }
func (*VoteMsg) VerifyVoteForSign ¶
func (*VoteMsg) VoteForSign ¶
Directories
¶
Path | Synopsis |
---|---|
---------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------- |
---------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------- |
---------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------- |
Click to show internal directories.
Click to hide internal directories.