Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for back and forth send #12

Closed
wants to merge 22 commits into from
Closed
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions load-test/send_load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,32 @@ RPC="http://${IP}:${PORT}"
acc1=$($DAEMON keys show account$FROM -a --home $DAEMON_HOME-1 --keyring-backend test)
acc2=$($DAEMON keys show account$TO -a --home $DAEMON_HOME-1 --keyring-backend test)
seq1=$("${DAEMON}" q account "${acc1}" --node $RPC --output json)
seq2=$("${DAEMON}" q account "${acc2}" --node $RPC --output json)
seq1no=$(echo "${seq1}" | jq -r '.sequence')
bound=`expr 10000 + $seq1no`
for (( a=$seq1no; a<$bound; a++ ))
seq2no=$(echo "${seq2}" | jq -r '.sequence')
balance1=$("${DAEMON}" q bank balances "${acc1}" --node $RPC --output json)
balance1res=$(echo "${balance1}" | jq -r '.balances')
echo "** Balance of Account 1 before send_load :: $balance1res **"
balance2=$("${DAEMON}" q bank balances "${acc2}" --node $RPC --output json)
balance2res=$(echo "${balance1}" | jq -r '.balances')
echo "** Balance of Account 2 before send_load :: $balance2res **"
bound1=`expr 10000 + $seq1no`
bound2=`expr 10000 + $seq2no`
for (( a=$seq1no; a<$bound1; a++ ))
do
sTx=$("${DAEMON}" tx bank send "${acc1}" "${acc2}" 1000000"${DENOM}" --chain-id "${CHAINID}" --keyring-backend test --home $DAEMON_HOME-1 --node $RPC --output json -y --sequence $a)
sTxHash=$(echo "${sTx}" | jq -r '.txhash')
echo "** TX HASH :: $sTxHash **"
sTx=$("${DAEMON}" tx bank send "${acc1}" "${acc2}" 1000000"${DENOM}" --chain-id "${CHAINID}" --keyring-backend test --home $DAEMON_HOME-1 --node $RPC --output json -y --sequence $a &)
sTxHash=$(echo "${sTx}")
done

for (( b=$seq2no; b<$bound2; b++ ))
do
sTx=$("${DAEMON}" tx bank send "${acc2}" "${acc1}" 1000000"${DENOM}" --chain-id "${CHAINID}" --keyring-backend test --home $DAEMON_HOME-1 --node $RPC --output json -y --sequence $b &)
sTxHash=$(echo "${sTx}")
done

balance1=$("${DAEMON}" q bank balances "${acc1}" --node $RPC --output json)
balance1res=$(echo "${balance1}" | jq -r '.balances')
echo "** Balance of Account 1 after send_load :: $balance1res **"
balance2=$("${DAEMON}" q bank balances "${acc2}" --node $RPC --output json)
balance2res=$(echo "${balance1}" | jq -r '.balances')
echo "** Balance of Account 2 after send_load :: $balance2res **"