Skip to content

Commit

Permalink
chore: update docker-compose.yml config + genesis setup script
Browse files Browse the repository at this point in the history
Signed-off-by: jonathansumner <[email protected]>
  • Loading branch information
Jonathansumner committed Jul 10, 2023
1 parent 478f45c commit 7d83cfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
environment:
NUM_VALIDATORS: 3
CHAINID: localnet
INFLATION_RATE: 0.050000000000000000

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


def main():
for name in ('CHAINID', 'NUM_VALIDATORS'):
for name in ('CHAINID', 'NUM_VALIDATORS', 'INFLATION_RATE'):
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'])

# create the initial genesis file
if os.path.exists(GENESIS_PATH):
Expand All @@ -57,6 +58,7 @@ 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})
f.seek(0)
json.dump(genesis, f, indent=4)
f.truncate()
Expand All @@ -70,7 +72,7 @@ def main():

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

# copy the generated genesis file
Expand Down

0 comments on commit 7d83cfd

Please sign in to comment.