You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. #! /bin/bash
  2. cd $GOPATH/src/github.com/tendermint/tendermint
  3. # specify a dir to copy
  4. # NOTE: eventually we should replace with `tendermint init --test`
  5. DIR=$HOME/.tendermint_test/consensus_state_test
  6. # XXX: remove tendermint dir
  7. rm -rf $HOME/.tendermint
  8. cp -r $DIR $HOME/.tendermint
  9. function reset(){
  10. rm -rf $HOME/.tendermint/data
  11. tendermint unsafe_reset_priv_validator
  12. }
  13. reset
  14. # empty block
  15. tendermint node --proxy_app=dummy &> /dev/null &
  16. sleep 5
  17. killall tendermint
  18. # /q would print up to and including the match, then quit.
  19. # /Q doesn't include the match.
  20. # http://unix.stackexchange.com/questions/11305/grep-show-all-the-file-up-to-the-match
  21. sed '/HEIGHT: 2/Q' ~/.tendermint/data/cs.wal/wal > consensus/test_data/empty_block.cswal
  22. reset
  23. # small block 1
  24. bash scripts/txs/random.sh 1000 36657 &> /dev/null &
  25. PID=$!
  26. tendermint node --proxy_app=dummy &> /dev/null &
  27. sleep 5
  28. killall tendermint
  29. kill -9 $PID
  30. sed '/HEIGHT: 2/Q' ~/.tendermint/data/cs.wal/wal > consensus/test_data/small_block1.cswal
  31. reset
  32. # small block 2 (part size = 512)
  33. echo "" >> ~/.tendermint/config.toml
  34. echo "block_part_size = 512" >> ~/.tendermint/config.toml
  35. bash scripts/txs/random.sh 1000 36657 &> /dev/null &
  36. PID=$!
  37. tendermint node --proxy_app=dummy &> /dev/null &
  38. sleep 5
  39. killall tendermint
  40. kill -9 $PID
  41. sed '/HEIGHT: 2/Q' ~/.tendermint/data/cs.wal/wal > consensus/test_data/small_block2.cswal
  42. reset