Prathamesh Musale
becb8af290
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675) Reviewed-on: #6 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
21 lines
565 B
Bash
Executable File
21 lines
565 B
Bash
Executable File
|
|
#!/bin/bash
|
|
|
|
# Exit on error
|
|
set -e
|
|
set -u
|
|
|
|
# Check args
|
|
if [ "$#" -ne 2 ]; then
|
|
echo "Usage: $0 <bridge-deployment-dir-absolute> <output_file>"
|
|
exit 1
|
|
fi
|
|
|
|
BRIDGE_DEPLOYMENT_DIR="$1"
|
|
OUTPUT_FILE="$2"
|
|
|
|
# Run the nitro-rpc-client command and process the output with jq
|
|
laconic-so deployment --dir $BRIDGE_DEPLOYMENT_DIR exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge" | jq -s '[.[] | {nitro_address: .Balance.Them, balance: .Balance.TheirBalance}]' > "$OUTPUT_FILE"
|
|
|
|
echo "Ethereum account holdings exported to $OUTPUT_FILE"
|