Documentation ¶
Index ¶
- Constants
- Variables
- func AddTokenAndExchange(token, exchange common.Address)
- func ArchiveVersion(gitCommit string) string
- func CheckConfig() (err error)
- func GetAverageBlockTime() uint64
- func GetConfigedExchange(token string) string
- func GetDustRewardThreshold() *big.Int
- func GetExchangePairs(exchange string) string
- func GetExchangeToken(exchange string) string
- func GetFactories() []common.Address
- func GetMinExchangeCreationHeight() uint64
- func GetTokenAddress(exchange string) string
- func IsConfigedExchange(exchange string) bool
- func IsConfigedFactory(factory common.Address) bool
- func IsConfigedToken(token string) bool
- func IsExcludedRewardAccount(account common.Address) bool
- func IsInAllExchanges(exchange common.Address) bool
- func IsInAllTokenAndExchanges(address common.Address) bool
- func IsInAllTokens(token common.Address) bool
- func IsInStakerList(account common.Address) bool
- func IsRecordTokenAccount() bool
- func IsScanAllExchange() bool
- func SetConfig(cfg *Config)
- func SetDustRewardThreshold(dustThreshold string)
- func VersionWithCommit(gitCommit, gitDate string) string
- type Config
- type DistributeConfig
- type ExchangeConfig
- type GatewayConfig
- type MongoDBConfig
- type StakeConfig
- type SyncConfig
Constants ¶
const ( VersionMajor = 0 // Major version component of the current release VersionMinor = 1 // Minor version component of the current release VersionPatch = 5 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )
version parts
Variables ¶
var ( AllExchanges = make(map[common.Address]struct{}) AllTokens = make(map[common.Address]struct{}) )
all exchanges and tokens of configed factories
var Version = func() string { return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) }()
Version holds the textual version string.
var VersionWithMeta = func() string { v := Version if VersionMeta != "" { v += "-" + VersionMeta } return v }()
VersionWithMeta holds the textual version string including the metadata.
Functions ¶
func AddTokenAndExchange ¶ added in v0.1.5
AddTokenAndExchange add token and exchange
func ArchiveVersion ¶
ArchiveVersion holds the textual version string used for Geth archives. e.g. "1.8.11-dea1ce05" for stable releases, or
"1.8.13-unstable-21c059b6" for unstable releases
func GetConfigedExchange ¶
GetConfigedExchange get configed exchange
func GetDustRewardThreshold ¶ added in v0.1.4
GetDustRewardThreshold get dust reward threshold
func GetExchangePairs ¶
GetExchangePairs get pairs from config
func GetExchangeToken ¶
GetExchangeToken get exchane token from config
func GetMinExchangeCreationHeight ¶
func GetMinExchangeCreationHeight() uint64
GetMinExchangeCreationHeight get minimum exchange creation height
func GetTokenAddress ¶
GetTokenAddress get token address from config
func IsConfigedExchange ¶
IsConfigedExchange return true if exchange is configed
func IsConfigedFactory ¶ added in v0.1.5
IsConfigedFactory is configed factory
func IsConfigedToken ¶
IsConfigedToken return true if token is configed
func IsExcludedRewardAccount ¶
IsExcludedRewardAccount is excluded
func IsInAllExchanges ¶ added in v0.1.5
IsInAllExchanges is in all exchanges
func IsInAllTokenAndExchanges ¶ added in v0.1.5
IsInAllTokenAndExchanges is in all exchanges or tokens
func IsInAllTokens ¶ added in v0.1.5
IsInAllTokens is exchange token
func IsInStakerList ¶ added in v0.1.5
IsInStakerList in in staker list
func IsRecordTokenAccount ¶
func IsRecordTokenAccount() bool
IsRecordTokenAccount is record token account
func SetDustRewardThreshold ¶ added in v0.1.4
func SetDustRewardThreshold(dustThreshold string)
SetDustRewardThreshold set dust reward threshold
func VersionWithCommit ¶
VersionWithCommit add git commit and data to version.
Types ¶
type Config ¶
type Config struct { MongoDB *MongoDBConfig Gateway *GatewayConfig Sync *SyncConfig Distribute *DistributeConfig Exchanges []*ExchangeConfig Factories []string Stake *StakeConfig }
Config config
type DistributeConfig ¶
type DistributeConfig struct { Enable bool ArchiveMode bool RewardToken string StartHeight uint64 StableHeight uint64 GasLimit uint64 GasPrice string ByLiquidCycle uint64 ByLiquidRewards string // unit Wei ByVolumeCycle uint64 ByVolumeRewards string // unit Wei QuickSettleVolumeRewards bool DustRewardThreshold string // use time measurement instead of block height UseTimeMeasurement bool StartTimestamp uint64 // unix timestamp StableDuration uint64 // unit of seconds ByLiquidCycleDuration uint64 // unit of seconds ByVolumeCycleDuration uint64 // unit of seconds TradeWeightIsPercentage bool }
DistributeConfig distribute config
func (*DistributeConfig) GetByLiquidCycleRewards ¶
func (dist *DistributeConfig) GetByLiquidCycleRewards() *big.Int
GetByLiquidCycleRewards get non nil big int from string
func (*DistributeConfig) GetByVolumeCycleRewards ¶
func (dist *DistributeConfig) GetByVolumeCycleRewards() *big.Int
GetByVolumeCycleRewards get non nil big int from string
func (*DistributeConfig) GetDustRewardThreshold ¶ added in v0.1.4
func (dist *DistributeConfig) GetDustRewardThreshold() *big.Int
GetDustRewardThreshold get dust reward threshold
type ExchangeConfig ¶
type ExchangeConfig struct { Pairs string Exchange string Token string CreationHeight uint64 LiquidWeight uint64 TradeWeight uint64 }
ExchangeConfig exchange config
type GatewayConfig ¶
GatewayConfig struct
type MongoDBConfig ¶
type MongoDBConfig struct { DBURL string DBName string UserName string `json:"-"` Password string `json:"-"` }
MongoDBConfig mongodb config