-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_multi_sig.sh
executable file
·46 lines (38 loc) · 1.25 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
#!/bin/env bash
NETWORK=${1:-LOCAL}
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 [ ! -s $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json ]; then
eosc vault create --vault-file $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json --import
fi
if [ ! -s ${ACTIONS_DIR}/EOSIO_SYSTEM_v3.7.0.JSON ]; then
echo "ERROR: failed to find ${ACTIONS_DIR}/EOSIO_SYSTEM_v3.7.0.JSON EXITING"
exit
fi
# Error check on JSON
cat ${ACTIONS_DIR}/EOSIO_SYSTEM_v3.7.0.JSON | jq 1> /dev/null
if [ $? != 0 ]; then
echo "ERROR: invalid JSON for EOSIO_SYSTEM_v3.7.0.JSON EXITING"
exit
fi
eosc -u $ENDPOINT multisig propose $ACCOUNT enfsys.erm \
${ACTIONS_DIR}/EOSIO_SYSTEM_v3.7.0.JSON \
--request-producers --vault-file $HOME/eosio-wallet/.eosc-vault-${ACCOUNT}.json