From fba3ebdc5bb2a20603c407dabe890a988b6e1671 Mon Sep 17 00:00:00 2001 From: dongsam Date: Fri, 26 Nov 2021 15:36:40 +0900 Subject: [PATCH 1/2] build: bump budget to v1.0.0, update changelog, demo docs --- CHANGELOG.md | 7 +++++-- docs/Tutorials/demo/budget_with_farming.md | 3 ++- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a40c9619..7c48134f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,10 +36,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog -## [Unreleased] v1.0.0 - 2021-11-26 +## v1.0.0 - 2021-11-26 * [\#64](https://github.com/tendermint/farming/pull/64) docs: improve documentation for audit release - * [\#187](https://github.com/tendermint/farming/pull/187) edit farming.proto * [\#196](https://github.com/tendermint/farming/pull/196) doc: fix to be broken links by renaming branch name * [\#189](https://github.com/tendermint/farming/pull/189) feat: Create CODEOWNERS file and update contributing.md @@ -59,6 +58,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#225](https://github.com/tendermint/farming/pull/225) fix: add plan type validation for public plan proposal * [\#206](https://github.com/tendermint/farming/pull/206) build: bump cosmos-sdk version to v0.44.3 * [\#228](https://github.com/tendermint/farming/pull/228) test: add test cases for reward allocation of ratio plan +* [\#229](https://github.com/tendermint/farming/pull/229) fix: split staking reserve acc by staking denom +* [\#230](https://github.com/tendermint/farming/pull/230) fix: minimize panics and refactor +* [\#233](https://github.com/tendermint/farming/pull/233) fix: refactor RewardsReserveAcc to be derived by deriveAddress +* [\#185](https://github.com/tendermint/farming/pull/185) feat: prune abandoned state ## [v0.1.2](https://github.com/tendermint/farming/releases/tag/v0.1.2) - 2021-10-18 diff --git a/docs/Tutorials/demo/budget_with_farming.md b/docs/Tutorials/demo/budget_with_farming.md index 9b306d47..e368cdae 100644 --- a/docs/Tutorials/demo/budget_with_farming.md +++ b/docs/Tutorials/demo/budget_with_farming.md @@ -5,6 +5,7 @@ - 2021.09.27: initial document - 2021.10.15: update farming, budget version - 2021.11.12: update farming, budget version to v1.0.0-rc1 +- 2021.11.26: update farming, budget version to v1.0.0 ## What does budget module do? @@ -42,7 +43,7 @@ One use case is to use the module to provide incentives for liquidity pool inves ```bash # Clone the demo project and build `farmingd` for testing -git clone -b v1.0.0-rc1 https://github.com/tendermint/farming.git +git clone -b v1.0.0 https://github.com/tendermint/farming.git cd farming make install-testing ``` diff --git a/go.mod b/go.mod index 21e912cf..09c89dcb 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 - github.com/tendermint/budget v1.0.0-rc1 + github.com/tendermint/budget v1.0.0 github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.4 google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 diff --git a/go.sum b/go.sum index f700fdea..38dcd081 100644 --- a/go.sum +++ b/go.sum @@ -810,8 +810,8 @@ github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzH github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= -github.com/tendermint/budget v1.0.0-rc1 h1:2bh17cCVJ6xMia34tbfK6cUDqP+Ntx8uDdZsW8PFfhE= -github.com/tendermint/budget v1.0.0-rc1/go.mod h1:NDXyfAHE/yD2M2f5NaVfAKpEGjn6pquez7/757hNu4Y= +github.com/tendermint/budget v1.0.0 h1:fkScvKKtSlK0OUIhjZnG5fi9MC4+T+kp1EhxALjDuGw= +github.com/tendermint/budget v1.0.0/go.mod h1:z1aUoy82TflZBTttecePsyHvpwkvPWUpJBLZpqSzRLs= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= From b903c5d9724549afb6acc53a638adf8d75e0f17a Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 26 Nov 2021 17:06:34 +0900 Subject: [PATCH 2/2] 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")))