From b903c5d9724549afb6acc53a638adf8d75e0f17a Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 26 Nov 2021 17:06:34 +0900 Subject: [PATCH] docs: update sed --- docs/Tutorials/demo/budget_with_farming.md | 48 +++++++++++++--------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/docs/Tutorials/demo/budget_with_farming.md b/docs/Tutorials/demo/budget_with_farming.md index e368cdae..c5ba160a 100644 --- a/docs/Tutorials/demo/budget_with_farming.md +++ b/docs/Tutorials/demo/budget_with_farming.md @@ -76,24 +76,32 @@ $BINARY add-genesis-account $($BINARY keys show user2 --keyring-backend test -a) $BINARY gentx val1 50000000000000000stake --chain-id $CHAIN_ID --keyring-backend test $BINARY collect-gentxs -# Check OS for sed -i option value -export SED_I="" -if [[ "$OSTYPE" == "darwin"* ]]; then - export SED_I="''" -fi - -# Modify app.toml -sed -i $SED_I 's/enable = false/enable = true/g' $HOME_FARMINGAPP/config/app.toml -sed -i $SED_I 's/swagger = false/swagger = true/g' $HOME_FARMINGAPP/config/app.toml - -# Modify parameters for the governance proposal -sed -i $SED_I 's%"amount": "10000000"%"amount": "1"%g' $HOME_FARMINGAPP/config/genesis.json -sed -i $SED_I 's%"quorum": "0.334000000000000000",%"quorum": "0.000000000000000001",%g' $HOME_FARMINGAPP/config/genesis.json -sed -i $SED_I 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $HOME_FARMINGAPP/config/genesis.json -sed -i $SED_I 's%"voting_period": "172800s"%"voting_period": "30s"%g' $HOME_FARMINGAPP/config/genesis.json - -# Modify inflation rate from 13% to 33% -sed -i $SED_I 's%"inflation": "0.130000000000000000",%"inflation": "0.330000000000000000",%g' $HOME_FARMINGAPP/config/genesis.json +# Check platform +platform='unknown' +unamestr=`uname` +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +fi + +# Enable API and swagger docs and modify parameters for the governance proposal and +# inflation rate from 13% to 33% +if [ $platform = 'linux' ]; then + sed -i 's/enable = false/enable = true/g' $HOME_FARMINGAPP/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $HOME_FARMINGAPP/config/app.toml + sed -i 's%"amount": "10000000"%"amount": "1"%g' $HOME_FARMINGAPP/config/genesis.json + sed -i 's%"quorum": "0.334000000000000000",%"quorum": "0.000000000000000001",%g' $HOME_FARMINGAPP/config/genesis.json + sed -i 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $HOME_FARMINGAPP/config/genesis.json + sed -i 's%"voting_period": "172800s"%"voting_period": "30s"%g' $HOME_FARMINGAPP/config/genesis.json + sed -i 's%"inflation": "0.130000000000000000",%"inflation": "0.330000000000000000",%g' $HOME_FARMINGAPP/config/genesis.json +else + sed -i '' 's/enable = false/enable = true/g' $HOME_FARMINGAPP/config/app.toml + sed -i '' 's/swagger = false/swagger = true/g' $HOME_FARMINGAPP/config/app.toml + sed -i '' 's%"amount": "10000000"%"amount": "1"%g' $HOME_FARMINGAPP/config/genesis.json + sed -i '' 's%"quorum": "0.334000000000000000",%"quorum": "0.000000000000000001",%g' $HOME_FARMINGAPP/config/genesis.json + sed -i '' 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $HOME_FARMINGAPP/config/genesis.json + sed -i '' 's%"voting_period": "172800s"%"voting_period": "30s"%g' $HOME_FARMINGAPP/config/genesis.json + sed -i '' 's%"inflation": "0.130000000000000000",%"inflation": "0.330000000000000000",%g' $HOME_FARMINGAPP/config/genesis.json +fi # Start $BINARY start @@ -105,12 +113,14 @@ Create the `budget-proposal.json` file and copy the following JSON contents into In this demo, you create a budget plan that distributes partial amount of coins from the [FeeCollector module account](https://github.com/cosmos/cosmos-sdk/blob/master/x/auth/types/keys.go#L15) that collects gas fees and ATOM inflation in Cosmos Hub. This budget plan will be used for Gravity DEX farming plan to `GravityDEXFarmingBudget` account. -The `GravityDEXFarmingBudget` account is derived using the following query or code snippet. +The `GravityDEXFarmingBudget` account is derived using the following query. ```bash $BINARY query budget address GravityDEXFarmingBudget --module-name farming # > address: cosmos1228ryjucdpdv3t87rxle0ew76a56ulvnfst0hq0sscd3nafgjpqqkcxcky ``` +This code snippet is how the module derives the account. + ```go // cosmos1228ryjucdpdv3t87rxle0ew76a56ulvnfst0hq0sscd3nafgjpqqkcxcky sdk.AccAddress(address.Module("farming", []byte("GravityDEXFarmingBudget")))