Skip to content

Commit

Permalink
Adjusting setup for spectrum of municp.inf. from 3% to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Jul 24, 2023
1 parent 515603b commit bfc2d3e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
environment:
NUM_VALIDATORS: 3
CHAINID: localnet
INFLATION_RATE: 0.050000000000000000
MUNICIPAL_INFL_TARGET_ADDRESS: fetch12w7ud5hv93zu82as4d64tn00pc596ue2fs74tj

volumes:
- "setup-data:/setup"
Expand Down
20 changes: 16 additions & 4 deletions entrypoints/run-localnet-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ def get_gentxs():


def main():
for name in ('CHAINID', 'NUM_VALIDATORS', 'INFLATION_RATE'):
for name in ('CHAINID', 'NUM_VALIDATORS', 'MUNICIPAL_INFL_TARGET_ADDRESS'):
if name not in os.environ:
print('{} environment variable not present'.format(name))
sys.exit(1)

# extract the environment variables
chain_id = os.environ['CHAINID']
num_validators = int(os.environ['NUM_VALIDATORS'])
inflation_rate = str(os.environ['INFLATION_RATE'])
municipal_infl_target_address = os.environ['MUNICIPAL_INFL_TARGET_ADDRESS']

# create the initial genesis file
if os.path.exists(GENESIS_PATH):
Expand All @@ -58,7 +58,15 @@ def main():
genesis = json.load(f)
genesis["app_state"]["staking"]["params"]["max_validators"] = 10
genesis["app_state"]["staking"]["params"]["max_entries"] = 10
genesis["app_state"]["mint"]["minter"]["municipal_inflation"].append({"denom": "nanomobx", "target_address": "fetch102xnxjzeelcpnz06lky0jyrzmqkty57wy5cavp", "inflation": inflation_rate})
genesis["app_state"]["mint"]["minter"]["municipal_inflation"].extend([
{"denom": "nanomobx", "target_address": municipal_infl_target_address, "inflation": "0.03"},
{"denom": "denom005", "target_address": municipal_infl_target_address, "inflation": "0.05"},
{"denom": "denom100", "target_address": municipal_infl_target_address, "inflation": "1.0"},
{"denom": "denom010", "target_address": municipal_infl_target_address, "inflation": "0.1"},
{"denom": "denom050", "target_address": municipal_infl_target_address, "inflation": "0.5"},
{"denom": "denom020", "target_address": municipal_infl_target_address, "inflation": "0.2"}
])

f.seek(0)
json.dump(genesis, f, indent=4)
f.truncate()
Expand All @@ -72,9 +80,13 @@ def main():

for validator in validators:
cmd = ['fetchd', 'add-genesis-account',
validator, '200000000000000000000atestfet,100000000000000000nanomobx']
validator, '200000000000000000000atestfet']
subprocess.check_call(cmd)

cmd = ['fetchd', 'add-genesis-account',
municipal_infl_target_address, '200000000000000000000atestfet,1000000000000000000nanomobx,1000000000000000000denom005,1000000000000000000denom010,1000000000000000000denom020,1000000000000000000denom050,1000000000000000000denom100']
subprocess.check_call(cmd)

# copy the generated genesis file
shutil.copy(GENESIS_PATH, '/setup/genesis.intermediate.json')

Expand Down

0 comments on commit bfc2d3e

Please sign in to comment.