tmux_sessions.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. set -e
  3. # Start a tmux session of four taud nodes, and four tau clients.
  4. # Path to used binaries
  5. TAUD="../../../taud"
  6. TAU_CLI="../../../bin/tau/tau-python"
  7. TAU="python $TAU_CLI/tau"
  8. # Source tau-cli python venv
  9. . $TAU_CLI/venv/bin/activate
  10. session=taud-local
  11. tmux new-session -d -s $session -n "seed"
  12. tmux send-keys -t $session "$TAUD --config seed.toml --skip-dag-sync" Enter
  13. sleep 1
  14. tmux new-window -t $session -n "node1"
  15. tmux send-keys -t $session "$TAUD --config taud_full_node1.toml --skip-dag-sync" Enter
  16. if [ "$1" ]; then
  17. tmux split-window -t $session -v
  18. tmux send-keys -t $session "$TAU -e 127.0.0.1:23341" Enter
  19. fi
  20. sleep 1
  21. tmux new-window -t $session -n "node2"
  22. tmux send-keys -t $session "$TAUD --config taud_full_node2.toml" Enter
  23. if [ "$1" ]; then
  24. tmux split-window -t $session -v
  25. tmux send-keys -t $session "$TAU -e 127.0.0.1:23342" Enter
  26. fi
  27. sleep 1
  28. tmux new-window -t $session -n "node3"
  29. tmux send-keys -t $session "$TAUD --config taud_full_node3.toml" Enter
  30. if [ "$1" ]; then
  31. tmux split-window -t $session -v
  32. tmux send-keys -t $session "$TAU -e 127.0.0.1:23343" Enter
  33. fi
  34. sleep 1
  35. tmux new-window -t $session -n "node4"
  36. tmux send-keys -t $session "$TAUD --config taud_full_node4.toml" Enter
  37. if [ "$1" ]; then
  38. tmux split-window -t $session -v
  39. tmux send-keys -t $session "$TAU -e 127.0.0.1:23344" Enter
  40. fi
  41. tmux attach -t $session