tmux_sessions.sh 950 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. set -e
  3. # Start a tmux session of four dchatd nodes.
  4. # Path to `dchat` binary
  5. DCHATD="../../../target/release/dchatd"
  6. session=dchatd
  7. if [ "$1" = "-vv" ]; then
  8. verbose="-vv"
  9. shift
  10. else
  11. verbose=""
  12. fi
  13. mkdir -p logs
  14. tmux new-session -d -s $session -n "seed"
  15. tmux send-keys -t $session "$DCHATD $verbose -c seed.toml 2>&1 | tee logs/seed.log" Enter
  16. sleep 1
  17. tmux new-window -t $session -n "node1"
  18. tmux send-keys -t $session "$DCHATD $verbose -c dchat1.toml 2>&1 | tee logs/dchat1.log" Enter
  19. sleep 1
  20. tmux new-window -t $session -n "node2"
  21. tmux send-keys -t $session "$DCHATD $verbose -c dchat2.toml 2>&1 | tee logs/dchat2.log" Enter
  22. sleep 1
  23. tmux new-window -t $session -n "node3"
  24. tmux send-keys -t $session "$DCHATD $verbose -c dchat3.toml 2>&1 | tee logs/dchat3.log" Enter
  25. sleep 1
  26. tmux new-window -t $session -n "node4"
  27. tmux send-keys -t $session "$DCHATD $verbose -c dchat4.toml 2>&1 | tee logs/dchat4.log" Enter
  28. tmux attach -t $session