atomone-hub / govgen-genesis

GovGen Genesis Creation
Apache License 2.0
1 stars 1 forks source link

GovGen Genesis

This repo is dedicated to the creation of the GovGen genesis using data from Cosmos Hub proposal #848

It relies on the work provided in https://github.com/atomone-hub/genesis/pull/103, and follows the guidelines defined in https://github.com/atomone-hub/genesis/issues/71

NOTE: check out requirements.txt for additional Python packages requirements.

Final genesis download link

The final genesis is avalable at this link.

It does include all gentxs collected from https://github.com/atomone-hub/validator/tree/main/govgen-1

The launch date is going to be 27th of February 2024 at 14:00 UTC.

Pre-gentxs genesis download link.

The genesis created using what is available in this repo can be downloaded at this link. The actual genesis will be different though, as it will also contain the gen-txs from validators which can apply at https://github.com/atomone-hub/validator and also submit their gen-txs there.

Base Genesis - params

Created a base-genesis.json that contains the genesis parameters starting from the state export of the Cosmos Hub at block 18010658, which is when proposal #848 is finalized and comes into effect.

This base genesis includes the following changes:

NOTE: genesis time set as "2024-02-27T14:00:00Z"

GovGen token distribution

The govgen-distribution.py Python script takes as input the result of the analysis performed in https://github.com/atomone-hub/genesis/pull/103, i.e. the resulting accounts.json and calculates the $GOVGEN distribution based on votes and delegations associated with each address. It specifically accounts for votes marked as options 3 (No) and 4 (NWV) to determine each address's token allocation, summing amounts from either direct votes - if present - or votes inherited from delegations. The output is a JSON file listing eligible addresses with their respective $GOVGEN (ugovgen) amounts, and the total supply of these tokens. Addresses are also converted to have the govgen Bech32 prefix.

The script takes two arguments: the input JSON file and the desired output file's path. Designed specifically for a predetermined data structure and voting criteria, it assumes the numerical values in the input JSON are correctly formatted for processing. As mentioned, the format is the one defined in https://github.com/atomone-hub/genesis/pull/103.

GovGen genesis before gentxs

The govgen-genesis-pre-gentxs.py Python script takes as input the JSON file produced by the govgen-distribution.py script and the base genesis file, and outputs a genesis file that is the result of the combination of the two.

The third argument for the script is optional and specifies the output genesis JSON file, which by default is simply genesis.json.

Collect gentxs and generate final genesis

Use the govgen-collect-gentxs.py script to generate the final genesis including the required gentxs. The script takes as input the genesis JSON generated by the govgen-genesis-pre-gentxs.py script, the path to the folder where all the gentxs are located, and optionally a third argument that specifies the path of the output genesis JSON file, which by default is simply genesis.json.

The script will also fund validator accounts that did not exist initially with a 25 $GOVGEN balance to provide funds for operations. Validator accounts that already exist and do not have at least 25 $GOVGEN are also topped off to reach that initial balance.