Skip to content

Commit

Permalink
Configure initial delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
novalis committed May 17, 2022
1 parent 679e772 commit a130782
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion charts/tezos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ should_generate_unsafe_deterministic_data: false
# can be given a bootstrap balance and can also be configured to be bootstrap
# baker accounts. Accounts with balances set to "0" will be imported by the
# node but they will not be bootstrap accounts. If you don't set a bootstrap
# balance, it will default to the `bootstrap_mutez` field above.
# balance, it will default to the `bootstrap_mutez` field above. The `delegate_to`
# field names another account that this account will delegate to.
#
accounts: {}
# baker0:
Expand All @@ -60,6 +61,7 @@ accounts: {}
# type: public
# is_bootstrap_baker_account: false
# bootstrap_balance: "4000000000000"
# delegate_to: baker0

## NODES
##
Expand Down
7 changes: 6 additions & 1 deletion utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,12 @@ def get_genesis_accounts_pubkey_and_balance(accounts):
key = v.get("pkh")
else:
key = v.get("pk")
pubkey_and_balance_pairs.append([key, v["bootstrap_balance"]])
delegate = v.get("delegate_to")
if delegate:
baker_key = accounts[delegate].get("pkh")
pubkey_and_balance_pairs.append([key, v["bootstrap_balance"], baker_key])
else:
pubkey_and_balance_pairs.append([key, v["bootstrap_balance"]])

return pubkey_and_balance_pairs

Expand Down

0 comments on commit a130782

Please sign in to comment.