Documentation ¶
Index ¶
- func GetBlockBucketName(blockHeaderHash common.Hash) []byte
- func GetBlockMetaDataKey(headerHash common.Hash) []byte
- func GetBlockReceiptsKey(headerHash common.Hash, blockNumber uint64, isProtocolTxReceipt bool) []byte
- func GetDataByBucket(db *db.DB, key []byte, headerHash common.Hash, finalizedHeaderHash common.Hash) ([]byte, error)
- func GetEpochBlockHashesKey(epoch uint64) []byte
- func GetEpochMetaDataKey(epoch uint64, prevSlotLastBlockHeaderHash common.Hash) []byte
- func GetMainChainMetaDataKey() []byte
- func GetProtocolTransactionMetaDataKey(txHash common.Hash) []byte
- func GetSlaveMetaDataKey(address []byte, slavePK []byte) []byte
- func GetTransactionMetaDataKey(txHash common.Hash) []byte
- type BlockMetaData
- func (bm *BlockMetaData) AddChildHeaderHash(headerHash common.Hash)
- func (bm *BlockMetaData) ChildHeaderHashes() [][]byte
- func (bm *BlockMetaData) Commit(b *bbolt.Bucket) error
- func (bm *BlockMetaData) DeSerialize(data []byte) error
- func (bm *BlockMetaData) Epoch() uint64
- func (bm *BlockMetaData) FinalizedChildHeaderHash() []byte
- func (bm *BlockMetaData) HeaderHash() common.Hash
- func (bm *BlockMetaData) ParentHeaderHash() common.Hash
- func (bm *BlockMetaData) Serialize() ([]byte, error)
- func (bm *BlockMetaData) SlotNumber() uint64
- func (bm *BlockMetaData) TotalStakeAmount() []byte
- func (bm *BlockMetaData) TrieRoot() common.Hash
- func (bm *BlockMetaData) UpdateFinalizedChildHeaderHash(finalizedChildHeaderHash common.Hash)
- type BlockReceipts
- type EpochBlockHashes
- func (e *EpochBlockHashes) AddHeaderHashBySlotNumber(headerHash common.Hash, slotNumber uint64) error
- func (e *EpochBlockHashes) BlockHashesBySlotNumber() []*protos.BlockHashesBySlotNumber
- func (e *EpochBlockHashes) Commit(b *bbolt.Bucket) error
- func (e *EpochBlockHashes) DeSerialize(data []byte) error
- func (e *EpochBlockHashes) Epoch() uint64
- func (e *EpochBlockHashes) PBData() *protos.EpochBlockHashesMetaData
- func (e *EpochBlockHashes) Serialize() ([]byte, error)
- type EpochMetaData
- func (e *EpochMetaData) AddTotalStakeAmountFound(amount uint64)
- func (e *EpochMetaData) AddValidators(dilithiumPK []byte)
- func (e *EpochMetaData) AllotSlots(randomSeed int64, epoch uint64, prevSlotLastBlockHeaderHash common.Hash)
- func (e *EpochMetaData) Commit(b *bbolt.Bucket) error
- func (e *EpochMetaData) DeSerialize(data []byte) error
- func (e *EpochMetaData) Epoch() uint64
- func (e *EpochMetaData) PBData() *protos.EpochMetaData
- func (e *EpochMetaData) PrevSlotLastBlockHeaderHash() common.Hash
- func (e *EpochMetaData) RemoveValidators(dilithiumPK []byte)
- func (e *EpochMetaData) Serialize() ([]byte, error)
- func (e *EpochMetaData) SlotInfo() []*protos.SlotInfo
- func (e *EpochMetaData) TotalStakeAmountAlloted() uint64
- func (e *EpochMetaData) TotalStakeAmountFound() uint64
- func (e *EpochMetaData) UpdatePrevEpochStakeData(totalStakeAmountFound uint64, totalStakeAmountAlloted uint64)
- func (e *EpochMetaData) Validators() [][]byte
- type MainChainMetaData
- func (m *MainChainMetaData) Commit(b *bbolt.Bucket) error
- func (m *MainChainMetaData) DeSerialize(data []byte) error
- func (m *MainChainMetaData) FinalizedBlockHeaderHash() common.Hash
- func (m *MainChainMetaData) FinalizedBlockSlotNumber() uint64
- func (m *MainChainMetaData) LastBlockHeaderHash() common.Hash
- func (m *MainChainMetaData) LastBlockSlotNumber() uint64
- func (m *MainChainMetaData) Serialize() ([]byte, error)
- func (m *MainChainMetaData) UpdateFinalizedBlockData(finalizedBlockHeaderHash common.Hash, finalizedBlockSlotNumber uint64)
- func (m *MainChainMetaData) UpdateLastBlockData(lastBlockHeaderHash common.Hash, lastBlockSlotNumber uint64)
- type PeerData
- func (p *PeerData) AddConnectedPeers(multiAddr string) error
- func (p *PeerData) AddDisconnectedPeers(multiAddr string) error
- func (p *PeerData) ConnectedPeers() []*PeerInfo
- func (p *PeerData) DisconnectedPeers() []*PeerInfo
- func (p *PeerData) IsPeerInList(multiAddr string) bool
- func (p *PeerData) Load() error
- func (p *PeerData) PeerList() []string
- func (p *PeerData) RemovePeer(multiAddr string) error
- func (p *PeerData) Save() error
- type PeerInfo
- type ProtocolTransactionMetaData
- func (t *ProtocolTransactionMetaData) BlockHash() common.Hash
- func (t *ProtocolTransactionMetaData) BlockNumber() uint64
- func (t *ProtocolTransactionMetaData) Commit(b *bbolt.Bucket) error
- func (t *ProtocolTransactionMetaData) DeSerialize(data []byte) error
- func (t *ProtocolTransactionMetaData) Index() uint64
- func (t *ProtocolTransactionMetaData) Serialize() ([]byte, error)
- func (t *ProtocolTransactionMetaData) Transaction() *protos.ProtocolTransaction
- type SlaveMetaData
- type SlotValidatorsMetaData
- func (s *SlotValidatorsMetaData) GetSlotLeaderPK() []byte
- func (s *SlotValidatorsMetaData) GetValidatorType(dilithiumPK []byte) (uint8, bool)
- func (s *SlotValidatorsMetaData) GetValidatorsType() map[string]uint8
- func (s *SlotValidatorsMetaData) IsAttestor(dilithiumPK string) bool
- func (s *SlotValidatorsMetaData) IsSlotLeader(dilithiumPK string) bool
- type TransactionMetaData
- func (t *TransactionMetaData) BlockHash() common.Hash
- func (t *TransactionMetaData) BlockNumber() uint64
- func (t *TransactionMetaData) Commit(b *bbolt.Bucket) error
- func (t *TransactionMetaData) DeSerialize(data []byte) error
- func (t *TransactionMetaData) Index() uint64
- func (t *TransactionMetaData) Serialize() ([]byte, error)
- func (t *TransactionMetaData) Transaction() *protos.Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockBucketName ¶
func GetBlockMetaDataKey ¶
func GetBlockReceiptsKey ¶
func GetDataByBucket ¶
func GetEpochBlockHashesKey ¶
func GetEpochMetaDataKey ¶
func GetMainChainMetaDataKey ¶
func GetMainChainMetaDataKey() []byte
func GetSlaveMetaDataKey ¶
Types ¶
type BlockMetaData ¶
type BlockMetaData struct {
// contains filtered or unexported fields
}
func GetBlockMetaData ¶
func NewBlockMetaData ¶
func (*BlockMetaData) AddChildHeaderHash ¶
func (bm *BlockMetaData) AddChildHeaderHash(headerHash common.Hash)
func (*BlockMetaData) ChildHeaderHashes ¶
func (bm *BlockMetaData) ChildHeaderHashes() [][]byte
func (*BlockMetaData) DeSerialize ¶
func (bm *BlockMetaData) DeSerialize(data []byte) error
func (*BlockMetaData) Epoch ¶
func (bm *BlockMetaData) Epoch() uint64
func (*BlockMetaData) FinalizedChildHeaderHash ¶
func (bm *BlockMetaData) FinalizedChildHeaderHash() []byte
func (*BlockMetaData) HeaderHash ¶
func (bm *BlockMetaData) HeaderHash() common.Hash
func (*BlockMetaData) ParentHeaderHash ¶
func (bm *BlockMetaData) ParentHeaderHash() common.Hash
func (*BlockMetaData) Serialize ¶
func (bm *BlockMetaData) Serialize() ([]byte, error)
func (*BlockMetaData) SlotNumber ¶
func (bm *BlockMetaData) SlotNumber() uint64
func (*BlockMetaData) TotalStakeAmount ¶
func (bm *BlockMetaData) TotalStakeAmount() []byte
func (*BlockMetaData) TrieRoot ¶
func (bm *BlockMetaData) TrieRoot() common.Hash
func (*BlockMetaData) UpdateFinalizedChildHeaderHash ¶
func (bm *BlockMetaData) UpdateFinalizedChildHeaderHash(finalizedChildHeaderHash common.Hash)
type BlockReceipts ¶
type BlockReceipts struct {
// contains filtered or unexported fields
}
func GetBlockReceipts ¶
func NewBlockReceipts ¶
func NewBlockReceipts(receipts []byte) *BlockReceipts
func (*BlockReceipts) DeSerialize ¶
func (b *BlockReceipts) DeSerialize(data []byte) error
func (*BlockReceipts) Receipts ¶
func (b *BlockReceipts) Receipts() []byte
func (*BlockReceipts) Serialize ¶
func (b *BlockReceipts) Serialize() ([]byte, error)
type EpochBlockHashes ¶
type EpochBlockHashes struct {
// contains filtered or unexported fields
}
func GetEpochBlockHashes ¶
func GetEpochBlockHashes(d *db.DB, epoch uint64) (*EpochBlockHashes, error)
func NewEpochBlockHashes ¶
func NewEpochBlockHashes(epoch uint64) *EpochBlockHashes
func (*EpochBlockHashes) AddHeaderHashBySlotNumber ¶
func (e *EpochBlockHashes) AddHeaderHashBySlotNumber(headerHash common.Hash, slotNumber uint64) error
func (*EpochBlockHashes) BlockHashesBySlotNumber ¶
func (e *EpochBlockHashes) BlockHashesBySlotNumber() []*protos.BlockHashesBySlotNumber
func (*EpochBlockHashes) DeSerialize ¶
func (e *EpochBlockHashes) DeSerialize(data []byte) error
func (*EpochBlockHashes) Epoch ¶
func (e *EpochBlockHashes) Epoch() uint64
func (*EpochBlockHashes) PBData ¶
func (e *EpochBlockHashes) PBData() *protos.EpochBlockHashesMetaData
func (*EpochBlockHashes) Serialize ¶
func (e *EpochBlockHashes) Serialize() ([]byte, error)
type EpochMetaData ¶
type EpochMetaData struct {
// contains filtered or unexported fields
}
func GetEpochMetaData ¶
func NewEpochMetaData ¶
func NewEpochMetaData(epoch uint64, prevSlotLastBlockHeaderHash common.Hash, validators [][]byte) *EpochMetaData
func (*EpochMetaData) AddTotalStakeAmountFound ¶
func (e *EpochMetaData) AddTotalStakeAmountFound(amount uint64)
func (*EpochMetaData) AddValidators ¶
func (e *EpochMetaData) AddValidators(dilithiumPK []byte)
func (*EpochMetaData) AllotSlots ¶
func (e *EpochMetaData) AllotSlots(randomSeed int64, epoch uint64, prevSlotLastBlockHeaderHash common.Hash)
func (*EpochMetaData) DeSerialize ¶
func (e *EpochMetaData) DeSerialize(data []byte) error
func (*EpochMetaData) Epoch ¶
func (e *EpochMetaData) Epoch() uint64
func (*EpochMetaData) PBData ¶
func (e *EpochMetaData) PBData() *protos.EpochMetaData
func (*EpochMetaData) PrevSlotLastBlockHeaderHash ¶
func (e *EpochMetaData) PrevSlotLastBlockHeaderHash() common.Hash
func (*EpochMetaData) RemoveValidators ¶
func (e *EpochMetaData) RemoveValidators(dilithiumPK []byte)
func (*EpochMetaData) Serialize ¶
func (e *EpochMetaData) Serialize() ([]byte, error)
func (*EpochMetaData) SlotInfo ¶
func (e *EpochMetaData) SlotInfo() []*protos.SlotInfo
func (*EpochMetaData) TotalStakeAmountAlloted ¶
func (e *EpochMetaData) TotalStakeAmountAlloted() uint64
func (*EpochMetaData) TotalStakeAmountFound ¶
func (e *EpochMetaData) TotalStakeAmountFound() uint64
func (*EpochMetaData) UpdatePrevEpochStakeData ¶
func (e *EpochMetaData) UpdatePrevEpochStakeData(totalStakeAmountFound uint64, totalStakeAmountAlloted uint64)
func (*EpochMetaData) Validators ¶
func (e *EpochMetaData) Validators() [][]byte
type MainChainMetaData ¶
type MainChainMetaData struct {
// contains filtered or unexported fields
}
func GetMainChainMetaData ¶
func GetMainChainMetaData(d *db.DB) (*MainChainMetaData, error)
func NewMainChainMetaData ¶
func (*MainChainMetaData) DeSerialize ¶
func (m *MainChainMetaData) DeSerialize(data []byte) error
func (*MainChainMetaData) FinalizedBlockHeaderHash ¶
func (m *MainChainMetaData) FinalizedBlockHeaderHash() common.Hash
func (*MainChainMetaData) FinalizedBlockSlotNumber ¶
func (m *MainChainMetaData) FinalizedBlockSlotNumber() uint64
func (*MainChainMetaData) LastBlockHeaderHash ¶
func (m *MainChainMetaData) LastBlockHeaderHash() common.Hash
func (*MainChainMetaData) LastBlockSlotNumber ¶
func (m *MainChainMetaData) LastBlockSlotNumber() uint64
func (*MainChainMetaData) Serialize ¶
func (m *MainChainMetaData) Serialize() ([]byte, error)
func (*MainChainMetaData) UpdateFinalizedBlockData ¶
func (m *MainChainMetaData) UpdateFinalizedBlockData(finalizedBlockHeaderHash common.Hash, finalizedBlockSlotNumber uint64)
func (*MainChainMetaData) UpdateLastBlockData ¶
func (m *MainChainMetaData) UpdateLastBlockData(lastBlockHeaderHash common.Hash, lastBlockSlotNumber uint64)
type PeerData ¶
type PeerData struct {
// contains filtered or unexported fields
}
func NewPeerData ¶
func (*PeerData) AddConnectedPeers ¶
func (*PeerData) AddDisconnectedPeers ¶
func (*PeerData) ConnectedPeers ¶
func (*PeerData) DisconnectedPeers ¶
func (*PeerData) IsPeerInList ¶
func (*PeerData) RemovePeer ¶
type PeerInfo ¶
type PeerInfo struct {
// contains filtered or unexported fields
}
func NewPeerInfo ¶
type ProtocolTransactionMetaData ¶
type ProtocolTransactionMetaData struct {
// contains filtered or unexported fields
}
func NewProtocolTransactionMetaData ¶
func NewProtocolTransactionMetaData(blockHash common.Hash, blockNumber uint64, index uint64, tx *protos.ProtocolTransaction) *ProtocolTransactionMetaData
func (*ProtocolTransactionMetaData) BlockHash ¶
func (t *ProtocolTransactionMetaData) BlockHash() common.Hash
func (*ProtocolTransactionMetaData) BlockNumber ¶
func (t *ProtocolTransactionMetaData) BlockNumber() uint64
func (*ProtocolTransactionMetaData) Commit ¶
func (t *ProtocolTransactionMetaData) Commit(b *bbolt.Bucket) error
func (*ProtocolTransactionMetaData) DeSerialize ¶
func (t *ProtocolTransactionMetaData) DeSerialize(data []byte) error
func (*ProtocolTransactionMetaData) Index ¶
func (t *ProtocolTransactionMetaData) Index() uint64
func (*ProtocolTransactionMetaData) Serialize ¶
func (t *ProtocolTransactionMetaData) Serialize() ([]byte, error)
func (*ProtocolTransactionMetaData) Transaction ¶
func (t *ProtocolTransactionMetaData) Transaction() *protos.ProtocolTransaction
type SlaveMetaData ¶
type SlaveMetaData struct {
// contains filtered or unexported fields
}
func GetSlaveMetaData ¶
func NewSlaveMetaData ¶
func NewSlaveMetaData(txHash []byte, address []byte, slavePK []byte) *SlaveMetaData
func (*SlaveMetaData) Address ¶
func (s *SlaveMetaData) Address() []byte
func (*SlaveMetaData) DeSerialize ¶
func (s *SlaveMetaData) DeSerialize(data []byte) error
func (*SlaveMetaData) Serialize ¶
func (s *SlaveMetaData) Serialize() ([]byte, error)
func (*SlaveMetaData) SlavePK ¶
func (s *SlaveMetaData) SlavePK() []byte
func (*SlaveMetaData) TxHash ¶
func (s *SlaveMetaData) TxHash() []byte
type SlotValidatorsMetaData ¶
type SlotValidatorsMetaData struct {
// contains filtered or unexported fields
}
SlotValidatorsMetaData metadata is not stored into DB, as we generate this based on validators data already stored by epoch.go in the DB.
func NewSlotValidatorsMetaData ¶
func NewSlotValidatorsMetaData(slotNumber uint64, epochMetaData *EpochMetaData) *SlotValidatorsMetaData
func (*SlotValidatorsMetaData) GetSlotLeaderPK ¶
func (s *SlotValidatorsMetaData) GetSlotLeaderPK() []byte
func (*SlotValidatorsMetaData) GetValidatorType ¶
func (s *SlotValidatorsMetaData) GetValidatorType(dilithiumPK []byte) (uint8, bool)
func (*SlotValidatorsMetaData) GetValidatorsType ¶
func (s *SlotValidatorsMetaData) GetValidatorsType() map[string]uint8
func (*SlotValidatorsMetaData) IsAttestor ¶
func (s *SlotValidatorsMetaData) IsAttestor(dilithiumPK string) bool
func (*SlotValidatorsMetaData) IsSlotLeader ¶
func (s *SlotValidatorsMetaData) IsSlotLeader(dilithiumPK string) bool
type TransactionMetaData ¶
type TransactionMetaData struct {
// contains filtered or unexported fields
}
func GetTransactionMetaData ¶
func NewTransactionMetaData ¶
func NewTransactionMetaData(blockHash common.Hash, blockNumber uint64, index uint64, tx *protos.Transaction) *TransactionMetaData
func (*TransactionMetaData) BlockHash ¶
func (t *TransactionMetaData) BlockHash() common.Hash
func (*TransactionMetaData) BlockNumber ¶
func (t *TransactionMetaData) BlockNumber() uint64
func (*TransactionMetaData) DeSerialize ¶
func (t *TransactionMetaData) DeSerialize(data []byte) error
func (*TransactionMetaData) Index ¶
func (t *TransactionMetaData) Index() uint64
func (*TransactionMetaData) Serialize ¶
func (t *TransactionMetaData) Serialize() ([]byte, error)
func (*TransactionMetaData) Transaction ¶
func (t *TransactionMetaData) Transaction() *protos.Transaction
Click to show internal directories.
Click to hide internal directories.