Documentation ¶
Index ¶
- Constants
- Variables
- func GetQuorum(consensusType string, N int) uint64
- func NeedChangeEpoch(height uint64, epochInfo *rbft.EpochInfo) bool
- func ReadEpochState(epochStore storage.Storage, key string) ([]byte, error)
- func StoreEpochState(epochStore storage.Storage, key string, value []byte) error
- type CommitEvent
- type Config
- type Logger
- type Option
- func WithApplied(height uint64) Option
- func WithBlockSync(blockSync common.Sync) Option
- func WithConfig(repoRoot string, cfg *repo.ConsensusConfig) Option
- func WithConsensusStorageType(consensusStorageType string) Option
- func WithConsensusType(typ string) Option
- func WithDigest(digest string) Option
- func WithEpochStore(epochStore storage.Storage) Option
- func WithGenesisDigest(digest string) Option
- func WithGenesisEpochInfo(genesisEpochInfo *rbft.EpochInfo) Option
- func WithGetAccountBalanceFunc(f func(address string) *big.Int) Option
- func WithGetAccountNonceFunc(f func(address *types.Address) uint64) Option
- func WithGetBlockHeaderFunc(f func(height uint64) (*types.BlockHeader, error)) Option
- func WithGetChainMetaFunc(f func() *types.ChainMeta) Option
- func WithGetCurrentEpochInfoFromEpochMgrContractFunc(f func() (*rbft.EpochInfo, error)) Option
- func WithGetEpochInfoFromEpochMgrContractFunc(f func(epoch uint64) (*rbft.EpochInfo, error)) Option
- func WithLogger(logger logrus.FieldLogger) Option
- func WithNetwork(net network.Network) Option
- func WithPrivKey(privKey *ecdsa.PrivateKey) Option
- func WithTxPool(tp txpool.TxPool[types.Transaction, *types.Transaction]) Option
- type TxResp
- type TxWithResp
- type UncheckedTxEvent
Constants ¶
View Source
const ( LocalTxEvent = iota RemoteTxEvent )
Variables ¶
Functions ¶
Types ¶
type CommitEvent ¶
type CommitEvent struct { Block *types.Block StateUpdatedCheckpoint *consensus.Checkpoint }
type Config ¶
type Config struct { RepoRoot string Config *repo.ConsensusConfig Logger logrus.FieldLogger ConsensusType string ConsensusStorageType string PrivKey *ecdsa.PrivateKey GenesisEpochInfo *rbft.EpochInfo Network network.Network BlockSync common.Sync TxPool txpool.TxPool[types.Transaction, *types.Transaction] Applied uint64 Digest string GenesisDigest string GetCurrentEpochInfoFromEpochMgrContractFunc func() (*rbft.EpochInfo, error) GetEpochInfoFromEpochMgrContractFunc func(epoch uint64) (*rbft.EpochInfo, error) GetChainMetaFunc func() *types.ChainMeta GetBlockHeaderFunc func(height uint64) (*types.BlockHeader, error) GetAccountBalance func(address string) *big.Int GetAccountNonce func(address *types.Address) uint64 EpochStore storage.Storage }
func GenerateConfig ¶
type Logger ¶
type Logger struct {
logrus.FieldLogger
}
type Option ¶
type Option func(*Config)
func WithApplied ¶
func WithBlockSync ¶
func WithConfig ¶
func WithConfig(repoRoot string, cfg *repo.ConsensusConfig) Option
func WithConsensusType ¶
func WithDigest ¶
func WithEpochStore ¶
func WithGenesisDigest ¶
func WithGenesisEpochInfo ¶
func WithGetAccountNonceFunc ¶
func WithGetBlockHeaderFunc ¶
func WithGetBlockHeaderFunc(f func(height uint64) (*types.BlockHeader, error)) Option
func WithGetChainMetaFunc ¶
func WithLogger ¶
func WithLogger(logger logrus.FieldLogger) Option
func WithNetwork ¶
func WithPrivKey ¶
func WithPrivKey(privKey *ecdsa.PrivateKey) Option
func WithTxPool ¶
func WithTxPool(tp txpool.TxPool[types.Transaction, *types.Transaction]) Option
type TxWithResp ¶
type TxWithResp struct { Tx *types.Transaction CheckCh chan *TxResp PoolCh chan *TxResp }
type UncheckedTxEvent ¶
UncheckedTxEvent represents misc event sent by local modules
Click to show internal directories.
Click to hide internal directories.