config

package
v0.10.10 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppConfigFileName = "app"
)

Variables

This section is empty.

Functions

func WriteConfigFile

func WriteConfigFile(configFilePath string, config *BinanceChainConfig)

WriteConfigFile renders config using the template and writes it to configFilePath.

Types

type AddressConfig

type AddressConfig struct {
	Bech32PrefixAccAddr  string `mapstructure:"bech32PrefixAccAddr"`
	Bech32PrefixAccPub   string `mapstructure:"bech32PrefixAccPub"`
	Bech32PrefixValAddr  string `mapstructure:"bech32PrefixValAddr"`
	Bech32PrefixValPub   string `mapstructure:"bech32PrefixValPub"`
	Bech32PrefixConsAddr string `mapstructure:"bech32PrefixConsAddr"`
	Bech32PrefixConsPub  string `mapstructure:"bech32PrefixConsPub"`
}

type BaseConfig

type BaseConfig struct {
	AccountCacheSize          int   `mapstructure:"accountCacheSize"`
	SignatureCacheSize        int   `mapstructure:"signatureCacheSize"`
	StartMode                 uint8 `mapstructure:"startMode"`
	BreatheBlockInterval      int   `mapstructure:"breatheBlockInterval"`
	OrderKeeperConcurrency    uint  `mapstructure:"orderKeeperConcurrency"`
	BreatheBlockDaysCountBack int   `mapstructure:"breatheBlockDaysCountBack"`
}

type BinanceChainConfig

type BinanceChainConfig struct {
	*AddressConfig     `mapstructure:"addr"`
	*PublicationConfig `mapstructure:"publication"`
	*LogConfig         `mapstructure:"log"`
	*BaseConfig        `mapstructure:"base"`
	*UpgradeConfig     `mapstructure:"upgrade"`
	*QueryConfig       `mapstructure:"query"`
	*CrossChainConfig  `mapstructure:"cross_chain"`
	*DexConfig         `mapstructure:"dex"`
}

func DefaultBinanceChainConfig

func DefaultBinanceChainConfig() *BinanceChainConfig

type BinanceChainContext

type BinanceChainContext struct {
	*server.Context
	*viper.Viper
	*BinanceChainConfig
}

func NewDefaultContext

func NewDefaultContext() *BinanceChainContext

func (*BinanceChainContext) ParseAppConfigInPlace

func (context *BinanceChainContext) ParseAppConfigInPlace() error

func (*BinanceChainContext) ToCosmosServerCtx

func (context *BinanceChainContext) ToCosmosServerCtx() *server.Context

type CrossChainConfig

type CrossChainConfig struct {
	IbcChainId uint16 `mapstructure:"ibcChainId"`

	BscChainId    string `mapstructure:"bscChainId"`
	BscIbcChainId uint16 `mapstructure:"bscIBCChainId"`
}

type DexConfig

type DexConfig struct {
	BUSDSymbol string `mapstructure:"BUSDSymbol"`
}

type LogConfig

type LogConfig struct {
	LogToConsole bool   `mapstructure:"logToConsole"`
	LogFileRoot  string `mapstructure:"logFileRoot"`
	LogFilePath  string `mapstructure:"logFilePath"`
	LogBuffSize  int64  `mapstructure:"logBuffSize"`
}

type PublicationConfig

type PublicationConfig struct {
	PublishOrderUpdates bool   `mapstructure:"publishOrderUpdates"`
	OrderUpdatesTopic   string `mapstructure:"orderUpdatesTopic"`
	OrderUpdatesKafka   string `mapstructure:"orderUpdatesKafka"`

	PublishAccountBalance bool   `mapstructure:"publishAccountBalance"`
	AccountBalanceTopic   string `mapstructure:"accountBalanceTopic"`
	AccountBalanceKafka   string `mapstructure:"accountBalanceKafka"`

	PublishOrderBook bool   `mapstructure:"publishOrderBook"`
	OrderBookTopic   string `mapstructure:"orderBookTopic"`
	OrderBookKafka   string `mapstructure:"orderBookKafka"`

	PublishBlockFee bool   `mapstructure:"publishBlockFee"`
	BlockFeeTopic   string `mapstructure:"blockFeeTopic"`
	BlockFeeKafka   string `mapstructure:"blockFeeKafka"`

	PublishTransfer bool   `mapstructure:"publishTransfer"`
	TransferTopic   string `mapstructure:"transferTopic"`
	TransferKafka   string `mapstructure:"transferKafka"`

	PublishBlock bool   `mapstructure:"publishBlock"`
	BlockTopic   string `mapstructure:"blockTopic"`
	BlockKafka   string `mapstructure:"blockKafka"`

	PublishDistributeReward bool   `mapstructure:"publishDistributeReward"`
	DistributeRewardTopic   string `mapstructure:"distributeRewardTopic"`
	DistributeRewardKafka   string `mapstructure:"distributeRewardKafka"`

	PublishStaking bool   `mapstructure:"publishStaking"`
	StakingTopic   string `mapstructure:"stakingTopic"`
	StakingKafka   string `mapstructure:"stakingKafka"`

	PublishSlashing bool   `mapstructure:"publishSlashing"`
	SlashingTopic   string `mapstructure:"slashingTopic"`
	SlashingKafka   string `mapstructure:"slashingKafka"`

	PublishCrossTransfer bool   `mapstructure:"publishCrossTransfer"`
	CrossTransferTopic   string `mapstructure:"crossTransferTopic"`
	CrossTransferKafka   string `mapstructure:"crossTransferKafka"`

	PublishMirror bool   `mapstructure:"publishMirror"`
	MirrorTopic   string `mapstructure:"mirrorTopic"`
	MirrorKafka   string `mapstructure:"mirrorKafka"`

	PublishSideProposal bool   `mapstructure:"publishSideProposal"`
	SideProposalTopic   string `mapstructure:"sideProposalTopic"`
	SideProposalKafka   string `mapstructure:"sideProposalKafka"`

	PublishBreatheBlock bool   `mapstructure:"publichBreatheBlock"`
	BreatheBlockTopic   string `mapstructure:"breatheBlockTopic"`
	BreatheBlockKafka   string `mapstructure:"breatheBlockKafka"`

	PublicationChannelSize int `mapstructure:"publicationChannelSize"`

	// DO NOT put this option in config file
	// deliberately make it only a command line arguments
	// https://github.com/bnb-chain/node/issues/161#issuecomment-438600434
	FromHeightInclusive int64

	PublishKafka bool `mapstructure:"publishKafka"`

	// Start a local publisher which publish all topics into an auto-rotation json file
	// For full-node user and debugging usage
	PublishLocal bool `mapstructure:"publishLocal"`
	// refer: https://github.com/natefinch/lumberjack/blob/7d6a1875575e09256dc552b4c0e450dcd02bd10e/lumberjack.go#L85-L87
	LocalMaxSize int `mapstructure:"localMaxSize"`
	// refer: https://github.com/natefinch/lumberjack/blob/7d6a1875575e09256dc552b4c0e450dcd02bd10e/lumberjack.go#L89-L94
	LocalMaxAge int `mapstructure:"localMaxAge"`

	Auth            bool   `mapstructure:"auth"`
	StopOnKafkaFail bool   `mapstructure:"stopOnKafkaFail"`
	KafkaUserName   string `mapstructure:"kafkaUserName"`
	KafkaPassword   string `mapstructure:"kafkaPassword"`

	KafkaVersion string `mapstructure:"kafkaVersion"`
}

func (PublicationConfig) ShouldPublishAny

func (pubCfg PublicationConfig) ShouldPublishAny() bool

type QueryConfig

type QueryConfig struct {
	ABCIQueryBlackList []string `mapstructure:"ABCIQueryBlackList"`
}

type UpgradeConfig

type UpgradeConfig struct {
	// Galileo Upgrade
	BEP6Height  int64 `mapstructure:"BEP6Height"`
	BEP9Height  int64 `mapstructure:"BEP9Height"`
	BEP10Height int64 `mapstructure:"BEP10Height"`
	BEP19Height int64 `mapstructure:"BEP19Height"`
	// Hubble Upgrade
	BEP12Height int64 `mapstructure:"BEP12Height"`
	// Archimedes Upgrade
	BEP3Height int64 `mapstructure:"BEP3Height"`
	// Heisenberg Upgrade
	FixSignBytesOverflowHeight int64 `mapstructure:"FixSignBytesOverflowHeight"`
	LotSizeUpgradeHeight       int64 `mapstructure:"LotSizeUpgradeHeight"`
	ListingRuleUpgradeHeight   int64 `mapstructure:"ListingRuleUpgradeHeight"`
	FixZeroBalanceHeight       int64 `mapstructure:"FixZeroBalanceHeight"`
	LaunchBscUpgradeHeight     int64 `mapstructure:"LaunchBscUpgradeHeight"`

	BEP8Height  int64 `mapstructure:"BEP8Height"`
	BEP67Height int64 `mapstructure:"BEP67Height"`
	BEP70Height int64 `mapstructure:"BEP70Height"`

	BEP82Height                                     int64 `mapstructure:"BEP82Height"`
	BEP84Height                                     int64 `mapstructure:"BEP84Height"`
	BEP87Height                                     int64 `mapstructure:"BEP87Height"`
	FixFailAckPackageHeight                         int64 `mapstructure:"FixFailAckPackageHeight"`
	EnableAccountScriptsForCrossChainTransferHeight int64 `mapstructure:"EnableAccountScriptsForCrossChainTransferHeight"`
	BEP128Height                                    int64 `mapstructure:"BEP128Height"`
	BEP151Height                                    int64 `mapstructure:"BEP151Height"`
	BEP153Height                                    int64 `mapstructure:"BEP153Height"`
	BEP159Height                                    int64 `mapstructure:"BEP159Height"`
	BEP159Phase2Height                              int64 `mapstructure:"BEP159Phase2Height"`
	LimitConsAddrUpdateIntervalHeight               int64 `mapstructure:"LimitConsAddrUpdateIntervalHeight"`
	BEP171Height                                    int64 `mapstructure:"BEP171Height"`
	BEP173Height                                    int64 `mapstructure:"BEP173Height"`
	FixDoubleSignChainIdHeight                      int64 `mapstructure:"FixDoubleSignChainIdHeight"`
}

Jump to

Keyboard shortcuts

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