mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Unfinished code. * Update the testnet version to testnet-5. (#1683) * Generalize stability-tests/docker/Dockerfile. (#1685) * Committed for rebasing. * Adds stability-test many-tips, which tests kaspad handling with many tips in the DAG. * Delete manytips_test.go. * Add timeout to the test and create only one RPC client. * Place the spawn before the for loop and remove a redundant condition. Co-authored-by: tal <tal@daglabs.com> Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
package main
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/jessevdk/go-flags"
|
|
"github.com/kaspanet/kaspad/infrastructure/config"
|
|
"github.com/kaspanet/kaspad/stability-tests/common"
|
|
)
|
|
|
|
const (
|
|
defaultLogFilename = "many_tips.log"
|
|
defaultErrLogFilename = "many_tips_err.log"
|
|
)
|
|
|
|
var (
|
|
// Default configuration options
|
|
defaultLogFile = filepath.Join(common.DefaultAppDir, defaultLogFilename)
|
|
defaultErrLogFile = filepath.Join(common.DefaultAppDir, defaultErrLogFilename)
|
|
)
|
|
|
|
type configFlags struct {
|
|
LogLevel string `short:"d" long:"loglevel" description:"Set log level {trace, debug, info, warn, error, critical}"`
|
|
NumberOfBlocks uint64 `short:"n" long:"numblocks" description:"Number of blocks to mine" required:"false"`
|
|
Profile string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536"`
|
|
config.NetworkFlags
|
|
}
|
|
|
|
var cfg *configFlags
|
|
|
|
func activeConfig() *configFlags {
|
|
return cfg
|
|
}
|
|
|
|
func parseConfig() error {
|
|
cfg = &configFlags{}
|
|
parser := flags.NewParser(cfg, flags.PrintErrors|flags.HelpFlag)
|
|
_, err := parser.Parse()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = cfg.ResolveNetwork(parser)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
initLog(defaultLogFile, defaultErrLogFile)
|
|
|
|
return nil
|
|
}
|