Change --datadir to --appdir and remove symmetrical connection in stability tests (#1617)

* Don't do simetric connects in netsync stability test

* Convert --datadir to --appdir everywhere

Co-authored-by: Ori Newman <orinewman1@gmail.com>
This commit is contained in:
Svarog 2021-03-17 17:34:03 +02:00 committed by GitHub
parent cebcab7f5c
commit 7d69b66c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 15 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
rm -rf /tmp/kaspad-temp
kaspad --devnet --nobanning --datadir=/tmp/kaspad-temp --profile=6061 --loglevel=debug &
kaspad --devnet --nobanning --appdir=/tmp/kaspad-temp --profile=6061 --loglevel=debug &
KASPAD_PID=$!
KASPAD_KILLED=0
function killKaspadIfNotKilled() {

View File

@ -1,7 +1,7 @@
#!/bin/bash
rm -rf /tmp/kaspad-temp
kaspad --devnet --nobanning --datadir=/tmp/kaspad-temp --profile=6061 &
kaspad --devnet --nobanning --appdir=/tmp/kaspad-temp --profile=6061 &
KASPAD_PID=$!
sleep 1

View File

@ -1,9 +1,9 @@
# Kaspad Sanity tool
This tries to run kapad with different sets of arguments for sanity.
In order to get clean run for each command, the tool injects its own --datadir
In order to get clean run for each command, the tool injects its own --appdir
argument so it will be able to clean it between runs, so it's forbidden to use
--datadir as part of the arguments set.
--appdir as part of the arguments set.
## Running
1. `go install` kaspad and kaspadsanity.

View File

@ -72,9 +72,9 @@ func commandLoop(argsChan <-chan []string) ([]commandFailure, error) {
func handleDataDirArg(args []string, dataDir string) ([]string, error) {
for _, arg := range args {
if strings.HasPrefix(arg, "--datadir") {
return nil, errors.New("invalid argument --datadir")
if strings.HasPrefix(arg, "--appdir") {
return nil, errors.New("invalid argument --appdir")
}
}
return append([]string{"--datadir", dataDir}, args...), nil
return append([]string{"--appdir", dataDir}, args...), nil
}

View File

@ -31,14 +31,16 @@ func startNode(name string, rpcAddress, listen, connect, profilePort, dataDir st
args := []string{
"kaspad",
common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()),
"--datadir", dataDir,
"--appdir", dataDir,
"--logdir", dataDir,
"--rpclisten", rpcAddress,
"--listen", listen,
"--connect", connect,
"--profile", profilePort,
"--loglevel", "debug",
}
if connect != "" {
args = append(args, "--connect", connect)
}
if activeConfig().OverrideDAGParamsFile != "" {
args = append(args, "--override-dag-params-file", activeConfig().OverrideDAGParamsFile)
@ -132,7 +134,7 @@ func setupSyncer() (*rpc.Client, func(), error) {
return nil, nil, err
}
rpcClient, teardown, err := setupNodeWithRPC("SYNCER", syncerListen, syncerRPCAddress, syncedListen,
rpcClient, teardown, err := setupNodeWithRPC("SYNCER", syncerListen, syncerRPCAddress, "",
syncerProfilePort, syncerDataDir)
if err != nil {
return nil, nil, err

View File

@ -1,7 +1,7 @@
#!/bin/bash
rm -rf /tmp/kaspad-temp
kaspad --devnet --datadir=/tmp/kaspad-temp --profile=6061 &
kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 &
KASPAD_PID=$!
sleep 1

View File

@ -2,7 +2,7 @@
rm -rf /tmp/kaspad-temp
NUM_CLIENTS=1000
kaspad --devnet --datadir=/tmp/kaspad-temp --profile=6061 --rpcmaxwebsockets=$NUM_CLIENTS &
kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --rpcmaxwebsockets=$NUM_CLIENTS &
KASPAD_PID=$!
KASPAD_KILLED=0
function killKaspadIfNotKilled() {

View File

@ -1,7 +1,7 @@
#!/bin/bash
rm -rf /tmp/kaspad-temp
kaspad --devnet --datadir=/tmp/kaspad-temp --profile=6061 --loglevel=debug &
kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --loglevel=debug &
KASPAD_PID=$!
sleep 1

View File

@ -39,7 +39,7 @@ func startNodes() (teardown func(), err error) {
syncerCmd, err := common.StartCmd("KASPAD-SYNCER",
"kaspad",
common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()),
"--datadir", syncerDataDir,
"--appdir", syncerDataDir,
"--logdir", syncerDataDir,
"--rpclisten", syncerRPCAddress,
"--listen", syncerListen,
@ -52,7 +52,7 @@ func startNodes() (teardown func(), err error) {
syncedCmd, err := common.StartCmd("KASPAD-SYNCED",
"kaspad",
common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()),
"--datadir", syncedDataDir,
"--appdir", syncedDataDir,
"--logdir", syncedDataDir,
"--rpclisten", syncedRPCAddress,
"--listen", syncedListen,