Documentation ¶
Index ¶
- Variables
- type CurrentBlockProvider
- type HardforkTrigger
- type HeartbeatV2
- func (*HeartbeatV2) Descriptor() ([]byte, []int)
- func (this *HeartbeatV2) Equal(that interface{}) bool
- func (m *HeartbeatV2) GetIdentity() string
- func (m *HeartbeatV2) GetNodeDisplayName() string
- func (m *HeartbeatV2) GetNonce() uint64
- func (m *HeartbeatV2) GetNumTrieNodesSynced() uint64
- func (m *HeartbeatV2) GetPayload() []byte
- func (m *HeartbeatV2) GetPeerSubType() uint32
- func (m *HeartbeatV2) GetPubkey() []byte
- func (m *HeartbeatV2) GetVersionNumber() string
- func (this *HeartbeatV2) GoString() string
- func (m *HeartbeatV2) Marshal() (dAtA []byte, err error)
- func (m *HeartbeatV2) MarshalTo(dAtA []byte) (int, error)
- func (m *HeartbeatV2) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HeartbeatV2) ProtoMessage()
- func (m *HeartbeatV2) Reset()
- func (m *HeartbeatV2) Size() (n int)
- func (this *HeartbeatV2) String() string
- func (m *HeartbeatV2) Unmarshal(dAtA []byte) error
- func (m *HeartbeatV2) XXX_DiscardUnknown()
- func (m *HeartbeatV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HeartbeatV2) XXX_Merge(src proto.Message)
- func (m *HeartbeatV2) XXX_Size() int
- func (m *HeartbeatV2) XXX_Unmarshal(b []byte) error
- type NodeRedundancyHandler
- type NodesCoordinator
- type P2PMessenger
- type Payload
- func (*Payload) Descriptor() ([]byte, []int)
- func (this *Payload) Equal(that interface{}) bool
- func (m *Payload) GetHardforkMessage() string
- func (m *Payload) GetTimestamp() int64
- func (this *Payload) GoString() string
- func (m *Payload) Marshal() (dAtA []byte, err error)
- func (m *Payload) MarshalTo(dAtA []byte) (int, error)
- func (m *Payload) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Payload) ProtoMessage()
- func (m *Payload) Reset()
- func (m *Payload) Size() (n int)
- func (this *Payload) String() string
- func (m *Payload) Unmarshal(dAtA []byte) error
- func (m *Payload) XXX_DiscardUnknown()
- func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Payload) XXX_Merge(src proto.Message)
- func (m *Payload) XXX_Size() int
- func (m *Payload) XXX_Unmarshal(b []byte) error
- type PeerAuthentication
- func (*PeerAuthentication) Descriptor() ([]byte, []int)
- func (this *PeerAuthentication) Equal(that interface{}) bool
- func (m *PeerAuthentication) GetPayload() []byte
- func (m *PeerAuthentication) GetPayloadSignature() []byte
- func (m *PeerAuthentication) GetPid() []byte
- func (m *PeerAuthentication) GetPubkey() []byte
- func (m *PeerAuthentication) GetSignature() []byte
- func (this *PeerAuthentication) GoString() string
- func (m *PeerAuthentication) Marshal() (dAtA []byte, err error)
- func (m *PeerAuthentication) MarshalTo(dAtA []byte) (int, error)
- func (m *PeerAuthentication) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PeerAuthentication) ProtoMessage()
- func (m *PeerAuthentication) Reset()
- func (m *PeerAuthentication) Size() (n int)
- func (this *PeerAuthentication) String() string
- func (m *PeerAuthentication) Unmarshal(dAtA []byte) error
- func (m *PeerAuthentication) XXX_DiscardUnknown()
- func (m *PeerAuthentication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerAuthentication) XXX_Merge(src proto.Message)
- func (m *PeerAuthentication) XXX_Size() int
- func (m *PeerAuthentication) XXX_Unmarshal(b []byte) error
- type PeerShardMapper
- type PeerTypeProviderHandler
- type TrieSyncStatisticsProvider
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthHeartbeat = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowHeartbeat = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupHeartbeat = fmt.Errorf("proto: unexpected end of group") )
var ErrEmptySendTopic = errors.New("empty topic for sending messages")
ErrEmptySendTopic signals that an empty topic string was provided
var ErrInvalidThreshold = errors.New("invalid threshold")
ErrInvalidThreshold signals that an invalid threshold was provided
var ErrInvalidTimeDuration = errors.New("invalid time duration")
ErrInvalidTimeDuration signals that an invalid time duration was provided
var ErrInvalidValue = errors.New("invalid value")
ErrInvalidValue signals that an invalid value has been provided
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")
ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler
var ErrNilCacher = errors.New("nil cacher")
ErrNilCacher signals that a nil cache has been provided
var ErrNilCurrentBlockProvider = errors.New("nil current block provider")
ErrNilCurrentBlockProvider signals that a nil current block provider
var ErrNilHardforkTrigger = errors.New("nil hardfork trigger")
ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided
var ErrNilHeartbeatMonitor = errors.New("nil heartbeat monitor")
ErrNilHeartbeatMonitor signals that a nil heartbeat monitor was provided
var ErrNilHeartbeatSenderInfoProvider = errors.New("nil heartbeat sender info provider")
ErrNilHeartbeatSenderInfoProvider signals that a nil heartbeat sender info provider was provided
var ErrNilMarshaller = errors.New("nil marshaller")
ErrNilMarshaller signals that a nil marshaller has been provided
var ErrNilMessenger = errors.New("nil P2P Messenger")
ErrNilMessenger signals that a nil p2p messenger has been provided
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")
ErrNilNodesCoordinator signals that an operation has been attempted to or with a nil nodes coordinator
var ErrNilPeerAuthenticationPool = errors.New("nil peer authentication pool")
ErrNilPeerAuthenticationPool signals that a nil peer authentication pool has been provided
var ErrNilPeerShardMapper = errors.New("nil peer shard mapper")
ErrNilPeerShardMapper signals that a nil peer shard mapper has been provided
var ErrNilPeerSignatureHandler = errors.New("trying to set nil peerSignatureHandler")
ErrNilPeerSignatureHandler signals that a nil peerSignatureHandler object has been provided
var ErrNilPeerTypeProvider = errors.New("nil peer type provider")
ErrNilPeerTypeProvider signals that a nil peer type provider has been given
var ErrNilPrivateKey = errors.New("nil private key")
ErrNilPrivateKey signals that a nil private key has been provided
var ErrNilPubkeyConverter = errors.New("trying to use a nil pubkey converter")
ErrNilPubkeyConverter signals that a nil public key converter has been provided
var ErrNilRandomizer = errors.New("nil randomizer")
ErrNilRandomizer signals that a nil randomizer has been provided
var ErrNilRedundancyHandler = errors.New("nil redundancy handler")
ErrNilRedundancyHandler signals that a nil redundancy handler was provided
var ErrNilRequestHandler = errors.New("nil request handler")
ErrNilRequestHandler signals that a nil request handler interface was provided
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that a nil shard coordinator was provided
var ErrNilTrieSyncStatisticsProvider = errors.New("nil trie sync statistics provider")
ErrNilTrieSyncStatisticsProvider signals that a nil trie sync statistics provider was provided
var ErrPropertyTooLong = errors.New("property too long in Heartbeat")
ErrPropertyTooLong signals that one of the properties is too long
var ErrShouldSkipValidator = errors.New("validator should be skipped")
ErrShouldSkipValidator signals that the validator should be skipped
Functions ¶
This section is empty.
Types ¶
type CurrentBlockProvider ¶
type CurrentBlockProvider interface { GetCurrentBlockHeader() data.HeaderHandler SetCurrentBlockHeaderAndRootHash(bh data.HeaderHandler, rootHash []byte) error IsInterfaceNil() bool }
CurrentBlockProvider can provide the current block that the node was able to commit
type HardforkTrigger ¶
type HardforkTrigger interface { TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error) RecordedTriggerMessage() ([]byte, bool) NotifyTriggerReceivedV2() <-chan struct{} CreateData() []byte IsInterfaceNil() bool }
HardforkTrigger defines the behavior of a hardfork trigger
type HeartbeatV2 ¶
type HeartbeatV2 struct { Payload []byte `protobuf:"bytes,1,opt,name=Payload,proto3" json:"Payload,omitempty"` VersionNumber string `protobuf:"bytes,2,opt,name=VersionNumber,proto3" json:"VersionNumber,omitempty"` NodeDisplayName string `protobuf:"bytes,3,opt,name=NodeDisplayName,proto3" json:"NodeDisplayName,omitempty"` Identity string `protobuf:"bytes,4,opt,name=Identity,proto3" json:"Identity,omitempty"` Nonce uint64 `protobuf:"varint,5,opt,name=Nonce,proto3" json:"Nonce,omitempty"` PeerSubType uint32 `protobuf:"varint,6,opt,name=PeerSubType,proto3" json:"PeerSubType,omitempty"` Pubkey []byte `protobuf:"bytes,7,opt,name=Pubkey,proto3" json:"Pubkey,omitempty"` NumTrieNodesSynced uint64 `protobuf:"varint,8,opt,name=NumTrieNodesSynced,proto3" json:"NumTrieNodesSynced,omitempty"` }
HeartbeatV2 represents the heartbeat message that is sent between peers from the same shard containing current node status
func (*HeartbeatV2) Descriptor ¶
func (*HeartbeatV2) Descriptor() ([]byte, []int)
func (*HeartbeatV2) Equal ¶
func (this *HeartbeatV2) Equal(that interface{}) bool
func (*HeartbeatV2) GetIdentity ¶
func (m *HeartbeatV2) GetIdentity() string
func (*HeartbeatV2) GetNodeDisplayName ¶
func (m *HeartbeatV2) GetNodeDisplayName() string
func (*HeartbeatV2) GetNonce ¶
func (m *HeartbeatV2) GetNonce() uint64
func (*HeartbeatV2) GetNumTrieNodesSynced ¶
func (m *HeartbeatV2) GetNumTrieNodesSynced() uint64
func (*HeartbeatV2) GetPayload ¶
func (m *HeartbeatV2) GetPayload() []byte
func (*HeartbeatV2) GetPeerSubType ¶
func (m *HeartbeatV2) GetPeerSubType() uint32
func (*HeartbeatV2) GetPubkey ¶
func (m *HeartbeatV2) GetPubkey() []byte
func (*HeartbeatV2) GetVersionNumber ¶
func (m *HeartbeatV2) GetVersionNumber() string
func (*HeartbeatV2) GoString ¶
func (this *HeartbeatV2) GoString() string
func (*HeartbeatV2) Marshal ¶
func (m *HeartbeatV2) Marshal() (dAtA []byte, err error)
func (*HeartbeatV2) MarshalToSizedBuffer ¶
func (m *HeartbeatV2) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeartbeatV2) ProtoMessage ¶
func (*HeartbeatV2) ProtoMessage()
func (*HeartbeatV2) Reset ¶
func (m *HeartbeatV2) Reset()
func (*HeartbeatV2) Size ¶
func (m *HeartbeatV2) Size() (n int)
func (*HeartbeatV2) String ¶
func (this *HeartbeatV2) String() string
func (*HeartbeatV2) Unmarshal ¶
func (m *HeartbeatV2) Unmarshal(dAtA []byte) error
func (*HeartbeatV2) XXX_DiscardUnknown ¶
func (m *HeartbeatV2) XXX_DiscardUnknown()
func (*HeartbeatV2) XXX_Marshal ¶
func (m *HeartbeatV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeartbeatV2) XXX_Merge ¶
func (m *HeartbeatV2) XXX_Merge(src proto.Message)
func (*HeartbeatV2) XXX_Size ¶
func (m *HeartbeatV2) XXX_Size() int
func (*HeartbeatV2) XXX_Unmarshal ¶
func (m *HeartbeatV2) XXX_Unmarshal(b []byte) error
type NodeRedundancyHandler ¶
type NodeRedundancyHandler interface { IsRedundancyNode() bool IsMainMachineActive() bool ObserverPrivateKey() crypto.PrivateKey IsInterfaceNil() bool }
NodeRedundancyHandler defines the interface responsible for the redundancy management of the node
type NodesCoordinator ¶
type NodesCoordinator interface { GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error) GetAllWaitingValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error) GetValidatorWithPublicKey(publicKey []byte) (validator nodesCoordinator.Validator, shardId uint32, err error) IsInterfaceNil() bool }
NodesCoordinator defines the behavior of a struct able to do validator selection
type P2PMessenger ¶
type P2PMessenger interface { Broadcast(topic string, buff []byte) ID() core.PeerID Sign(payload []byte) ([]byte, error) ConnectedPeersOnTopic(topic string) []core.PeerID IsInterfaceNil() bool }
P2PMessenger defines a subset of the p2p.Messenger interface
type Payload ¶
type Payload struct { Timestamp int64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` HardforkMessage string `protobuf:"bytes,2,opt,name=HardforkMessage,proto3" json:"HardforkMessage,omitempty"` }
Payload represents the DTO used as payload for both HeartbeatV2 and PeerAuthentication messages
func (*Payload) Descriptor ¶
func (*Payload) GetHardforkMessage ¶
func (*Payload) GetTimestamp ¶
func (*Payload) MarshalToSizedBuffer ¶
func (*Payload) ProtoMessage ¶
func (*Payload) ProtoMessage()
func (*Payload) XXX_DiscardUnknown ¶
func (m *Payload) XXX_DiscardUnknown()
func (*Payload) XXX_Marshal ¶
func (*Payload) XXX_Unmarshal ¶
type PeerAuthentication ¶
type PeerAuthentication struct { Pubkey []byte `protobuf:"bytes,1,opt,name=Pubkey,proto3" json:"Pubkey,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"` Pid []byte `protobuf:"bytes,3,opt,name=Pid,proto3" json:"Pid,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` PayloadSignature []byte `protobuf:"bytes,5,opt,name=PayloadSignature,proto3" json:"PayloadSignature,omitempty"` }
PeerAuthentication represents the DTO used to pass peer authentication information such as public key, peer id, signature, payload and the signature. This message is used to link the peerID with the associated public key
func (*PeerAuthentication) Descriptor ¶
func (*PeerAuthentication) Descriptor() ([]byte, []int)
func (*PeerAuthentication) Equal ¶
func (this *PeerAuthentication) Equal(that interface{}) bool
func (*PeerAuthentication) GetPayload ¶
func (m *PeerAuthentication) GetPayload() []byte
func (*PeerAuthentication) GetPayloadSignature ¶
func (m *PeerAuthentication) GetPayloadSignature() []byte
func (*PeerAuthentication) GetPid ¶
func (m *PeerAuthentication) GetPid() []byte
func (*PeerAuthentication) GetPubkey ¶
func (m *PeerAuthentication) GetPubkey() []byte
func (*PeerAuthentication) GetSignature ¶
func (m *PeerAuthentication) GetSignature() []byte
func (*PeerAuthentication) GoString ¶
func (this *PeerAuthentication) GoString() string
func (*PeerAuthentication) Marshal ¶
func (m *PeerAuthentication) Marshal() (dAtA []byte, err error)
func (*PeerAuthentication) MarshalTo ¶
func (m *PeerAuthentication) MarshalTo(dAtA []byte) (int, error)
func (*PeerAuthentication) MarshalToSizedBuffer ¶
func (m *PeerAuthentication) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PeerAuthentication) ProtoMessage ¶
func (*PeerAuthentication) ProtoMessage()
func (*PeerAuthentication) Reset ¶
func (m *PeerAuthentication) Reset()
func (*PeerAuthentication) Size ¶
func (m *PeerAuthentication) Size() (n int)
func (*PeerAuthentication) String ¶
func (this *PeerAuthentication) String() string
func (*PeerAuthentication) Unmarshal ¶
func (m *PeerAuthentication) Unmarshal(dAtA []byte) error
func (*PeerAuthentication) XXX_DiscardUnknown ¶
func (m *PeerAuthentication) XXX_DiscardUnknown()
func (*PeerAuthentication) XXX_Marshal ¶
func (m *PeerAuthentication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PeerAuthentication) XXX_Merge ¶
func (m *PeerAuthentication) XXX_Merge(src proto.Message)
func (*PeerAuthentication) XXX_Size ¶
func (m *PeerAuthentication) XXX_Size() int
func (*PeerAuthentication) XXX_Unmarshal ¶
func (m *PeerAuthentication) XXX_Unmarshal(b []byte) error
type PeerShardMapper ¶
type PeerShardMapper interface { PutPeerIdShardId(pid core.PeerID, shardID uint32) IsInterfaceNil() bool }
PeerShardMapper saves the shard for a peer ID
type PeerTypeProviderHandler ¶
type PeerTypeProviderHandler interface { ComputeForPubKey(pubKey []byte) (common.PeerType, uint32, error) GetAllPeerTypeInfos() []*state.PeerTypeInfo IsInterfaceNil() bool }
PeerTypeProviderHandler defines what a component which computes the type of a peer should do
type TrieSyncStatisticsProvider ¶
TrieSyncStatisticsProvider is able to provide trie sync statistics