-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_multi_sig.sh
executable file
·75 lines (66 loc) · 2.29 KB
/
send_multi_sig.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/env bash
NETWORK=${1:-LOCAL}
DO_SWITCH=${2:-NO}
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ACTIONS_DIR="${SCRIPT_DIR}/actions"
if [ ! -d $ACTIONS_DIR ]; then
echo "${ACTIONS_DIR} does not exist"
exit
fi
ENDPOINT=http://127.0.0.1:8888
ACCOUNT=spaceranger1
if [ $NETWORK == "JUNGLE" ]; then
ENDPOINT=https://jungle4.cryptolions.io:443
ACCOUNT=hokieshokies
fi
if [ $NETWORK == "KYLIN" ]; then
ENDPOINT=https://api.kylin.alohaeos.com
ACCOUNT=spacerang.gm
fi
if [ $NETWORK == "MAINNET" ]; then
ENDPOINT=https://eos.api.eosnation.io
ACCOUNT=proposer.enf
fi
if [ $DO_SWITCH != "YES" ]; then
if [ ! -s .eosc-vault-${ACCOUNT}.json ]; then
eosc vault create --vault-file $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json --import
fi
if [ ! -s ${ACTIONS_DIR}/PREPARE_SAVANNA_ACTIONS.json ]; then
echo "ERROR: failed to find ${ACTIONS_DIR}/PREPARE_SAVANNA_ACTIONS.json EXITING"
exit
fi
cat ${ACTIONS_DIR}/PREPARE_SAVANNA_ACTIONS.json | jq 1> /dev/null
if [ $? != 0 ]; then
echo "ERROR: invalid JSON for PREPARE_SAVANNA_ACTIONS.json EXITING"
exit
fi
eosc -u $ENDPOINT multisig propose $ACCOUNT spr1.feature \
${ACTIONS_DIR}/PREPARE_SAVANNA_ACTIONS.json \
--request-producers --vault-file $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json
if [ ! -s ${ACTIONS_DIR}/SETCONTRACT.json ]; then
echo "ERROR: failed to find ${ACTIONS_DIR}/SETCONTRACT.json EXITING"
exit
fi
cat ${ACTIONS_DIR}/SETCONTRACT.json | jq 1> /dev/null
if [ $? != 0 ]; then
echo "ERROR: invalid JSON for SETCONTRACT.json EXITING"
exit
fi
eosc -u $ENDPOINT multisig propose $ACCOUNT spr2.contrac \
${ACTIONS_DIR}/SETCONTRACT.json \
--request-producers --vault-file $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json
fi
if [ $DO_SWITCH == "YES" ]; then
if [ ! -s ${ACTIONS_DIR}/SWITCH_TO_SVNN.json ]; then
echo "ERROR: failed to find ${ACTIONS_DIR}/SWITCH_TO_SVNN.json EXITING"
exit
fi
cat ${ACTIONS_DIR}/SWITCH_TO_SVNN.json | jq 1> /dev/null
if [ $? != 0 ]; then
echo "ERROR: invalid JSON for SWITCH_TO_SVNN.json EXITING"
exit
fi
eosc -u $ENDPOINT multisig propose $ACCOUNT spr3.switcht \
${ACTIONS_DIR}/SWITCH_TO_SVNN.json \
--request-producers --vault-file $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json
fi