Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBlockTable ¶
func InitEventTable ¶
func InitVoteTable ¶
Types ¶
type Block ¶
type Event ¶
type Event struct { Id int64 ChallengeId uint64 `gorm:"NOT NULL;uniqueIndex:idx_challenge_id"` ObjectId string `gorm:"NOT NULL;index:idx_object_id_sp_addr"` SegmentIndex uint32 `gorm:"NOT NULL"` SpOperatorAddress string `gorm:"NOT NULL;index:idx_object_id_sp_addr"` RedundancyIndex int32 `gorm:"NOT NULL"` ChallengerAddress string `gorm:"NOT NULL"` Height uint64 `gorm:"NOT NULL;"` Status EventStatus `gorm:"NOT NULL;index:idx_status"` VerifyResult VerifyResult `gorm:"NOT NULL;index:idx_verify_result"` CreatedTime int64 `gorm:"NOT NULL"` ExpiredHeight uint64 `gorm:"NOT NULL;index:idx_expired_height"` }
type EventStatus ¶
type EventStatus int
const ( Unprocessed EventStatus = iota // Event is just stored Verified // Event has been verified, and verify result is stored in VerifyResult SelfVoted // Event has been voted locally EnoughVotesCollected // Event has been voted for more than 2/3 validators Submitted SelfAttested Attested // Event has been submitted for tx Duplicated DuplicatedSlash )
type VerifyResult ¶
type VerifyResult int
const ( Unknown VerifyResult = iota // Event not been verified HashMatched // The challenge failed, hashes are matched HashMismatched // The challenge succeed, hashed are not matched )
type Vote ¶
type Vote struct { Id int64 ChallengeId uint64 `gorm:"NOT NULL;index:idx_challenge_id"` PubKey string `gorm:"NOT NULL;uniqueIndex:idx_pubkey_eventhash;size:96"` Signature string `gorm:"NOT NULL;size:192"` EventType uint32 `gorm:"NOT NULL"` EventHash string `gorm:"NOT NULL;uniqueIndex:idx_pubkey_eventhash;size:64"` CreatedTime int64 `gorm:"NOT NULL"` }
Click to show internal directories.
Click to hide internal directories.