Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v0.5.0
type Account struct { // InitBalanceMap is the address and initial balance mapping before the first block. InitBalanceMap map[string]string `yaml:"initBalances"` }
Account contains the configs for account protocol
type Blockchain ¶ added in v0.5.0
type Blockchain struct { // Timestamp is the timestamp of the genesis block Timestamp int64 // BlockGasLimit is the total gas limit could be consumed in a block BlockGasLimit uint64 `yaml:"blockGasLimit"` // ActionGasLimit is the per action gas limit cap ActionGasLimit uint64 `yaml:"actionGasLimit"` // BlockInterval is the interval between two blocks BlockInterval time.Duration `yaml:"blockInterval"` // NumSubEpochs is the number of sub epochs in one epoch of block production NumSubEpochs uint64 `yaml:"numSubEpochs"` // NumDelegates is the number of delegates that participate into one epoch of block production NumDelegates uint64 `yaml:"numDelegates"` // NumCandidateDelegates is the number of candidate delegates, who may be selected as a delegate via roll dpos NumCandidateDelegates uint64 `yaml:"numCandidateDelegates"` // TimeBasedRotation is the flag to enable rotating delegates' time slots on a block height TimeBasedRotation bool `yaml:"timeBasedRotation"` }
Blockchain contains blockchain level configs
type Delegate ¶ added in v0.5.0
type Delegate struct { Address string `yaml:"address"` Votes uint64 `yaml:"votes"` RewardAddress string `yaml:"rewardAddress"` }
Delegate defines a delegate with address and votes
type Genesis ¶ added in v0.5.0
type Genesis struct { Blockchain `yaml:"blockchain"` Account `ymal:"account"` Poll `yaml:"poll"` Rewarding `yaml:"rewarding"` }
Genesis is the root level of genesis config. Genesis config is the network-wide blockchain config. All the nodes participating into the same network should use EXACTLY SAME genesis config.
var ( // Default contains the default genesis config Default Genesis )
type Poll ¶ added in v0.5.0
type Poll struct { // EnableBeaconChainVoting is a flag whether read voting from beacon chain EnableBeaconChainVoting bool `yaml:"enableBeaconChainVoting"` // InitBeaconChainHeight is the height in beacon chain where the init poll result stored InitBeaconChainHeight uint64 `yaml:"initBeaconChainHeight"` // CommitteeConfig is the config for committee CommitteeConfig committee.Config `yaml:"committeeConfig"` // Delegates is a list of delegates with votes Delegates []Delegate `yaml:"delegates"` }
Poll contains the configs for poll protocol
type Rewarding ¶ added in v0.5.0
type Rewarding struct { // InitAdminAddrStr is the address of the initial rewarding protocol admin in encoded string format InitAdminAddrStr string `yaml:"initAdminAddr"` // InitBalanceStr is the initial balance of the rewarding protocol in decimal string format InitBalanceStr string `yaml:"initBalance"` // BlockReward is the block reward amount in decimal string format BlockRewardStr string `yaml:"blockReward"` // EpochReward is the epoch reward amount in decimal string format EpochRewardStr string `yaml:"epochReward"` // NumDelegatesForEpochReward is the number of top candidates that will share a epoch reward NumDelegatesForEpochReward uint64 `yaml:"numDelegatesForEpochReward"` }
Rewarding contains the configs for rewarding protocol
func (*Rewarding) BlockReward ¶ added in v0.5.0
BlockReward returns the block reward amount
func (*Rewarding) EpochReward ¶ added in v0.5.0
EpochReward returns the epoch reward amount
func (*Rewarding) InitAdminAddr ¶
InitAdminAddr returns the address of the initial rewarding protocol admin
func (*Rewarding) InitBalance ¶ added in v0.5.0
InitBalance returns the init balance of the rewarding fund