Version: v0.0.0-...-491e088 Latest Latest

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 0




This section is empty.


This section is empty.


func Validator

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


type AccessorOptions

type AccessorOptions struct {
	RawUrls           []string `required:"true"`
	FetchTxRetryCount int

type AccountManagerOptions

type AccountManagerOptions struct {
	CacheDuration int64

type CommonOptions

type CommonOptions struct {
	Erc20Abi        string
	WethAbi         string
	ProtocolImpl    ProtocolOptions  `required:"true"`
	OrderMinAmounts map[string]int64 //最小的订单金额,低于该数,则终止匹配订单,每个token的值不同

type ExtractorOptions

type ExtractorOptions struct {
	StartBlockNumber   *big.Int
	EndBlockNumber     *big.Int
	ConfirmBlockNumber uint64
	ForkWaitingTime    int64
	Debug              bool
	Open               bool

type GateWayOptions

type GateWayOptions struct {
	IsBroadcast      bool
	MaxBroadcastTime int

type GatewayFiltersOptions

type GatewayFiltersOptions struct {
	BaseFilter struct {
		MinLrcFee             int64
		MinLrcHold            int64
		MaxPrice              int64
		MinSplitPercentage    float64
		MaxSplitPercentage    float64
		MinTokeSAmount        map[string]string
		MinTokenSUsdAmount    float64
		MaxValidSinceInterval int64
	PowFilter struct {
		Difficulty string

type GlobalConfig

type GlobalConfig struct {
	Title string `required:"true"`
	Mode  string `required:"true"`
	Owner struct {
		Name string
	Mysql          MysqlOptions
	Redis          RedisOptions
	Ipfs           IpfsOptions
	Jsonrpc        JsonrpcOptions
	Websocket      WebsocketOptions
	GatewayFilters GatewayFiltersOptions
	OrderManager   OrderManagerOptions
	Gateway        GateWayOptions
	Accessor       AccessorOptions
	Extractor      ExtractorOptions
	Common         CommonOptions
	Miner          MinerOptions
	Log            LogOptions
	Keystore       KeyStoreOptions
	Market         MarketOptions
	MarketCap      MarketCapOptions
	UserManager    UserManagerOptions
	AccountManager AccountManagerOptions

func LoadConfig

func LoadConfig(file string) *GlobalConfig

type IpfsOptions

type IpfsOptions struct {
	Server          string
	Port            int
	ListenTopics    []string
	BroadcastTopics []string

func (IpfsOptions) Url

func (opts IpfsOptions) Url() string

type JsonrpcOptions

type JsonrpcOptions struct {
	Port string

type KeyStoreOptions

type KeyStoreOptions struct {
	Keydir  string
	ScryptN int
	ScryptP int

type LogOptions

type LogOptions struct {
	ZapOpts zap.Config

type MarketCapOptions

type MarketCapOptions struct {
	BaseUrl  string
	Currency string
	Duration int
	IsSync   bool

type MarketOptions

type MarketOptions struct {
	TokenFile             string
	OldVersionWethAddress string
	CronJobLock           bool

type MinerOptions

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

type MysqlOptions

type MysqlOptions struct {
	Hostname           string
	Port               string
	User               string
	Password           string
	DbName             string
	TablePrefix        string
	MaxOpenConnections int
	MaxIdleConnections int
	ConnMaxLifetime    int
	Debug              bool

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 OrderManagerOptions

type OrderManagerOptions struct {
	CutoffCacheExpireTime int64
	CutoffCacheCleanTime  int64
	DustOrderValue        int64

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 ProtocolOptions

type ProtocolOptions struct {
	Address          map[string]string
	ImplAbi          string
	DelegateAbi      string
	TokenRegistryAbi string

type RedisOptions

type RedisOptions struct {
	Host        string
	Port        string
	Password    string
	IdleTimeout int
	MaxIdle     int
	MaxActive   int

type TimingMatcher

type TimingMatcher struct {
	RoundOrdersCount             int
	Duration                     int64
	ReservedSubmitTime           int64
	MaxSumitFailedCount          int64
	DelayedNumber                int64
	MaxCacheRoundsLength         int
	LagForCleanSubmitCacheBlocks int64

type UserManagerOptions

type UserManagerOptions struct {
	WhiteListOpen            bool
	WhiteListCacheExpireTime int64
	WhiteListCacheCleanTime  int64

type WebsocketOptions

type WebsocketOptions struct {
	Port string

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL