Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set genesis_accounts in ae instead of aettos #4367

Open
davidyuk opened this issue Jun 11, 2024 · 0 comments
Open

Allow to set genesis_accounts in ae instead of aettos #4367

davidyuk opened this issue Jun 11, 2024 · 0 comments
Labels
need/triage New issues which need to be categorized

Comments

@davidyuk
Copy link
Member

Currently, to create an account with 1000ae, I'm using

chain:
  genesis_accounts:
    ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E: 1000000000000000000000

would be good to avoid managing 18 zeroes somehow. For example to use scientific notation, like

chain:
  genesis_accounts:
    ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E: 1000.0e18

The problem is that the balance is parsed as float and gets rejected by the node

node-1      | 04:54:12.658 [info] Reading config file /home/aeternity/node/aeternity.yaml
node-1      | 04:54:12.666 [error] Validation failed, Pos: chain/genesis_accountsak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E | Value: 1.0e23 | Schema: {"description":"Token amount","type":"integer"} | Reason: Wrong type
node-1      | 04:54:12.666 [error] aeu_env:read_config()-> ERROR: validation_failed

The node may accept both integers and floats but ensure that the float can be converted to an integer without rounding.

Alternatively, the node may accept a specially-formatted string, like

chain:
  genesis_accounts:
    ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E: '1000ae'

However, it won't be compatible with custom chains that may use a different name and/or denomination.

@davidyuk davidyuk added the need/triage New issues which need to be categorized label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage New issues which need to be categorized
Projects
None yet
Development

No branches or pull requests

1 participant