Documentation ¶
Index ¶
- Variables
- type BlockChain
- func (bc *BlockChain) FetchBlock(blockHash []byte) (*types2.Block, error)
- func (bc *BlockChain) FetchBlockByHeight(height uint64) (*types2.Block, error)
- func (bc *BlockChain) FetchBlockData(blockHash []byte) ([]*types2.Transaction, error)
- func (bc *BlockChain) FetchBlockHeader(blockHash []byte) (*types2.BlockHeader, error)
- func (bc *BlockChain) FetchBlockHeaderByHeight(height uint64) (*types2.BlockHeader, error)
- func (bc *BlockChain) GetLatestBlockHeight() (uint64, error)
- func (bc *BlockChain) HasBlock(blockHash []byte) (bool, error)
- func (bc *BlockChain) StoreBlock(block *types2.Block) error
- func (bc *BlockChain) ValidateBlock(block *types2.Block) error
- type Miner
- func (m *Miner) GetStakeInfo(miner common.Address) (*big.Int, *big.Int, error)
- func (m *Miner) IsMinerEligibleToProposeBlock(ethAddress common.Address) error
- func (m *Miner) MineBlock(randomness []byte, randomnessRound uint64) (*types2.Block, error)
- func (m *Miner) SetBlockchainInstance(b *BlockChain)
- func (m *Miner) UpdateCurrentStakeInfo() error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoTxForBlock = fmt.Errorf("no transactions for including into block")
)
Functions ¶
This section is empty.
Types ¶
type BlockChain ¶
type BlockChain struct {
// contains filtered or unexported fields
}
func NewBlockChain ¶
func NewBlockChain(db database.Database, bus EventBus.Bus, miner *Miner, drand *drand2.DrandBeacon) (*BlockChain, error)
func (*BlockChain) FetchBlock ¶
func (bc *BlockChain) FetchBlock(blockHash []byte) (*types2.Block, error)
func (*BlockChain) FetchBlockByHeight ¶
func (bc *BlockChain) FetchBlockByHeight(height uint64) (*types2.Block, error)
func (*BlockChain) FetchBlockData ¶
func (bc *BlockChain) FetchBlockData(blockHash []byte) ([]*types2.Transaction, error)
func (*BlockChain) FetchBlockHeader ¶
func (bc *BlockChain) FetchBlockHeader(blockHash []byte) (*types2.BlockHeader, error)
func (*BlockChain) FetchBlockHeaderByHeight ¶
func (bc *BlockChain) FetchBlockHeaderByHeight(height uint64) (*types2.BlockHeader, error)
func (*BlockChain) GetLatestBlockHeight ¶
func (bc *BlockChain) GetLatestBlockHeight() (uint64, error)
func (*BlockChain) StoreBlock ¶
func (bc *BlockChain) StoreBlock(block *types2.Block) error
func (*BlockChain) ValidateBlock ¶
func (bc *BlockChain) ValidateBlock(block *types2.Block) error
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
func (*Miner) GetStakeInfo ¶
func (*Miner) IsMinerEligibleToProposeBlock ¶
func (*Miner) SetBlockchainInstance ¶
func (m *Miner) SetBlockchainInstance(b *BlockChain)
func (*Miner) UpdateCurrentStakeInfo ¶
Click to show internal directories.
Click to hide internal directories.