Svarog a8a7e3dd9b
Add windows to the CI + fix errors when testing on Windows (#1674)
* Add windows to the CI

* Cast syscall.Stdin into an integer

* DataDir -> AppDir in service_windows.go

* Rename mempool-limits package to something non-main

* Close database after re-assigining to it

* Up rpcTimout to 10 seconds
2021-04-12 14:53:34 +03:00

45 lines
1.1 KiB
Go

package mempoollimits
import (
"path/filepath"
"github.com/jessevdk/go-flags"
"github.com/kaspanet/kaspad/stability-tests/common"
)
const (
defaultLogFilename = "mempool-limits.log"
defaultErrLogFilename = "mempool-limits_err.log"
)
var (
// Default configuration options
defaultLogFile = filepath.Join(common.DefaultAppDir, defaultLogFilename)
defaultErrLogFile = filepath.Join(common.DefaultAppDir, defaultErrLogFilename)
)
type configFlags struct {
LogLevel string `long:"loglevel" description:"Set log level {trace, debug, info, warn, error, critical}"`
Profile string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536"`
KaspadRPCAddress string `long:"rpc-address" description:"RPC address of the kaspad node"`
}
var cfg *configFlags
func activeConfig() *configFlags {
return cfg
}
func parseConfig() error {
cfg = &configFlags{}
parser := flags.NewParser(cfg, flags.PrintErrors|flags.HelpFlag|flags.IgnoreUnknown)
_, err := parser.Parse()
if err != nil {
return err
}
initLog(defaultLogFile, defaultErrLogFile)
return nil
}