A shell script that calculates the total POKT balance across multiple POKT addresses, including wallet balances, app staked tokens, and node staked tokens.
- Parallel processing of multiple addresses for faster results
- Real-time balance updates with progress spinner
- Handles wallet balances, app stakes, and node stakes
- Error handling for invalid or missing data
The script requires the following dependencies:
bash
(version 4 or later)parallel
- for processing multiple addresses concurrentlyjq
- for parsing JSON responsesbc
- for decimal arithmeticpocket
- https://github.com/pokt-network/pocket-core
- Clone or download the script
- Make it executable:
chmod +x pokt-treasury-tool.sh
Run the script by providing an address file and POKT RPC endpoint (which you can get with a free account at https://portal.grove.city):
./pokt-treasury-tool.sh <addresses_file> <POKT_URL>
addresses_file
: Text file containing one POKT address per linePOKT_URL
: URL for the POKT RPC endpoint
./pokt-treasury-tool addresses.txt https://pocket.rpc.gorve.city/v1/<your_app_id>
Create a text file with one POKT address per line:
addr1...
addr2...
addr3...
The script provides:
- Real-time running total with progress indicator
- Final total balance in POKT with comma formatting
- All balances are converted from uPOKT to POKT automatically
Example output:
[✓] Total: 5,169,682.44 POKT
The script includes robust error handling for:
- Invalid or missing addresses
- Network connection issues
- Invalid JSON responses
- Missing or null values in responses
- Non-numeric data
If you encounter issues:
- Verify your addresses file format
- Check your RPC endpoint connectivity
- Ensure the pocket CLI tool is properly configured
- Verify all dependencies are installed
This script is available under the MIT license.
Special thanks to Fred Teumer for making the first version of this script, which was used as inspiration for this final version.