@@ -39,6 +39,8 @@ def get_gentxs():
39
39
40
40
41
41
def main ():
42
+ MUNICIPAL_INFL_TARGET_ADDRESS = 'MUNICIPAL_INFL_TARGET_ADDRESS'
43
+
42
44
for name in ('CHAINID' , 'NUM_VALIDATORS' ):
43
45
if name not in os .environ :
44
46
print ('{} environment variable not present' .format (name ))
@@ -47,6 +49,7 @@ def main():
47
49
# extract the environment variables
48
50
chain_id = os .environ ['CHAINID' ]
49
51
num_validators = int (os .environ ['NUM_VALIDATORS' ])
52
+ municipal_infl_target_address = os .environ .get (MUNICIPAL_INFL_TARGET_ADDRESS , None )
50
53
51
54
# create the initial genesis file
52
55
if os .path .exists (GENESIS_PATH ):
@@ -57,6 +60,17 @@ def main():
57
60
genesis = json .load (f )
58
61
genesis ["app_state" ]["staking" ]["params" ]["max_validators" ] = 10
59
62
genesis ["app_state" ]["staking" ]["params" ]["max_entries" ] = 10
63
+ municipal_infl_genesis_conf = genesis ["app_state" ]["mint" ]["minter" ]["municipal_inflation" ]
64
+ if municipal_infl_target_address :
65
+ municipal_infl_genesis_conf .extend ([
66
+ {"denom" : "nanomobx" , "inflation" : {"target_address" : municipal_infl_target_address , "value" : "0.03" }},
67
+ {"denom" : "denom005" , "inflation" : {"target_address" : municipal_infl_target_address , "value" : "0.05" }},
68
+ {"denom" : "denom100" , "inflation" : {"target_address" : municipal_infl_target_address , "value" : "1.0" }},
69
+ {"denom" : "denom010" , "inflation" : {"target_address" : municipal_infl_target_address , "value" : "0.1" }},
70
+ {"denom" : "denom050" , "inflation" : {"target_address" : municipal_infl_target_address , "value" : "0.5" }},
71
+ {"denom" : "denom020" , "inflation" : {"target_address" : municipal_infl_target_address , "value" : "0.2" }}
72
+ ])
73
+
60
74
f .seek (0 )
61
75
json .dump (genesis , f , indent = 4 )
62
76
f .truncate ()
@@ -73,6 +87,18 @@ def main():
73
87
validator , '200000000000000000000atestfet' ]
74
88
subprocess .check_call (cmd )
75
89
90
+ if municipal_infl_target_address :
91
+ token_list = ["200000000000000000000atestfet" ]
92
+
93
+ for infl in municipal_infl_genesis_conf :
94
+ token_list .append (f'{ 10 ** 18 } { infl ["denom" ]} ' )
95
+ tokens = ',' .join (token_list )
96
+
97
+ cmd = ['fetchd' , 'add-genesis-account' ,
98
+ municipal_infl_target_address , tokens ]
99
+
100
+ subprocess .check_call (cmd )
101
+
76
102
# copy the generated genesis file
77
103
shutil .copy (GENESIS_PATH , '/setup/genesis.intermediate.json' )
78
104
0 commit comments