diff --git a/network-to-config.sh b/network-to-config.sh new file mode 100755 index 00000000..2e475c01 --- /dev/null +++ b/network-to-config.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Check if JSON file is provided +if [ -z "$1" ]; then + echo "Usage: $0 [key2 ...]" + exit 1 +fi + +BASEPATH="$(dirname "$0")" + +JSON_FILE="$BASEPATH/reference-rpc-endpoint.json" +shift + +# Extract values under 'default' or 'archive' attributes for given keys +jq --argfile input "$JSON_FILE" '. as $in | ($IN.input | select(has("default")) | .default[]) + ($IN.input | select(has("archive")) | .archive[])' "$@"