Skip to content

Commit

Permalink
docs: add os checking for sed -i option
Browse files Browse the repository at this point in the history
* commit '305f2fb7da43f1050dd6aa591b43bbdadefa63bd': (23 commits)
  chore: bump Cosmos SDK version to 0.44.2
  fix: emit `rewards_withdrawn` event (tendermint#166)
  chore: fix linter issue
  feat: refactor validating EpochAmount, EpochRatio
  feat: refactory ValidateStakingCoinTotalWeights
  fix: apply suggestions from review
  fix: terminate plan when deleting public plan proposal (tendermint#162)
  fix: change the logic to determine what the request is for
  chore: fix typo and use nil EpochRatio instead of zero
  chore: change error message
  test: update proposal handler tests
  fix: allow optional fields in UpdateRequestProposal
  fix: more strict validation and allow optional addrs
  fix: EpochAmount/EpochRatio fields can be both empty
  fix: allow empty plan name in UpdateRequestProposal
  fix!: forbid empty plan name and allow empty weights
  test: change expected error messages
  test: add tests for proposal validation
  test: add TestValidateStakingCoinTotalWeights
  fix: fix proposal validation logic
  ...
  • Loading branch information
dongsam committed Oct 21, 2021
1 parent bb1bda0 commit 8e6a198
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions docs/Tutorials/demo/budget_with_farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,25 @@ $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
aa

# Modify app.toml
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 $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 '' '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 $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 '' 's%"inflation": "0.130000000000000000",%"inflation": "0.330000000000000000",%g' $HOME_FARMINGAPP/config/genesis.json
sed -i $SED_I 's%"inflation": "0.130000000000000000",%"inflation": "0.330000000000000000",%g' $HOME_FARMINGAPP/config/genesis.json

# Start
$BINARY start
Expand Down

0 comments on commit 8e6a198

Please sign in to comment.