From a815008c039b02ada731ad92bdcd88db69df5239 Mon Sep 17 00:00:00 2001 From: Robert Martin-Legene <robert@nic.ar> Date: Mon, 23 Jul 2018 18:01:11 -0300 Subject: [PATCH] numpending.sh shows how many transactions are pending on the local node --- bin/numpending.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 bin/numpending.sh diff --git a/bin/numpending.sh b/bin/numpending.sh new file mode 100755 index 0000000..cd77368 --- /dev/null +++ b/bin/numpending.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi +source ${BFAHOME}/bin/libbfa.sh || exit 1 + +echo txpool.status.pending | geth_attach | grep -Ev '^> $' | tail -1 +exit + + +function json_query +{ + cmd=$1 + params=$2 + if [ -n "$params" ] + then + params=",\"parameters\":[$2]" + fi + json=$( + curl -s -H 'Content-type: application/json' -X POST --data "{\"jsonrpc\":\"2.0\",\"method\":\"${cmd}\"${params},\"id\":1}" http://127.0.0.1:$rpcport + ) +} + +bfaconfig node +json_query web3j_txpool +echo $json | jq +exit + -- GitLab