Documentation ¶
Index ¶
- Variables
- func VerifyHeartbeatProperyLen(property string, value []byte) error
- type ArgHeartbeatMonitor
- type ArgHeartbeatSender
- type BlackListHandler
- type DbTimeStamp
- func (*DbTimeStamp) Descriptor() ([]byte, []int)
- func (this *DbTimeStamp) Equal(that interface{}) bool
- func (m *DbTimeStamp) GetTimestamp() int64
- func (this *DbTimeStamp) GoString() string
- func (m *DbTimeStamp) Marshal() (dAtA []byte, err error)
- func (m *DbTimeStamp) MarshalTo(dAtA []byte) (int, error)
- func (m *DbTimeStamp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DbTimeStamp) ProtoMessage()
- func (m *DbTimeStamp) Reset()
- func (m *DbTimeStamp) Size() (n int)
- func (this *DbTimeStamp) String() string
- func (m *DbTimeStamp) Unmarshal(dAtA []byte) error
- func (m *DbTimeStamp) XXX_DiscardUnknown()
- func (m *DbTimeStamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DbTimeStamp) XXX_Merge(src proto.Message)
- func (m *DbTimeStamp) XXX_Size() int
- func (m *DbTimeStamp) XXX_Unmarshal(b []byte) error
- type Duration
- type EligibleListProvider
- type HardforkTrigger
- type Heartbeat
- func (*Heartbeat) Descriptor() ([]byte, []int)
- func (this *Heartbeat) Equal(that interface{}) bool
- func (m *Heartbeat) GetNodeDisplayName() string
- func (m *Heartbeat) GetPayload() []byte
- func (m *Heartbeat) GetPid() []byte
- func (m *Heartbeat) GetPubkey() []byte
- func (m *Heartbeat) GetShardID() uint32
- func (m *Heartbeat) GetSignature() []byte
- func (m *Heartbeat) GetVersionNumber() string
- func (this *Heartbeat) GoString() string
- func (m *Heartbeat) Marshal() (dAtA []byte, err error)
- func (m *Heartbeat) MarshalTo(dAtA []byte) (int, error)
- func (m *Heartbeat) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Heartbeat) ProtoMessage()
- func (m *Heartbeat) Reset()
- func (m *Heartbeat) Size() (n int)
- func (this *Heartbeat) String() string
- func (m *Heartbeat) Unmarshal(dAtA []byte) error
- func (m *Heartbeat) XXX_DiscardUnknown()
- func (m *Heartbeat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Heartbeat) XXX_Merge(src proto.Message)
- func (m *Heartbeat) XXX_Size() int
- func (m *Heartbeat) XXX_Unmarshal(b []byte) error
- type HeartbeatDTO
- func (*HeartbeatDTO) Descriptor() ([]byte, []int)
- func (this *HeartbeatDTO) Equal(that interface{}) bool
- func (m *HeartbeatDTO) GetComputedShardID() uint32
- func (m *HeartbeatDTO) GetGenesisTime() int64
- func (m *HeartbeatDTO) GetIsActive() bool
- func (m *HeartbeatDTO) GetIsValidator() bool
- func (m *HeartbeatDTO) GetLastUptimeDowntime() int64
- func (m *HeartbeatDTO) GetMaxDurationPeerUnresponsive() int64
- func (m *HeartbeatDTO) GetMaxInactiveTime() int64
- func (m *HeartbeatDTO) GetNodeDisplayName() string
- func (m *HeartbeatDTO) GetPeerType() string
- func (m *HeartbeatDTO) GetReceivedShardID() uint32
- func (m *HeartbeatDTO) GetTimeStamp() int64
- func (m *HeartbeatDTO) GetTotalDownTime() int64
- func (m *HeartbeatDTO) GetTotalUpTime() int64
- func (m *HeartbeatDTO) GetVersionNumber() string
- func (this *HeartbeatDTO) GoString() string
- func (m *HeartbeatDTO) Marshal() (dAtA []byte, err error)
- func (m *HeartbeatDTO) MarshalTo(dAtA []byte) (int, error)
- func (m *HeartbeatDTO) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HeartbeatDTO) ProtoMessage()
- func (m *HeartbeatDTO) Reset()
- func (m *HeartbeatDTO) Size() (n int)
- func (this *HeartbeatDTO) String() string
- func (m *HeartbeatDTO) Unmarshal(dAtA []byte) error
- func (m *HeartbeatDTO) XXX_DiscardUnknown()
- func (m *HeartbeatDTO) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HeartbeatDTO) XXX_Merge(src proto.Message)
- func (m *HeartbeatDTO) XXX_Size() int
- func (m *HeartbeatDTO) XXX_Unmarshal(b []byte) error
- type HeartbeatStorageHandler
- type MessageHandler
- type MessageProcessor
- type Monitor
- func (m *Monitor) GetHeartbeats() []PubKeyHeartbeat
- func (m *Monitor) IsInterfaceNil() bool
- func (m *Monitor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer p2p.PeerID) error
- func (m *Monitor) SaveMultipleHeartbeatMessageInfos(pubKeysToSave map[string]*heartbeatMessageInfo)
- func (m *Monitor) SetAppStatusHandler(ash core.AppStatusHandler) error
- type NetworkShardingCollector
- type P2PAntifloodHandler
- type PeerMessenger
- type PeerTypeProviderHandler
- type PubKeyHeartbeat
- type RealTimer
- type Sender
- type Timer
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 ErrEmptyPublicKeysMap = errors.New("nil or empty public keys map")
ErrEmptyPublicKeysMap signals that a nil or empty public keys map has been provided
var ErrFetchGenesisTimeFromDb = errors.New("monitor: can't get genesis time from db")
ErrFetchGenesisTimeFromDb signals that the genesis time cannot be fetched from db
var ErrHeartbeatPidMismatch = errors.New("heartbeat peer id mismatch")
ErrHeartbeatPidMismatch signals that a received hearbeat did not come from the correct originator
var ErrInvalidMaxDurationPeerUnresponsive = errors.New("invalid max duration to declare the peer unresponsive")
ErrInvalidMaxDurationPeerUnresponsive signals that the duration provided is invalid
var ErrMarshalGenesisTime = errors.New("monitor: can't marshal genesis time")
ErrMarshalGenesisTime signals that the marshaling of the genesis time didn't work
var ErrNilAntifloodHandler = errors.New("nil antiflood handler")
ErrNilAntifloodHandler signals that a nil antiflood handler has been provided
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")
ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler
var ErrNilBlackListHandler = errors.New("nil black list handler")
ErrNilBlackListHandler signals that a nil black list handler was provided
var ErrNilDataToProcess = errors.New("nil data to process")
ErrNilDataToProcess signals that nil data was provided
var ErrNilHardforkTrigger = errors.New("nil hardfork trigger")
ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided
var ErrNilHeartbeatStorer = errors.New("nil heartbeat storer")
ErrNilHeartbeatStorer signals that the provided heartbeat storer is nil
var ErrNilKeyGenerator = errors.New("key generator is nil")
ErrNilKeyGenerator is raised when a valid key generator is expected but nil used
var ErrNilMarshalizer = errors.New("nil marshalizer")
ErrNilMarshalizer signals that a nil marshalizer has been provided
var ErrNilMessage = errors.New("nil message")
ErrNilMessage signals that a nil message has been received
var ErrNilMessageHandler = errors.New("nil message handler")
ErrNilMessageHandler signals that the provided message handler is nil
var ErrNilMessenger = errors.New("nil P2P Messenger")
ErrNilMessenger signals that a nil p2p messenger has been provided
var ErrNilMonitorDb = errors.New("nil monitor db")
ErrNilMonitorDb signals that a nil monitor db was provided
var ErrNilNetworkShardingCollector = errors.New("nil network sharding collector")
ErrNilNetworkShardingCollector defines the error for setting a nil network sharding collector
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 ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilSingleSigner = errors.New("nil single signer")
ErrNilSingleSigner signals that a nil single signer has been provided
var ErrNilTimer = errors.New("nil time getter handler")
ErrNilTimer signals that a nil time getter handler has been provided
var ErrPropertyTooLong = errors.New("property too long in Heartbeat")
ErrPropertyTooLong signals that one of the properties is too long
var ErrStoreGenesisTimeToDb = errors.New("monitor: can't store genesis time")
ErrStoreGenesisTimeToDb signals that the genesis time cannot be store to db
var ErrUnmarshalGenesisTime = errors.New("monitor: can't unmarshal genesis time")
ErrUnmarshalGenesisTime signals that the unmarshaling of the genesis time didn't work
Functions ¶
func VerifyHeartbeatProperyLen ¶ added in v1.0.106
VerifyHeartbeatProperyLen returns an error if the provided value is longer than accepted by the network
Types ¶
type ArgHeartbeatMonitor ¶ added in v1.0.102
type ArgHeartbeatMonitor struct { Marshalizer marshal.Marshalizer MaxDurationPeerUnresponsive time.Duration PubKeysMap map[uint32][]string GenesisTime time.Time MessageHandler MessageHandler Storer HeartbeatStorageHandler PeerTypeProvider PeerTypeProviderHandler Timer Timer AntifloodHandler P2PAntifloodHandler HardforkTrigger HardforkTrigger PeerBlackListHandler BlackListHandler ValidatorPubkeyConverter state.PubkeyConverter }
ArgHeartbeatMonitor represents the arguments for the heartbeat monitor
type ArgHeartbeatSender ¶ added in v1.0.102
type ArgHeartbeatSender struct { PeerMessenger PeerMessenger SingleSigner crypto.SingleSigner PrivKey crypto.PrivateKey Marshalizer marshal.Marshalizer Topic string ShardCoordinator sharding.Coordinator PeerTypeProvider PeerTypeProviderHandler StatusHandler core.AppStatusHandler VersionNumber string NodeDisplayName string HardforkTrigger HardforkTrigger }
ArgHeartbeatSender represents the arguments for the heartbeat sender
type BlackListHandler ¶ added in v1.0.102
type BlackListHandler interface { Add(key string) error Has(key string) bool Sweep() IsInterfaceNil() bool }
BlackListHandler can determine if a certain key is or not blacklisted
type DbTimeStamp ¶
type DbTimeStamp struct {
Timestamp int64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
}
func (*DbTimeStamp) Descriptor ¶
func (*DbTimeStamp) Descriptor() ([]byte, []int)
func (*DbTimeStamp) Equal ¶
func (this *DbTimeStamp) Equal(that interface{}) bool
func (*DbTimeStamp) GetTimestamp ¶
func (m *DbTimeStamp) GetTimestamp() int64
func (*DbTimeStamp) GoString ¶
func (this *DbTimeStamp) GoString() string
func (*DbTimeStamp) Marshal ¶
func (m *DbTimeStamp) Marshal() (dAtA []byte, err error)
func (*DbTimeStamp) MarshalToSizedBuffer ¶
func (m *DbTimeStamp) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DbTimeStamp) ProtoMessage ¶
func (*DbTimeStamp) ProtoMessage()
func (*DbTimeStamp) Reset ¶
func (m *DbTimeStamp) Reset()
func (*DbTimeStamp) Size ¶
func (m *DbTimeStamp) Size() (n int)
func (*DbTimeStamp) String ¶
func (this *DbTimeStamp) String() string
func (*DbTimeStamp) Unmarshal ¶
func (m *DbTimeStamp) Unmarshal(dAtA []byte) error
func (*DbTimeStamp) XXX_DiscardUnknown ¶
func (m *DbTimeStamp) XXX_DiscardUnknown()
func (*DbTimeStamp) XXX_Marshal ¶
func (m *DbTimeStamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DbTimeStamp) XXX_Merge ¶
func (m *DbTimeStamp) XXX_Merge(src proto.Message)
func (*DbTimeStamp) XXX_Size ¶
func (m *DbTimeStamp) XXX_Size() int
func (*DbTimeStamp) XXX_Unmarshal ¶
func (m *DbTimeStamp) XXX_Unmarshal(b []byte) error
type Duration ¶
Duration is a wrapper of the original Duration struct that has JSON marshal and unmarshal capabilities golang issue: https://github.com/golang/go/issues/10275
func (Duration) MarshalJSON ¶
MarshalJSON is called when a json marshal is triggered on this field
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON is called when a json unmarshal is triggered on this field
type EligibleListProvider ¶ added in v1.0.102
type EligibleListProvider interface { GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error) GetAllWaitingValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error) IsInterfaceNil() bool }
EligibleListProvider defines what an eligible list provider should do
type HardforkTrigger ¶ added in v1.0.102
type HardforkTrigger interface { TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error) RecordedTriggerMessage() ([]byte, bool) CreateData() []byte IsInterfaceNil() bool }
HardforkTrigger defines the behavior of a hardfork trigger
type Heartbeat ¶
type Heartbeat struct { Payload []byte `protobuf:"bytes,1,opt,name=Payload,proto3" json:"Payload,omitempty"` Pubkey []byte `protobuf:"bytes,2,opt,name=Pubkey,proto3" json:"Pubkey,omitempty"` Signature []byte `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"` ShardID uint32 `protobuf:"varint,4,opt,name=ShardID,proto3" json:"ShardID,omitempty"` VersionNumber string `protobuf:"bytes,5,opt,name=VersionNumber,proto3" json:"VersionNumber,omitempty"` NodeDisplayName string `protobuf:"bytes,6,opt,name=NodeDisplayName,proto3" json:"NodeDisplayName,omitempty"` Pid []byte `protobuf:"bytes,7,opt,name=Pid,proto3" json:"Pid,omitempty"` }
Heartbeat represents the heartbeat message that is sent between peers
func (*Heartbeat) Descriptor ¶
func (*Heartbeat) GetNodeDisplayName ¶
func (*Heartbeat) GetPayload ¶
func (*Heartbeat) GetShardID ¶
func (*Heartbeat) GetSignature ¶
func (*Heartbeat) GetVersionNumber ¶
func (*Heartbeat) MarshalToSizedBuffer ¶
func (*Heartbeat) ProtoMessage ¶
func (*Heartbeat) ProtoMessage()
func (*Heartbeat) XXX_DiscardUnknown ¶
func (m *Heartbeat) XXX_DiscardUnknown()
func (*Heartbeat) XXX_Marshal ¶
func (*Heartbeat) XXX_Unmarshal ¶
type HeartbeatDTO ¶
type HeartbeatDTO struct { MaxDurationPeerUnresponsive int64 `protobuf:"varint,1,opt,name=MaxDurationPeerUnresponsive,proto3" json:"MaxDurationPeerUnresponsive,omitempty"` MaxInactiveTime int64 `protobuf:"varint,2,opt,name=MaxInactiveTime,proto3" json:"MaxInactiveTime,omitempty"` TotalUpTime int64 `protobuf:"varint,3,opt,name=TotalUpTime,proto3" json:"TotalUpTime,omitempty"` TotalDownTime int64 `protobuf:"varint,4,opt,name=TotalDownTime,proto3" json:"TotalDownTime,omitempty"` TimeStamp int64 `protobuf:"varint,5,opt,name=TimeStamp,proto3" json:"TimeStamp,omitempty"` IsActive bool `protobuf:"varint,6,opt,name=IsActive,proto3" json:"IsActive,omitempty"` ReceivedShardID uint32 `protobuf:"varint,7,opt,name=ReceivedShardID,proto3" json:"ReceivedShardID,omitempty"` ComputedShardID uint32 `protobuf:"varint,8,opt,name=ComputedShardID,proto3" json:"ComputedShardID,omitempty"` VersionNumber string `protobuf:"bytes,9,opt,name=VersionNumber,proto3" json:"VersionNumber,omitempty"` NodeDisplayName string `protobuf:"bytes,10,opt,name=NodeDisplayName,proto3" json:"NodeDisplayName,omitempty"` PeerType string `protobuf:"bytes,11,opt,name=PeerType,proto3" json:"PeerType,omitempty"` IsValidator bool `protobuf:"varint,12,opt,name=IsValidator,proto3" json:"IsValidator,omitempty"` LastUptimeDowntime int64 `protobuf:"varint,13,opt,name=LastUptimeDowntime,proto3" json:"LastUptimeDowntime,omitempty"` GenesisTime int64 `protobuf:"varint,14,opt,name=GenesisTime,proto3" json:"GenesisTime,omitempty"` }
HeartbeatDTO is the struct used for handling DB operations for heartbeatMessageInfo struct
func (*HeartbeatDTO) Descriptor ¶
func (*HeartbeatDTO) Descriptor() ([]byte, []int)
func (*HeartbeatDTO) Equal ¶
func (this *HeartbeatDTO) Equal(that interface{}) bool
func (*HeartbeatDTO) GetComputedShardID ¶
func (m *HeartbeatDTO) GetComputedShardID() uint32
func (*HeartbeatDTO) GetGenesisTime ¶
func (m *HeartbeatDTO) GetGenesisTime() int64
func (*HeartbeatDTO) GetIsActive ¶
func (m *HeartbeatDTO) GetIsActive() bool
func (*HeartbeatDTO) GetIsValidator ¶ added in v1.0.93
func (m *HeartbeatDTO) GetIsValidator() bool
func (*HeartbeatDTO) GetLastUptimeDowntime ¶
func (m *HeartbeatDTO) GetLastUptimeDowntime() int64
func (*HeartbeatDTO) GetMaxDurationPeerUnresponsive ¶
func (m *HeartbeatDTO) GetMaxDurationPeerUnresponsive() int64
func (*HeartbeatDTO) GetMaxInactiveTime ¶
func (m *HeartbeatDTO) GetMaxInactiveTime() int64
func (*HeartbeatDTO) GetNodeDisplayName ¶
func (m *HeartbeatDTO) GetNodeDisplayName() string
func (*HeartbeatDTO) GetPeerType ¶
func (m *HeartbeatDTO) GetPeerType() string
func (*HeartbeatDTO) GetReceivedShardID ¶
func (m *HeartbeatDTO) GetReceivedShardID() uint32
func (*HeartbeatDTO) GetTimeStamp ¶
func (m *HeartbeatDTO) GetTimeStamp() int64
func (*HeartbeatDTO) GetTotalDownTime ¶
func (m *HeartbeatDTO) GetTotalDownTime() int64
func (*HeartbeatDTO) GetTotalUpTime ¶
func (m *HeartbeatDTO) GetTotalUpTime() int64
func (*HeartbeatDTO) GetVersionNumber ¶
func (m *HeartbeatDTO) GetVersionNumber() string
func (*HeartbeatDTO) GoString ¶
func (this *HeartbeatDTO) GoString() string
func (*HeartbeatDTO) Marshal ¶
func (m *HeartbeatDTO) Marshal() (dAtA []byte, err error)
func (*HeartbeatDTO) MarshalToSizedBuffer ¶
func (m *HeartbeatDTO) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeartbeatDTO) ProtoMessage ¶
func (*HeartbeatDTO) ProtoMessage()
func (*HeartbeatDTO) Reset ¶
func (m *HeartbeatDTO) Reset()
func (*HeartbeatDTO) Size ¶
func (m *HeartbeatDTO) Size() (n int)
func (*HeartbeatDTO) String ¶
func (this *HeartbeatDTO) String() string
func (*HeartbeatDTO) Unmarshal ¶
func (m *HeartbeatDTO) Unmarshal(dAtA []byte) error
func (*HeartbeatDTO) XXX_DiscardUnknown ¶
func (m *HeartbeatDTO) XXX_DiscardUnknown()
func (*HeartbeatDTO) XXX_Marshal ¶
func (m *HeartbeatDTO) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeartbeatDTO) XXX_Merge ¶
func (m *HeartbeatDTO) XXX_Merge(src proto.Message)
func (*HeartbeatDTO) XXX_Size ¶
func (m *HeartbeatDTO) XXX_Size() int
func (*HeartbeatDTO) XXX_Unmarshal ¶
func (m *HeartbeatDTO) XXX_Unmarshal(b []byte) error
type HeartbeatStorageHandler ¶
type HeartbeatStorageHandler interface { LoadGenesisTime() (time.Time, error) UpdateGenesisTime(genesisTime time.Time) error LoadHbmiDTO(pubKey string) (*HeartbeatDTO, error) SavePubkeyData(pubkey []byte, heartbeat *HeartbeatDTO) error LoadKeys() ([][]byte, error) SaveKeys(peersSlice [][]byte) error IsInterfaceNil() bool }
HeartbeatStorageHandler defines what a heartbeat's storer should do
type MessageHandler ¶
type MessageHandler interface { CreateHeartbeatFromP2PMessage(message p2p.MessageP2P) (*Heartbeat, error) IsInterfaceNil() bool }
MessageHandler defines what a message processor for heartbeat should do
type MessageProcessor ¶
type MessageProcessor struct {
// contains filtered or unexported fields
}
MessageProcessor is the struct that will handle heartbeat message verifications and conversion between heartbeatMessageInfo and HeartbeatDTO
func NewMessageProcessor ¶
func NewMessageProcessor( singleSigner crypto.SingleSigner, keygen crypto.KeyGenerator, marshalizer marshal.Marshalizer, networkShardingCollector NetworkShardingCollector, ) (*MessageProcessor, error)
NewMessageProcessor will return a new instance of MessageProcessor
func (*MessageProcessor) CreateHeartbeatFromP2PMessage ¶
func (mp *MessageProcessor) CreateHeartbeatFromP2PMessage(message p2p.MessageP2P) (*Heartbeat, error)
CreateHeartbeatFromP2PMessage will return a heartbeat if all the checks pass
func (*MessageProcessor) IsInterfaceNil ¶
func (mp *MessageProcessor) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor represents the heartbeat component that processes received heartbeat messages
func NewMonitor ¶
func NewMonitor(arg ArgHeartbeatMonitor) (*Monitor, error)
NewMonitor returns a new monitor instance
func (*Monitor) GetHeartbeats ¶
func (m *Monitor) GetHeartbeats() []PubKeyHeartbeat
GetHeartbeats returns the heartbeat status
func (*Monitor) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Monitor) ProcessReceivedMessage ¶
func (m *Monitor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer p2p.PeerID) error
ProcessReceivedMessage satisfies the p2p.MessageProcessor interface so it can be called by the p2p subsystem each time a new heartbeat message arrives
func (*Monitor) SaveMultipleHeartbeatMessageInfos ¶
SaveMultipleHeartbeatMessageInfos stores all heartbeatMessageInfos to the storer
func (*Monitor) SetAppStatusHandler ¶
func (m *Monitor) SetAppStatusHandler(ash core.AppStatusHandler) error
SetAppStatusHandler will set the AppStatusHandler which will be used for monitoring
type NetworkShardingCollector ¶
type NetworkShardingCollector interface { UpdatePeerIdPublicKey(pid p2p.PeerID, pk []byte) UpdatePublicKeyShardId(pk []byte, shardId uint32) UpdatePeerIdShardId(pid p2p.PeerID, shardId uint32) IsInterfaceNil() bool }
NetworkShardingCollector defines the updating methods used by the network sharding component The interface assures that the collected data will be used by the p2p network sharding components
type P2PAntifloodHandler ¶
type P2PAntifloodHandler interface { CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer p2p.PeerID) error CanProcessMessagesOnTopic(peer p2p.PeerID, topic string, numMessages uint32) error IsInterfaceNil() bool }
P2PAntifloodHandler defines the behavior of a component able to signal that the system is too busy (or flooded) processing p2p messages
type PeerMessenger ¶
type PeerMessenger interface { Broadcast(topic string, buff []byte) ID() p2p.PeerID IsInterfaceNil() bool }
PeerMessenger defines a subset of the p2p.Messenger interface
type PeerTypeProviderHandler ¶
type PeerTypeProviderHandler interface { ComputeForPubKey(pubKey []byte) (core.PeerType, uint32, error) IsInterfaceNil() bool }
PeerTypeProviderHandler defines what a component which computes the type of a peer should do
type PubKeyHeartbeat ¶
type PubKeyHeartbeat struct { PublicKey string `json:"publicKey"` TimeStamp time.Time `json:"timeStamp"` MaxInactiveTime Duration `json:"maxInactiveTime"` IsActive bool `json:"isActive"` ReceivedShardID uint32 `json:"receivedShardID"` ComputedShardID uint32 `json:"computedShardID"` TotalUpTime int64 `json:"totalUpTimeSec"` TotalDownTime int64 `json:"totalDownTimeSec"` VersionNumber string `json:"versionNumber"` NodeDisplayName string `json:"nodeDisplayName"` PeerType string `json:"peerType"` }
PubKeyHeartbeat returns the heartbeat status for a public key
type RealTimer ¶
type RealTimer struct { }
RealTimer is an implementation of Timer and uses real time.now
func (*RealTimer) IsInterfaceNil ¶
IsInterfaceNil verifies if the interface is nil
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender periodically sends heartbeat messages on a pubsub topic
func NewSender ¶
func NewSender(arg ArgHeartbeatSender) (*Sender, error)
NewSender will create a new sender instance
func (*Sender) SendHeartbeat ¶
SendHeartbeat broadcasts a new heartbeat message