github.com/vipernet-xyz/tm@v0.34.24/scripts/txs/random.sh (about)

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