Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyLogLevel()
- func ByteToUint(buff []byte) uint32
- func ConfigBaseDir() string
- func FileExists(fileName string) (os.FileInfo, bool)
- func GetInt(db *leveldb.DB, key string) uint64
- func GetJsonObj(db *leveldb.DB, key []byte, v interface{}) error
- func GetSavedConn(rAddr string) (net.Conn, error)
- func GetSavedTypedConn(network, rAddr string) (net.Conn, error)
- func GetString(db *leveldb.DB, key string) string
- func InitLog(logPath string)
- func InitSettings()
- func JoinHostPort(h string, p uint16) string
- func MaxInt64(a, b *big.Int) *big.Int
- func MinInt(a, b int) int
- func ReadPassWord2() (string, error)
- func SaveInt(db *leveldb.DB, key string, val uint64) error
- func SaveJsonObj(db *leveldb.DB, key []byte, v interface{}) error
- func SaveString(db *leveldb.DB, key string, val string) error
- func SetModuleLogLevel(level logging.Level, module string)
- func ShowConfig() string
- func TouchDir(dir string) error
- func UintToByte(val uint32) []byte
- type ConnSaver
- type EthereumConfig
- type PoolConfig
- type SysConfig
- type SystemSetting
- type Thread
- type ThreadExit
- type ThreadPool
- type ThreadRun
Constants ¶
View Source
const ( MainNetworkId = 1 RopstenNetworkId = 3 TokenDecimal = 18 )
View Source
const ( CurrentVersion = "0.1.0" CmdServicePort = "42018" ConfigDirectory = ".pool" DefaultSystemLogLevel = logging.INFO DefaultBaseIP = "167.179.112.108" LMPool = "pool" LMBlockChain = "blockChain" LMCMD = "cmd" TxReceivePort = "32020" ReceiptSyncPort = "32021" ConfFileName = "conf.json" LogFileName = "hop.log" PIDFileName = "pid" WalletFileName = "wallet.json" DatabaseFileName = "database" TimeFormat = "2006-01-02 15:04:05" )
View Source
const PipeDialTimeOut = time.Second * 2
Variables ¶
View Source
var ( LogModules = []string{ LMPool, LMBlockChain, LMCMD, } )
View Source
var SysConf = &SysConfig{}
View Source
var SysSetting = &SystemSetting{ DebugMode: false, LogLevel: DefaultSystemLogLevel, EthApiConf: nil, }
Functions ¶
func ApplyLogLevel ¶
func ApplyLogLevel()
func ByteToUint ¶
func ConfigBaseDir ¶
func ConfigBaseDir() string
func InitSettings ¶
func InitSettings()
func JoinHostPort ¶
func ReadPassWord2 ¶
func SetModuleLogLevel ¶
func SetModuleLogLevel(level logging.Level, module string)
func ShowConfig ¶
func ShowConfig() string
func UintToByte ¶
Types ¶
type EthereumConfig ¶
type EthereumConfig struct { NetworkID int `json:"id"` EthApiUrl string `json:"apiUrl"` MicroPaySys common.Address `json:"paymentService"` Token common.Address `json:"token"` }
func (*EthereumConfig) String ¶
func (ec *EthereumConfig) String() string
type PoolConfig ¶
type PoolConfig struct { Version string `json:"version"` BASIP string `json:"basip"` EthConf map[int]*EthereumConfig `json:"ethereum"` }
type SysConfig ¶
type SystemSetting ¶
type SystemSetting struct { PoolVersion string BASIP string DebugMode bool LogLevel logging.Level EthApiConf *EthereumConfig }
func (*SystemSetting) String ¶
func (ss *SystemSetting) String() string
type Thread ¶
type Thread struct { ID interface{} Runner ThreadRun ErrFun ThreadExit StopSig chan struct{} }
func NewThread ¶
func NewThread(r ThreadRun, e ThreadExit) *Thread
func NewThreadWithID ¶
func NewThreadWithID(id interface{}, r ThreadRun, e ThreadExit) *Thread
type ThreadExit ¶
type ThreadExit func(interface{})
type ThreadPool ¶
type ThreadPool struct { Pool map[interface{}]*Thread // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.