From f763a9ef5631a6d3c0fdff0594cb403e3d2f6a9e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 16 Nov 2016 01:32:13 -0500 Subject: [PATCH] scripts/txs/random.sh --- scripts/txs/random.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/txs/random.sh diff --git a/scripts/txs/random.sh b/scripts/txs/random.sh new file mode 100644 index 000000000..742d981c2 --- /dev/null +++ b/scripts/txs/random.sh @@ -0,0 +1,19 @@ +#! /bin/bash +set -u + +function toHex() { + echo -n $1 | hexdump -ve '1/1 "%.2X"' +} + +N=$1 +PORT=$2 + +for i in `seq 1 $N`; do + # store key value pair + KEY="abcd$i" + VALUE="dcba$i" + echo "$KEY:$VALUE" + curl 127.0.0.1:$PORT/broadcast_tx_sync?tx=\"$(toHex $KEY=$VALUE)\" +done + +