Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAG ¶
type DAG struct {
// contains filtered or unexported fields
}
DAG manages the directed acyclic graph of events
func (*DAG) GetAllEvents ¶
GetAllEvents returns all events in the DAG
func (*DAG) VerifyEventChain ¶
VerifyEventChain verifies the integrity of an event and its ancestors
type Event ¶
type Event struct {
ID string `json:"id"`
Data []byte `json:"data"`
Parents []string `json:"parents"` // References to previous events in DAG
Timestamp time.Time `json:"timestamp"`
// Optional beacon reference
BeaconRound uint64 `json:"beacon_round,omitempty"`
BeaconHash string `json:"beacon_hash,omitempty"`
// Sub-events support
ParentEvent string `json:"parent_event,omitempty"` // ID of the parent event if this is a sub-event
SubEvents []string `json:"sub_events,omitempty"` // IDs of any sub-events
IsSubEvent bool `json:"is_sub_event,omitempty"` // Flag to distinguish sub-events
}
Event represents a node in the DAG
func NewSubEvent ¶
NewSubEvent creates a new sub-event connected to a parent event
func (*Event) AddSubEvent ¶
AddSubEvent adds a sub-event to this event
func (*Event) SetBeaconRound ¶
SetBeaconRound sets the beacon round reference for this event
Click to show internal directories.
Click to hide internal directories.