-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cceb5a4
commit e62760a
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
green=`tput setaf 2` | ||
reset=`tput sgr0` | ||
|
||
source ./conf_private.sh | ||
source ./conf_dac.sh | ||
source ./conf.sh | ||
|
||
|
||
|
||
echo -e "\n\n----------------- UPDATING CONFIG -------------------\n\n"; | ||
|
||
run_cmd() { | ||
cmd="$1"; | ||
echo -e "\n\n >> ${green} Next command: $1 \n\n ${reset}"; | ||
#wait; | ||
#read -p "Press enter to continue ${reset}"; | ||
eval "cleos --wallet-url $WALLET_URL -u $API_URL $1"; | ||
} | ||
|
||
./msig/gen_requested_permissions.py | ||
|
||
run_cmd "push action -s -d -j daccustodian updateconfig dac_config2.json -p daccustodian@active > updateconfig.trx" | ||
run_cmd "multisig propose_trx updconfig ./requested_perms.json updateconfig.trx eosdaccustab" | ||
|
||
for x in {a..i} | ||
do | ||
CUST="eosdaccusta$x" | ||
run_cmd "multisig approve eosdaccustab updconfig '{\"actor\":\"$CUST\", \"permission\":\"active\"}' -p $CUST" | ||
done | ||
run_cmd "multisig exec eosdaccustab updconfig eosdaccustab" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["5000.0000 EOSDAC", 5, 12, 604800, "dacauthority", "eosdacthedac", 15, 3, 10, 9, 7, 7776000, "50.0000 EOS"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
green=`tput setaf 2` | ||
reset=`tput sgr0` | ||
|
||
source ./conf_private.sh | ||
source ./conf_dac.sh | ||
source ./conf.sh | ||
|
||
|
||
|
||
echo -e "\n\n----------------- FIRING CUSTODIAN -------------------\n\n"; | ||
|
||
run_cmd() { | ||
cmd="$1"; | ||
echo -e "\n\n >> ${green} Next command: $1 \n\n ${reset}"; | ||
#wait; | ||
#read -p "Press enter to continue ${reset}"; | ||
eval "cleos --wallet-url $WALLET_URL -u $API_URL $1"; | ||
} | ||
|
||
./msig/gen_requested_permissions.py | ||
|
||
cat requested_perms.json | ||
|
||
run_cmd "push action -s -d -j daccustodian firecust '[\"eosdaccustaa\"]' -p dacauthority@med > fire.trx" | ||
run_cmd "multisig propose_trx firecust ./requested_perms.json fire.trx eosdaccustab" | ||
|
||
for x in {a..i} | ||
do | ||
CUST="eosdaccusta$x" | ||
run_cmd "multisig approve eosdaccustab firecust '{\"actor\":\"$CUST\", \"permission\":\"active\"}' -p $CUST" | ||
done | ||
run_cmd "multisig exec eosdaccustab firecust eosdaccustab" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
import subprocess | ||
import json | ||
|
||
permission_act = 'dacauthority' | ||
api_url = 'http://127.0.0.1:8666' | ||
|
||
res = subprocess.check_output(['cleos', '-u', api_url, 'get', 'account', '-j', permission_act]) | ||
|
||
data = json.loads(res) | ||
|
||
|
||
permissions = data['permissions'] | ||
|
||
requested_permissions = [] | ||
|
||
for perm in permissions: | ||
|
||
if perm['perm_name'] == "high": | ||
|
||
acts = perm['required_auth']['accounts'] | ||
for act in acts: | ||
requested_permissions.append(act['permission']) | ||
break | ||
|
||
requested_permissions_json = json.dumps(requested_permissions) | ||
|
||
requested_permissions_fp = open("requested_perms.json", "w") | ||
requested_permissions_fp.write(requested_permissions_json) | ||
requested_permissions_fp.close() | ||
|
||
print("Wrote requested_perms.json") | ||
|