tmux_sessions.sh 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Start a tmux session of four darkirc nodes, and optionally four weechat clients.
  3. set -e
  4. tmux new-session -s "darkirc" -n "darkirc" -d
  5. tmux send-keys "../../../../darkirc --config seed.toml --skip-dag-sync" Enter && sleep 1
  6. tmux split-window -h
  7. tmux send-keys "../../../../darkirc --config darkirc_full_node1.toml --skip-dag-sync" Enter && sleep 1
  8. tmux split-window -h
  9. tmux send-keys "../../../../darkirc --config darkirc_full_node2.toml" Enter
  10. tmux select-pane -t 0
  11. tmux split-window -v
  12. tmux send-keys "../../../../darkirc --config darkirc_full_node3.toml" Enter
  13. tmux select-pane -t 2
  14. tmux split-window -v
  15. tmux send-keys "../../../../darkirc --config darkirc_full_node4.toml" Enter
  16. if [ -z "$1" ]; then
  17. tmux new-window -t "darkirc:1" -n "weechat"
  18. tmux send-keys "weechat -t -r '/server add darkirc_a 127.0.0.1/22022 -notls;/connect darkirc_a;/nick Alice'" Enter
  19. tmux split-window -v
  20. tmux send-keys "weechat -t -r '/server add darkirc_b 127.0.0.1/22023 -notls;/connect darkirc_b;/nick Bob'" Enter
  21. tmux split-window -h
  22. tmux send-keys "weechat -t -r '/server add darkirc_c 127.0.0.1/22024 -notls;/connect darkirc_c;/nick Charlie'" Enter
  23. tmux select-pane -t 0
  24. tmux split-window -h
  25. tmux send-keys "weechat -t -r '/server add darkirc_d 127.0.0.1/22025 -notls;/connect darkirc_d;/nick Dave'" Enter
  26. fi
  27. tmux attach