Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ProtocolID is the ID of protocol ProtocolID = "blocks" // BlockHistoryTableName is the table name of block history BlockHistoryTableName = "block_history" // ProductivityTableName is the table name of block producers' productivity ProductivityTableName = "productivity_history" // ExpectedProducerTableName is a table required by productivity table ExpectedProducerTableName = "expected_producer_history" // ProducerTableName is a table required by productivity table ProducerTableName = "producer_history" // EpochProducerIndexName is the index name of epoch number and producer's name on block history table EpochProducerIndexName = "epoch_producer_index" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockHistory ¶
type BlockHistory struct { EpochNumber uint64 BlockHeight uint64 BlockHash string Transfer uint64 Execution uint64 DepositToRewaringFund uint64 ClaimFromRewardingFund uint64 GrantReward uint64 PutPollResult uint64 GasConsumed uint64 ProducerAddress string ProducerName string ExpectedProducerAddress string ExpectedProducerName string Timestamp uint64 }
BlockHistory defines the schema of "block history" table
type ProductivityHistory ¶
type ProductivityHistory struct { EpochNumber uint64 ProducerName string Production uint64 ExpectedProduction uint64 }
ProductivityHistory defines the schema of "productivity history" view
type Protocol ¶
type Protocol struct { Store s.Store NumDelegates uint64 NumCandidateDelegates uint64 NumSubEpochs uint64 ActiveBlockProducers []string OperatorAddrToName map[string]string }
Protocol defines the protocol of indexing blocks
func NewProtocol ¶
func NewProtocol(store s.Store, numDelegates uint64, numCandidateDelegates uint64, numSubEpochs uint64) *Protocol
NewProtocol creates a new protocol
func (*Protocol) CreateTables ¶
CreateTables creates tables
func (*Protocol) HandleBlock ¶
HandleBlock handles blocks
func (*Protocol) Initialize ¶
Initialize initializes blocks index protocol
Click to show internal directories.
Click to hide internal directories.