create account

The Last Launch Step - how the community takes over from eosio by cryptolions

View this thread on: hive.blogpeakd.comecency.com
· @cryptolions · (edited)
$18.21
The Last Launch Step - how the community takes over from eosio
## How do we propose / approve / execute  actions after launch without eosio?

Recently we've been testing different approaches to deploy, validate and stress a chain,but little attention was paid to the last steps, how to give up central control, and how to continue administration without central control.
The Main Steps of Launching are these:

- Run Bios node with fresh genesis and eosio key
- Deploy BIOS contract with initial producers
- Create system accounts
- Deploy eosio.token and eosio.msig contracts
- Create and issue tokens
- Deploy system contract and add privileges for eosio.msig
- Provide distribution RC20 tokens
- Resign eosio

Resigning eosio means changing rights for account eosio and all other system accounts.

That means that for user eosio, we set permission to eosio.prods@active . This is a system account with a list of active producers. You can check it with 

`/cleos.sh get account eosio.prods`

For all system accounts (eosio.bpay, eosio.msig, eosio.names, eosio.ram, eosio.ramfee, eosio.saving, eosio.stake, eosio.token, eosio.vpay) set permission active and owner permission to account eosio.

Example of resign script: https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/08_RESIGN.sh

After resignation, any changes, transfers, and contract updates can be done by community approval.

![photo_2018-06-04_16-10-31.jpg](https://cdn.steemitimages.com/DQmY4Hap3BPt9X7TfAUZsUW1VR3yZdAz7yhxqxYqJ9eGZYh/photo_2018-06-04_16-10-31.jpg)

## How to make a proposal for action without eosio

Lets do this with an example transaction, proposing to send a tranfer to user β€œsomeuser”.

To make the proposal we will use cleos and multisig propose command.

This command has these parameters:

```
proposal_name TEXT          proposal name (string) (required)
requested_permissions TEXT  The JSON string or filename defining requested permissions (required)
rx_permissions TEXT        he JSON string or filename defining transaction permissions (required)
contract TEXT               contract to wich deferred transaction should be delivered (required)
action TEXT                 action of deferred transaction (required)
data TEXT                   The JSON string or filename defining the action to propose (required)
proposer TEXT               Account proposing the transaction
proposal_expiration         Proposal expiration interval in hours
```

Since it will be transfer from eosio we need to include all active producers in requested_permissions. To do this lets create simple bash script which will create a list automatically  from 

`./cleos.sh get account eosio.prods –j`

(Note: We were NOT able to simply use eosio.prods with requested_permissions.  We had to generate the list with get account.)


```
requestedPermissions="";
#Get list active producers from eosio.prods and building requestedPermissions
PRODUCERS=$(./cleos.sh get account eosio.prods -j)

for row in $(echo "${PRODUCERS}" | jq -r '.permissions[] | @base64'); do
    _jq() {
     echo ${row} | base64 --decode | jq -r ${1}
    }

    perm_name=$(_jq '.perm_name')
    if [ "$perm_name" == "active" ]; then

        data_=$(_jq '.required_auth')
        for accs in $(echo "${data_}" | jq -r '.accounts[] | @base64'); do
                _jq() {
                echo ${accs} | base64 --decode | jq -r ${1}
            }
            account=$(_jq '.permission.actor')
            permission=$(_jq '.permission.permission')

            #bp="$account@$permission"

            # Building requestedPermissions
            requestedPermission='{"actor": "'$account'", "permission": "'$permission'"}'
            if [ "$requestedPermissions" != "" ]; then
                requestedPermissions+=", "
            fi
            requestedPermissions+="$requestedPermission"
        done
        requestedPermissions="[$requestedPermissions]"
        #echo $requestedPermissions
    fi
done
```

## Next, we will make a proposal for transfer (it can be any action to any contract):


```
CONTRACT="eosio.token"
ACTION="transfer"
DATA='{"from": "eosio", "to": "someuser", "quantity": "123.0000 EOS", "memo": "compensation"}'
```

 
The full command will be:


```
./cleos.sh multisig propose "$proposalName" "$requestedPermissions" "$trxPermissions" $CONTRACT $ACTION "$DATA" $proposer $EXPIRATION_IN_H -p $proposer
```

 
The full example script which does all of the above is found here: https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/16_1_MSIG_TRANSFER_PROPOSE.sh

## Approval

After a proposal is made, block producers from list need to approve this transaction.  The number of approvals required is determined by the threshold.

The approval command is: 

`./cleos.sh multisig approve $proposer $proposalName "$permissions" -p $ACCOUNT`

Full example: https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/16_2_MSIG_TRANSFER_APPROVE.sh

## Execution

After sufficient approvals are made, the transfer can be executed:
./cleos.sh multisig exec $proposer "$proposalName" -p $proposer

Example: https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/16_3_MSIG_TRANSFER_EXEC.sh

## List Proposals and approvals

You can list all proposals:

`./cleos.sh get table eosio.msig $ACCOUNT proposal`

And all approvals:

`./cleos.sh get table eosio.msig $ACCOUNT approvals`

<center>🦁🦁🦁</center>

We hope this manual was useful for you.

All our Bootsteps examples can be found here: https://github.com/CryptoLions/EOS-Boot-Steps-dawn4

Lastly, we welcome everyone to Jungle testnetwok, to learn and test together: http://jungle.cryptolions.io/

<center>🦁🦁🦁</center>

http://cryptolions.io/
https://github.com/CryptoLions
https://busy.org/@cryptolions
https://steemit.com/@cryptolions
https://twitter.com/EOS_CryptoLions
https://www.youtube.com/channel/UCB7F-KO0mmZ1yVBCq0_1gtA
Jungle Testnet Monitor: http://jungle.cryptolions.io/
General CryptoLions Chat: https://t.me/block_producer_candidate
Testnet Chat: https://t.me/jungletestnet
πŸ‘  , , , , , , , , , , , , , , , ,
properties (23)
authorcryptolions
permlinkthe-last-launch-step-how-to-resign-rights-or-eosio-and-manage-the-change-without-them
categoryeos
json_metadata{"tags":["eos","eosmainnet","cryptolions","jungletestnet"],"image":["https://cdn.steemitimages.com/DQmY4Hap3BPt9X7TfAUZsUW1VR3yZdAz7yhxqxYqJ9eGZYh/photo_2018-06-04_16-10-31.jpg"],"links":["https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/08_RESIGN.sh","https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/16_1_MSIG_TRANSFER_PROPOSE.sh","https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/16_2_MSIG_TRANSFER_APPROVE.sh","https://github.com/CryptoLions/EOS-Boot-Steps-dawn4/blob/master/16_3_MSIG_TRANSFER_EXEC.sh","https://github.com/CryptoLions/EOS-Boot-Steps-dawn4","http://jungle.cryptolions.io/","http://cryptolions.io/","https://github.com/CryptoLions","https://busy.org/@cryptolions","https://steemit.com/@cryptolions","https://twitter.com/EOS_CryptoLions","https://www.youtube.com/channel/UCB7F-KO0mmZ1yVBCq0_1gtA","https://t.me/block_producer_candidate","https://t.me/jungletestnet"],"app":"steemit/0.1","format":"markdown"}
created2018-06-04 13:23:57
last_update2018-06-04 14:03:21
depth0
children2
last_payout2018-06-11 13:23:57
cashout_time1969-12-31 23:59:59
total_payout_value13.764 HBD
curator_payout_value4.448 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,982
author_reputation486,995,178,958
root_title"The Last Launch Step - how the community takes over from eosio"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id59,204,235
net_rshares5,040,844,172,146
author_curate_reward""
vote details (17)
@eosemerge ·
wow, some impressive work done here!
πŸ‘  
properties (23)
authoreosemerge
permlinkre-cryptolions-the-last-launch-step-how-to-resign-rights-or-eosio-and-manage-the-change-without-them-20180604t134404059z
categoryeos
json_metadata{"tags":["eos"],"app":"steemit/0.1"}
created2018-06-04 13:44:06
last_update2018-06-04 13:44:06
depth1
children0
last_payout2018-06-11 13:44:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length36
author_reputation68,463,849,225
root_title"The Last Launch Step - how the community takes over from eosio"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id59,207,064
net_rshares587,438,063
author_curate_reward""
vote details (1)
@liondani ·
$0.03
Thanks for the post about EOS
πŸ‘  , , ,
properties (23)
authorliondani
permlinkre-cryptolions-the-last-launch-step-how-to-resign-rights-or-eosio-and-manage-the-change-without-them-20180607t021859358z
categoryeos
json_metadata{"tags":["eos"],"app":"steemit/0.1"}
created2018-06-07 02:19:00
last_update2018-06-07 02:19:00
depth1
children0
last_payout2018-06-14 02:19:00
cashout_time1969-12-31 23:59:59
total_payout_value0.025 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length29
author_reputation95,095,146,236,111
root_title"The Last Launch Step - how the community takes over from eosio"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id59,619,012
net_rshares10,466,834,286
author_curate_reward""
vote details (4)