tmux_sessions.sh 929 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. set -e
  3. # Start a tmux session with a consensus nodes and a faucet that's able to mint tokens.
  4. if [ "$1" = "-v" ]; then
  5. verbose="-v"
  6. shift
  7. else
  8. verbose=""
  9. fi
  10. if [ "$1" = "now" ]; then
  11. now="$(date +%s)"
  12. sed \
  13. -e 's/pub const SLOT_TIME: .*/pub const SLOT_TIME: u64 = 20;/' \
  14. -e 's/pub const FINAL_SYNC_DUR: .*/pub const FINAL_SYNC_DUR: u64 = 15;/' \
  15. -e "s/pub static ref TESTNET_GENESIS_TIMESTAMP: .*/pub static ref TESTNET_GENESIS_TIMESTAMP: Timestamp = Timestamp($now);/" \
  16. -e "s/pub static ref TESTNET_BOOTSTRAP_TIMESTAMP: .*/pub static ref TESTNET_BOOTSTRAP_TIMESTAMP: Timestamp = Timestamp($now);/" \
  17. -i ../../../src/consensus/constants.rs
  18. exit
  19. fi
  20. tmux new-session -d
  21. tmux send-keys "LOG_TARGETS='!sled,!net' ../../../darkfid ${verbose} -c darkfid0.toml" Enter
  22. sleep 10
  23. tmux split-window -v
  24. tmux send-keys "LOG_TARGETS='!sled,!net' ../../../faucetd ${verbose} -c faucetd.toml" Enter
  25. tmux attach