Преглед изворни кода

contrib/localnet/darkfid-small: use daemons folders for their logs

skoupidi пре 6 месеци
родитељ
комит
f720977642

+ 2 - 0
contrib/localnet/darkfid-small/.gitignore

@@ -1,3 +1,5 @@
 darkfid0
 darkfid1
 darkfid2
+drk0
+drk1

+ 1 - 1
contrib/localnet/darkfid-small/clean.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
-rm -rf darkfid0 darkfid1 darkfid2 drk0 drk1 drk2 darkfid0.log darkfid1.log darkfid2.log
+rm -rf darkfid0 darkfid1 darkfid2 drk0 drk1
 sed -i -e "s|XMRIG_USER0=.*|XMRIG_USER0=\"DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf\"|g" tmux_sessions.sh
 sed -i -e "s|XMRIG_USER1=.*|XMRIG_USER1=\"Dae4FtyzrnQ8JNuui5ibZL4jXUR786PbyjwBsq4aj6E1RPPYjtXLfnAf\"|g" tmux_sessions.sh
 sed -i -e "s|XMRIG_USER0=.*|XMRIG_USER0=\"DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf\"|g" reorg-test.sh

+ 0 - 26
contrib/localnet/darkfid-small/drk2.toml

@@ -1,26 +0,0 @@
-## drk configuration file
-##
-## Please make sure you go through all the settings so you can configure
-## your daemon properly.
-##
-## The default values are left commented. They can be overridden either by
-## uncommenting, or by using the command-line.
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Path to blockchain cache database
-cache_path = "drk2/cache"
-# Path to wallet database
-wallet_path = "drk2/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "testing"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48345"
-
-# Path to interactive shell history file
-history_path = "drk2/history.txt"

+ 3 - 3
contrib/localnet/darkfid-small/reorg-test.sh

@@ -50,7 +50,7 @@ tmux send-keys -t "$session:node0.1" C-c
 sleep 5
 echo "===========[Restarting Node1]================"
 sed -i -e "s|skip_sync =.*|skip_sync = true|g" darkfid1.toml
-tmux send-keys -t "$session:node1.1" "$DARKFID -c darkfid1.toml $verbose -l darkfid1.log" Enter
+tmux send-keys -t "$session:node1.1" "$DARKFID -c darkfid1.toml $verbose -l darkfid1/darkfid.log" Enter
 tmux send-keys -t "$session:node1.0" "$XMRIG -u x+1 -r 1000 -R 20 -o 127.0.0.1:48447 -t 2 -u $XMRIG_USER1" Enter
 sleep 2
 
@@ -59,9 +59,9 @@ sh ./run-contract-test.sh "$DRK1"
 
 # Restart node0 and see reorg happening
 echo "=========[Restarting Node0 and Node2]========"
-tmux send-keys -t "$session:node0.1" "$DARKFID -c darkfid0.toml $verbose -l darkfid0.log" Enter
+tmux send-keys -t "$session:node0.1" "$DARKFID -c darkfid0.toml $verbose -l darkfid0/darkfid.log" Enter
 tmux send-keys -t "$session:node0.0" "$XMRIG -u x+1 -r 1000 -R 20 -o 127.0.0.1:48347 -t 2 -u $XMRIG_USER0" Enter
-tmux send-keys -t "$session:node2.0" "$DARKFID -c darkfid2.toml $verbose -l darkfid2.log" Enter
+tmux send-keys -t "$session:node2.0" "$DARKFID -c darkfid2.toml $verbose -l darkfid2/darkfid.log" Enter
 sleep 2
 
 # Test to check everything is working fine

+ 1 - 1
contrib/localnet/darkfid-small/run-contract-test.sh

@@ -122,4 +122,4 @@ TX_ID="$(register_call "$DRK" "$CONTRACT_ADDRESS" "$SECRET_KEY")"
 wait_tx "$DRK" "$TX_ID"
 
 TX_ID="$(deregister_call "$DRK" "$CONTRACT_ADDRESS" "$SECRET_KEY")"
-wait_tx "$DRK" "$TX_ID"
+wait_tx "$DRK" "$TX_ID"

+ 6 - 3
contrib/localnet/darkfid-small/tmux_sessions.sh

@@ -4,6 +4,9 @@ set -e
 # Start a tmux session with two mining and a non-mining darkfid nodes.
 # Additionally, start two xmrig daemons.
 
+# Generate each node folder
+mkdir -p darkfid0 darkfid1 darkfid2
+
 # Path to used binaries
 XMRIG="xmrig"
 DARKFID="LOG_TARGETS='!sled' ../../../darkfid"
@@ -24,11 +27,11 @@ fi
 tmux new-session -d -s $session -n "node0"
 tmux send-keys -t $session "$XMRIG -u x+1 -r 1000 -R 20 -o 127.0.0.1:48347 -t 2 -u $XMRIG_USER0" Enter
 tmux split-window -t $session -v -l 80%
-tmux send-keys -t $session "$DARKFID -c darkfid0.toml $verbose -l darkfid0.log" Enter
+tmux send-keys -t $session "$DARKFID -c darkfid0.toml $verbose -l darkfid0/darkfid.log" Enter
 tmux new-window -t $session -n "node1"
 tmux send-keys -t $session "$XMRIG -u x+1 -r 1000 -R 20 -o 127.0.0.1:48447 -t 2 -u $XMRIG_USER1" Enter
 tmux split-window -t $session -v -l 80%
-tmux send-keys -t $session "$DARKFID -c darkfid1.toml $verbose -l darkfid1.log" Enter
+tmux send-keys -t $session "$DARKFID -c darkfid1.toml $verbose -l darkfid1/darkfid.log" Enter
 tmux new-window -t $session -n "node2"
-tmux send-keys -t $session "$DARKFID -c darkfid2.toml $verbose -l darkfid2.log" Enter
+tmux send-keys -t $session "$DARKFID -c darkfid2.toml $verbose -l darkfid2/darkfid.log" Enter
 tmux attach -t $session