config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validator

func Validator(cv reflect.Value) (bool, error)

Types

type DataSource

type DataSource struct {
	Type           string
	OrderManager   ordermanager.OrderManagerOptions
	AccountManager accountmanager.AccountManagerOptions
	MotanClient    motan.MotanClientOptions
}

type GlobalConfig

type GlobalConfig struct {
	Title            string `required:"true"`
	Mysql            *dao.MysqlOptions
	Redis            redis.RedisOptions
	Accessor         accessor.AccessorOptions
	LoopringAccessor loopringaccessor.LoopringProtocolOptions
	Miner            MinerOptions
	Log              zap.Config
	Keystore         KeyStoreOptions
	MarketCap        marketcap.MarketCapOptions
	MarketUtil       marketutil.MarketOptions
	ZkLock           zklock.ZkLockConfig
	DataSource       DataSource
	Kafka            kafka.KafkaOptions
	Sns              sns.SnsConfig
}

func LoadConfig

func LoadConfig(file string) *GlobalConfig

type KeyStoreOptions

type KeyStoreOptions struct {
	Keydir  string
	ScryptN int
	ScryptP int
}

type MinerOptions

type MinerOptions struct {
	RingMaxLength         int `` //recommended value:4
	Subsidy               float64
	WalletSplit           float64
	NormalMiners          []NormalMinerAddress  //
	PercentMiners         []PercentMinerAddress //
	TimingMatcher         *TimingMatcher
	RateRatioCVSThreshold int64
	MinGasLimit           int64
	MaxGasLimit           int64
	FeeReceipt            string
}

type NormalMinerAddress

type NormalMinerAddress struct {
	Address         string
	MaxPendingTtl   int   //if a tx is still pending after MaxPendingTtl blocks, the nonce used by it will be used again.
	MaxPendingCount int64 //this addr will be used to send tx again until the count of pending txs belows MaxPendingCount.
	GasPriceLimit   int64 //the max gas price
}

type PercentMinerAddress

type PercentMinerAddress struct {
	Address    string
	FeePercent float64 //the gasprice will be calculated by (FeePercent/100)*(legalFee/eth-price)/gaslimit
	StartFee   float64 //If received reaches StartReceived, it will use feepercent to ensure eth confirm this tx quickly.
}

type TimingMatcher

type TimingMatcher struct {
	Mode                         string
	RoundOrdersCount             int
	Duration                     int64
	ReservedSubmitTime           int64
	MaxSumitFailedCount          int64
	DelayedNumber                int64
	MaxCacheTime                 int64
	LagForCleanSubmitCacheBlocks int64
}

Jump to

Keyboard shortcuts

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