Skip to content

Instantly share code, notes, and snippets.

@juanmardefago
Created October 30, 2020 17:11
Show Gist options
  • Save juanmardefago/84d4b792e1dcd4b0c92f23df1c3e5731 to your computer and use it in GitHub Desktop.
Save juanmardefago/84d4b792e1dcd4b0c92f23df1c3e5731 to your computer and use it in GitHub Desktop.
Cost model batch deployment tool
OLDIFS=$IFS
IFS=','
[ -z $1 ] && { echo "CSV file with subgraph hashes not supplied"; exit 99; }
[ -z $2 ] && { echo "Cost model file not supplied"; exit 99; }
[ ! -f $1 ] && { echo "$1 file not found"; exit 99; }
[ ! -f $2 ] && { echo "$2 file not found"; exit 99; }
while read subgraphId
do
echo "subgraph id detected: $subgraphId"
graph indexer cost set model $subgraphId $2
echo "cost model $2 set for subgraph $subgraphId"
done < $1
IFS=$OLDIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment