forked from edenia/eden-delegates-msig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-delegates.sh
executable file
·36 lines (28 loc) · 1.31 KB
/
update-delegates.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
#/bin/sh
# Set EOS Mainnet API to your favorite node.
API="https://eos.greymass.com"
# Get user input
echo "You may need to set the delegates accounts first - check the contents of current-eden-delegates.json and new-delegates.json files."
echo ""
read -p "Enter the name and permission of the proposing account (e.g. account@active):" PROPOSER
read -p "Enter the name of the proposal: " PROPOSAL
echo ""
# Confirm transaction details:
read -p "You ($PROPOSER) are creating a proposal called $PROPOSAL to udpate genesis.eden active permisions - if correct press enter. "
# Make temp dir for storing files
mkdir -p ./tmp
TEMP_DIR=./tmp
# Propose MSIG
echo 'creating updateauth action...'
cleos -u $API multisig propose $PROPOSAL current-eden-delegates.json -x "3600" -s -d -j \
'[
{"actor": "genesis.eden", "permission": "active"}
]' \
eosio updateauth new-delegates.json -s -d -j -p $PROPOSER > $TEMP_DIR/permissions.json
# Get required data from permission action
echo 'meging actions...'
jq -s '[.[].actions[]]' $TEMP_DIR/permissions.json >$TEMP_DIR/proposal-actions.json
echo 'creating transaction...'
jq '.actions = input' $TEMP_DIR/permissions.json $TEMP_DIR/proposal-actions.json >$TEMP_DIR/proposal-trasaction.json
echo 'signing transaction...'
cleos -u $API push transaction $TEMP_DIR/proposal-trasaction.json -p $PROPOSER