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
288 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=$(head -c 10 /dev/urandom)
  11. VALUE="$i"
  12. echo $(toHex $KEY=$VALUE)
  13. curl 127.0.0.1:$PORT/broadcast_tx_sync?tx=0x$(toHex $KEY=$VALUE)
  14. done