-
Notifications
You must be signed in to change notification settings - Fork 95
Query Transfer History
Lars Kuhtz edited this page Mar 23, 2021
·
1 revision
This gist contains a bash script for efficiently querying Pact TRANSFER
events.
It can be used as follows from a bash
command line:
-
Make sure that
git
,curl
, andjq
are installed -
Clone and install the script:
git clone https://gist.github.com/068e28540ba8309362f6bde141d71c65.git transfer-history` cd transfer-history
-
List
TRANSFER
events:CHAIN=1 bash ./transfers.sh
This will query all
TRANSFER
events for that last 100 blocks on chain 1.It is possible to select a different block height range by setting
MINHEIGHT
andMAXHEIGHT
environment variables:CHAIN=1 MINHEIGHT=1467781 MAXHEIGHT=1469781 bash ./transfers.sh
the default
MAXHEIGHT
value is the height of the latest block. The defaultMINHEIGHT
value is theMAXHEIGHT-100
.
The script can be easily adapted to query different kinds of events, change the output format, include additional information from transaction outputs, or connect to a chainweb node other than api.chainweb.com.