Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ SuggestBlockWindow: 20, DefaultGas: uint64(unit.Qev), Percentile: 60, }
DefaultConfig is the default config
Functions ¶
This section is empty.
Types ¶
type BlockDAO ¶ added in v0.11.0
type BlockDAO interface { GetBlockHash(uint64) (hash.Hash256, error) GetBlockByHeight(uint64) (*block.Block, error) }
BlockDAO represents the block data access object
type Config ¶ added in v1.10.0
type Config struct { SuggestBlockWindow int `yaml:"suggestBlockWindow"` DefaultGas uint64 `yaml:"defaultGas"` Percentile int `yaml:"Percentile"` }
Config is the gas station config
type GasStation ¶
type GasStation struct {
// contains filtered or unexported fields
}
GasStation provide gas related api
func NewGasStation ¶
func NewGasStation(bc blockchain.Blockchain, dao BlockDAO, cfg Config) *GasStation
NewGasStation creates a new gas station
func (*GasStation) SuggestGasPrice ¶
func (gs *GasStation) SuggestGasPrice() (uint64, error)
SuggestGasPrice suggest gas price
Click to show internal directories.
Click to hide internal directories.