Skip to content

Commit

Permalink
Merge pull request #235 from dongsam/release-v1.0.0
Browse files Browse the repository at this point in the history
build: bump budget to v1.0.0, update changelog, demo docs
  • Loading branch information
dongsam authored Nov 26, 2021
2 parents 9ee6b4c + 069c373 commit 7ae0fc3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
51 changes: 31 additions & 20 deletions docs/Tutorials/demo/budget_with_farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -75,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
Expand All @@ -104,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")))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 7ae0fc3

Please sign in to comment.