akash-network / cosmos-omnibus

112 stars 103 forks source link

Set app.toml #803

Closed mrcr0cket closed 1 month ago

mrcr0cket commented 1 month ago

Is there a way to set app.toml. I need to change some preconfigured values but cannot find a way to do it.

tombeynon commented 1 month ago

See the Configuration section here, specifically the introduction. You can use environment variables to change any of the configuration in the files.

e.g. to change the persistent-peers config in the p2p section, for the CosmosHub blockchain, it would be:

GAIAD_P2P_PERSISTENT_PEERS=id@ip

mrcr0cket commented 1 month ago

All of those envs are common in all cosmos chains. What I need is a way to modify app.toml which may have different keys/values in different chains. For example modify osmosis's max-gas-wanted-per-tx.

The way run.sh works it initialise the chain which creates default app.toml but there is no way to modify it after. https://github.com/akash-network/cosmos-omnibus/blob/786abe4107291f0858c4fc613828b81dcdda29f0/run.sh#L204-L217

Something like how peers are updated may work: https://github.com/akash-network/cosmos-omnibus/blob/786abe4107291f0858c4fc613828b81dcdda29f0/run.sh#L213-L216

I understand this is not trivial and may I be wrong tho in how run.sh works but for no, I could not find a way to modify the default app.toml in chains.

tombeynon commented 1 month ago

@mrcr0cket all Tendermint config, regardless of chain, can be configured like this. None of this is Omnibus specific, Tendermint/Cosmos SDK chains can be configured using environment variables as above. The precedence is command line arguments > env variables > config files.

An example Osmosis config I'm using is OSMOSISD_MIN_GAS_PRICE_FOR_HIGH_GAS_TX=.01

The main thing is determining the section it's in if applicable (i.e. p2p for seeds/persistent-peers, mempool, consensus etc), and the prefix which is always the binary name capitalised.