Documentation ¶
Index ¶
- Constants
- Variables
- type DropEvent
- type Event
- func (e *Event) AddParents(parents []*Event)
- func (e *Event) AddSelfParent(selfParent *Event)
- func (e *Event) AddTransactions(txs []common.Hash)
- func (e *Event) Hash() common.Hash
- func (e *Event) Marshal() []byte
- func (e *Event) RecoverPublicKey(signer crypto.Signer) ([]byte, error)
- func (e *Event) Sign(signer crypto.Signer) error
- func (e *Event) SignVerify(publicKey []byte, signer crypto.Signer) bool
- func (e *Event) Unmarshal(data []byte)
- type EventBody
- type EventMessage
- type ICore
- type Metrics
- func (m *Metrics) AddEventIn(num uint64)
- func (m *Metrics) AddEventOut(num uint64)
- func (m *Metrics) AddEventRequest(num uint64)
- func (m *Metrics) AddParentEventIn(num uint64)
- func (m *Metrics) AddTrafficIn(traffic uint64)
- func (m *Metrics) AddTrafficOut(traffic uint64)
- func (m *Metrics) AddTxIn(num uint64)
- type Params
- type SealEvent
- type SyncRequest
- type Tetris
- func (t *Tetris) ChanEventReq() <-chan common.Hash
- func (t *Tetris) ChanEventSend() <-chan []byte
- func (t *Tetris) DebugPrint()
- func (t *Tetris) DebugPrintDetail()
- func (t *Tetris) MajorityBeatReceived() bool
- func (t *Tetris) MajorityBeatTime() (ok bool, duration time.Duration)
- func (t *Tetris) OnTxDropped(txs []common.Hash)
- func (t *Tetris) OnTxSealed(height uint64, txs []common.Hash)
- func (t *Tetris) Output() <-chan *consensus.Output
- func (t *Tetris) SendEvent(event []byte)
- func (t *Tetris) SendParentEvent(event []byte)
- func (t *Tetris) SendTx(hash common.Hash)
- func (t *Tetris) Start() error
- func (t *Tetris) Stop() error
Constants ¶
View Source
const COMMITTABLE_UNDECIDED = -1
View Source
const ROUND_UNDECIDED = -1
View Source
const (
VidStrStart = address.AddressContentIndex * 2
)
Variables ¶
View Source
var HASH0 = [common.HashLength]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Body *EventBody // contains filtered or unexported fields }
func (*Event) AddParents ¶
func (*Event) AddSelfParent ¶
func (*Event) AddTransactions ¶
func (*Event) RecoverPublicKey ¶
type EventBody ¶
type EventBody struct { H uint64 //Block Height N uint64 //Sequence Number T int64 //Timestamps, unix nano, can only represent year 1678-2262 Tx []common.Hash //Transactions List E []common.Hash //Parents Events, 0 for self parent P bool //HeartBeat Pulse }
func (*EventBody) EmptyLength ¶
func (*EventBody) MarshalLength ¶
type EventMessage ¶
func (*EventMessage) Marshal ¶
func (em *EventMessage) Marshal() []byte
func (*EventMessage) Unmarshal ¶
func (em *EventMessage) Unmarshal(data []byte) error
type Metrics ¶
type Metrics struct { TrafficIn uint64 TrafficOut uint64 EventIn uint64 ParentEventIn uint64 EventOut uint64 EventRequest uint64 TxIn uint64 // contains filtered or unexported fields }
func NewMetrics ¶
func NewMetrics() *Metrics
func (*Metrics) AddEventIn ¶
func (*Metrics) AddEventOut ¶
func (*Metrics) AddEventRequest ¶
func (*Metrics) AddParentEventIn ¶
func (*Metrics) AddTrafficIn ¶
func (*Metrics) AddTrafficOut ¶
type SyncRequest ¶
type SyncRequest struct {
// contains filtered or unexported fields
}
type Tetris ¶
type Tetris struct { //Input Channel EventCh chan []byte ParentEventCh chan []byte TxsCh chan common.Hash SealCh chan *SealEvent DropCh chan *DropEvent //Output Channel OutputCh chan *consensus.Output SendEventCh chan []byte RequestEventCh chan common.Hash //metrics or test Metrics *Metrics // contains filtered or unexported fields }
func (*Tetris) ChanEventReq ¶
func (*Tetris) ChanEventSend ¶
func (*Tetris) DebugPrintDetail ¶
func (t *Tetris) DebugPrintDetail()
func (*Tetris) MajorityBeatReceived ¶
func (*Tetris) MajorityBeatTime ¶
func (*Tetris) OnTxDropped ¶
func (*Tetris) SendParentEvent ¶
Click to show internal directories.
Click to hide internal directories.