fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd/scripts/fetch-account-holdings.sh
prathamesh0 06fedd6a03
Add scripts to generate a genesis file with allocations for enrolled participants (#2)
* Add script to generate validators using bridge node data

* Modify script to convert bridge node output to json array

* Add script to get address balance mapping from bridge node output

* Modify script to generate cosmos address to balance map

* Add scripts to generate genesis file with allocations

* Take deployment dir and eth account holdings file as inputs

* Add .gitignore

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2024-07-08 10:57:30 +05:30

23 lines
672 B
Bash
Executable File

#!/bin/bash
# Exit on error
set -e
# Note: Needs to be run in the go-nitro repository
# Example usage:
# In go-nitro
# /home/user/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd/scripts/fetch-account-holdings.sh eth-account-holdings.json
# Check if output file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <output_file>"
exit 1
fi
OUTPUT_FILE=$1
# Run the nitro-rpc-client command and process the output with jq
npm exec -c "nitro-rpc-client get-all-ledger-channels -p 4006" | jq -s '[.[] | {ethereum_address: .Balance.Them, balance: .Balance.TheirBalance}]' > "$OUTPUT_FILE"
echo "Ethereum account holdings exported to $OUTPUT_FILE"