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.

19 lines
269 B

  1. #! /bin/bash
  2. set -u
  3. function toHex() {
  4. echo -n $1 | hexdump -ve '1/1 "%.2X"'
  5. }
  6. N=$1
  7. PORT=$2
  8. for i in `seq 1 $N`; do
  9. # store key value pair
  10. KEY="abcd$i"
  11. VALUE="dcba$i"
  12. echo "$KEY:$VALUE"
  13. curl 127.0.0.1:$PORT/broadcast_tx_sync?tx=\"$(toHex $KEY=$VALUE)\"
  14. done