mapper

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Mint    = "mint"
	Phrases = "phrases"
	Total   = "total"
	Applied = "applied"
)

nolint

View Source
const (
	MetricsSubsystem = "mint" // module name
)

Variables

This section is empty.

Functions

func BuildQueryAppliedPath

func BuildQueryAppliedPath() string

QOS流通总量查询路径

func BuildQueryPhrasesPath

func BuildQueryPhrasesPath() string

nolint 通胀规则查询路径

func BuildQueryTotalPath

func BuildQueryTotalPath() string

QOS发行总量查询路径

func Query

func Query(ctx context.Context, route []string, req abci.RequestQuery) (res []byte, err btypes.Error)

nolint

func TotalAppliedInvariant

func TotalAppliedInvariant(module string) qtypes.Invariant

通胀数据检查

Types

type Mapper

type Mapper struct {
	*mapper.BaseMapper

	Metrics *Metrics // prometheus监控项
}

通胀相关存储操作Mapper

func GetMapper

func GetMapper(ctx context.Context) *Mapper

func NewMapper

func NewMapper() *Mapper

func (*Mapper) AddAllTotalMintQOSAmount

func (mapper *Mapper) AddAllTotalMintQOSAmount(amount btypes.BigInt)

增加流通QOS总数

func (*Mapper) Copy

func (mapper *Mapper) Copy() mapper.IMapper

func (*Mapper) DelAllTotalMintQOSAmount

func (mapper *Mapper) DelAllTotalMintQOSAmount()

删除流通QOS总数

func (*Mapper) GetAllTotalMintQOSAmount

func (mapper *Mapper) GetAllTotalMintQOSAmount() (amount btypes.BigInt)

获取流通QOS总数

func (*Mapper) GetFirstBlockTime

func (mapper *Mapper) GetFirstBlockTime() (t int64)

获取第一块时间

func (*Mapper) GetInflationPhrases

func (mapper *Mapper) GetInflationPhrases() (phrases types.InflationPhrases, exists bool)

获取通胀规则

func (*Mapper) GetTotalQOSAmount

func (mapper *Mapper) GetTotalQOSAmount() (amount btypes.BigInt)

获取QOS发行总量(已发行+待发行)

func (*Mapper) MustGetInflationPhrases

func (mapper *Mapper) MustGetInflationPhrases() types.InflationPhrases

获取通胀规则,不存在时panic

func (*Mapper) SetAllTotalMintQOSAmount

func (mapper *Mapper) SetAllTotalMintQOSAmount(amount btypes.BigInt)

设置流通QOS总数

func (*Mapper) SetFirstBlockTime

func (mapper *Mapper) SetFirstBlockTime(t int64)

设置第一块时间

func (*Mapper) SetInflationPhrases

func (mapper *Mapper) SetInflationPhrases(phrases types.InflationPhrases)

保存通胀规则

func (*Mapper) SetTotalQOSAmount

func (mapper *Mapper) SetTotalQOSAmount(amount btypes.BigInt)

设置QOS发行总量

func (*Mapper) SetUpMetrics added in v0.0.8

func (mapper *Mapper) SetUpMetrics(cfg *config.InstrumentationConfig)

设置prometheus监控项

type Metrics added in v0.0.8

type Metrics struct {
	TotalAppliedQOS   metrics.Gauge // total applied QOS
	MintPerBlockQOS   metrics.Gauge // mint QOS per block
	GasFeePerBlockQOS metrics.Gauge // gas fee per block
}

func NopMetrics added in v0.0.8

func NopMetrics() *Metrics

func PrometheusMetrics added in v0.0.8

func PrometheusMetrics(cfg *config.InstrumentationConfig) *Metrics

注册本模块监控项

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL