-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adjust agoric-cli genesis and config.toml params
Use json-merge-patch to make updates declarative.
- Loading branch information
1 parent
605183b
commit 41614a6
Showing
4 changed files
with
276 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
export const MINT_DENOM = 'uag'; | ||
export const STAKING_DENOM = 'uagstake'; | ||
export const GOV_DEPOSIT_COINS = [{ amount: '10000000', denom: MINT_DENOM }]; | ||
|
||
// A JSON Merge Patch for an exported genesis.json. | ||
export const genesisMergePatch = { | ||
app_state: { | ||
staking: { | ||
params: { | ||
bond_denom: STAKING_DENOM, | ||
}, | ||
}, | ||
mint: { | ||
// Zero inflation, for now. | ||
minter: { | ||
inflation: '0.0', | ||
}, | ||
params: { | ||
inflation_rate_change: '0.0', | ||
inflation_min: '0.0', | ||
mint_denom: MINT_DENOM, | ||
}, | ||
}, | ||
crisis: { | ||
constant_fee: { | ||
denom: MINT_DENOM, | ||
}, | ||
}, | ||
gov: { | ||
deposit_params: { | ||
min_deposit: GOV_DEPOSIT_COINS, | ||
}, | ||
}, | ||
auth: { | ||
params: { | ||
tx_size_cost_per_byte: '1', | ||
}, | ||
}, | ||
|
||
// Remove IBC and capability state. | ||
// TODO: This needs much more support to preserve contract state | ||
// between exports in order to be able to carry forward IBC conns. | ||
capability: null, | ||
ibc: null, | ||
}, | ||
consensus_params: { | ||
block: { | ||
// This is necessary until https://github.com/cosmos/cosmos-sdk/issues/6446 is closed. | ||
time_iota_ms: '1000', | ||
}, | ||
}, | ||
}; | ||
|
||
// The JSON merge patch for the config.toml. | ||
export function makeConfigMergePatch(portNum) { | ||
const rpcPort = Number(portNum); | ||
const configMergePatch = { | ||
proxy_app: 'kvstore', | ||
consensus: { | ||
// Make blocks run faster than normal. | ||
timeout_commit: '2s', | ||
}, | ||
p2p: { | ||
laddr: `tcp://0.0.0.0:${rpcPort - 1}`, | ||
}, | ||
rpc: { | ||
laddr: `tcp://127.0.0.1:${rpcPort}`, | ||
}, | ||
}; | ||
return configMergePatch; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.