This repo is forked from hyphacoop/cosmos-genesis-tinkerer and added agoric specific scripts to create a mainnet fork snapshot from the latest mainnet height ready for deployment.
The Python code to tinker with the genesis file is in agoric_genesis.py
. The scripts
folder contains scripts to do the following.
- Create a new mainnet follower using state-sync.
- Export a genesis file from the follower's state.
- Tinker the exported genesis file for two mainfork validators.
- Export the artifacts for creating mainfork cluster.
Run the following script to perform all these steps.
./scripts/run_all.sh
A Python module for modifying Cosmos genesis files.
Use this tool to test how the network reacts to a given scenario. The available operations include (but are not limited to):
- Swapping validators
- Swapping delegators
- Increasing balance
- Increasing validator power
- Increasing delegator stake to a validator
- Python 3.10
- Clone from github:
git clone [email protected]:hyphacoop/cosmos-genesis-tinkerer.git
- Change directory:
cd cosmos-genesis-tinkerer
- Create a python virtual environment:
python -m venv .env
- Source env shell vars:
source .env/bin/activate
- Install requirements:
pip install -r requirements.txt
You can run an example genesis tinker file like this:
./example_fresh_genesis.py
It will read the fresh_genesis.json
file from the tests
folder and generate tinkered_genesis.json
.
Access full module documentation with pydoc cosmos_genesis_tinker
.
Example:
from cosmos_genesis_tinker import GenesisTinker, Delegator
tinker = cosmos_genesis_tinker.GenesisTinker(
input_file='input.json',
output_file='output.json')
old_del = Delegator()
old_del.address = 'cosmos123'
old_del.public_key = 'abcxyz'
new_del = Delegator()
new_del.address = 'cosmos456'
new_del.public_key = 'defuvw'
tinker.add_task(tinker.replace_delegator,
old_delegator=old_del,
new_delegator=new_del)
tinker.add_task(tinker.increase_balance,
address=new_delegator.address,
amount=9000000000,
denom='uatom')
tinker.run_tasks()
We export the cosmoshub-4
genesis bi-weekly and modify the exported genesis with example_mainnet_genesis.py
: