-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·37 lines (30 loc) · 1003 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
export $(xargs < .env)
while getopts c:w:g:n:d:a: flag
do
case "${flag}" in
c) command=${OPTARG};;
w) wallet=${OPTARG};;
g) grants=${OPTARG};;
n) node=${OPTARG};;
d) deposit=${OPTARG};;
a) amount=${OPTARG};;
esac
done
cd instruction-generator
cargo build
cd ../proposal-creator
cargo build
cd ../
if [ $command == "create-proposal" ]
then
cd instruction-generator && cargo r -- -w $wallet grant -g $grants && cd ../proposal-creator && cargo r -- -w $wallet -n $node create-proposal -i ../instructions.json && cd ../
elif [ $command == "execute" ]
then
cd proposal-creator && cargo r -- -w $wallet -n $node execute -t ../transaction_to_execute.json && cd ../
elif [ $command == "withdraw" ]
then
cd instruction-generator && cargo r -- -w $wallet withdraw -d $deposit -a $amount && cd ../proposal-creator && cargo r -- -w $wallet -n $node execute-withdraw -i ../withdraw.json && cd ../
else
echo "Unknow command"
fi