Skip to content

Commit

Permalink
docs: add helpful docs for audit (#176)
Browse files Browse the repository at this point in the history
* docs: add CONTRIBUTING.md

* chore: update TECHNICAL-SETUP and README docs

* chore: Update sdk version on README.md

* docs: update demo script for latest version

* docs: upgrade swagger version for new param

Co-authored-by: dongsam <dongsamb@gmail.com>
  • Loading branch information
jaybxyz and dongsam committed Oct 15, 2021
1 parent 7b81870 commit 69db071
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 24 deletions.
17 changes: 16 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Contributing

TODO: add context
We welcome contributions from anyone who is willing to create a new PR on farming module, make sure that you read and comply with this document. See the [open issues](https://github.com/tendermint/farming/issues) that we need help with. Feel free to inform us if you are willing to work on any issue. Note that the `master` branch contains the latest development version.

We follow standard github best practices:

- Fork the repository
- Make sure your `branch` is from the tip of `master` branch
- Make some commits to resolve an issue
- Submit a pull request to `master`

Rule of thumb:

- Make sure you run tests by running `make test-all` locally to see there is any issue
- Review all the checks on your PR and review code coverage report
- Assign reviewers from code owners (@dongsam @kogisin @hallazzang)

Thank you for your contribution!
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ If you haven't already, install Golang by following the [official docs](https://

Requirement | Notes
----------- | -----------------
Go version | Go1.15 or higher
Cosmos SDK | v0.44.0 or higher
Go version | Go1.16 or higher
Cosmos SDK | v0.44.2 or higher

### Get Farming Module source code

Expand Down
70 changes: 58 additions & 12 deletions TECHNICAL-SETUP.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,68 @@
# Technical Setup

## Setup git hooks for Conventional Commit
To ensure you have a successful experience working with our farming module, Tendermint recommends this technical setup.

## Github Integration

Click the GitHub icon in the sidebar for GitHub integration and follow the prompts.

Clone the repos you work in

- Fork or clone the https://github.com/tendermint/farming repository.

Internal Tendermint users have different permissions, if you're not sure, fork the repo.

## Software Requirement

To build the project:

- [Golang](https://golang.org/dl/) v1.16 or higher
- [make](https://www.gnu.org/software/make/) to use `Makefile` targets

## Development Environment Setup

Setup git hooks for conventional commit.

1. Install [`pre-commit`](https://pre-commit.com/)
2. Run this command:

```
$ pre-commit install --hook-type commit-msg
```

2. Run the following command:
```bash
pre-commit install --hook-type commit-msg
```

3. (Optional for macOS users) Install GNU `grep`:
1. Run `brew install grep`
2. Add this line to your shell profile:

4. Run the following command
```bash
brew install grep
```

5. Add the line to your shell profile:
```bash
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
```

Now, whenever you make a commit, the `pre-commit` hook will be run to check if the commit message conforms [Conventional Commit](https://www.conventionalcommits.org/) rule.

## Building

To build the farming module node and command line client, run the `make build` command from the project's root folder. The output of the build will be generated in the `build` folder.

For cross-builds use the standard `GOOS` and `GOARCH` env vars. i.e. to build for windows:

```bash
GOOS=windows GOARCH=amd64 make build
```
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
```

Now, whenever you make a commit, the `pre-commit` hook will be run to check if the commit message
conforms [Conventional Commit](https://www.conventionalcommits.org/) rule.

## Testing

Run `make test-all` command to run tests.

> 💡 you can also use the default `go` command to build the project, check the content of the [Makefile](https://github.com/tendermint/farming/blob/master/Makefile#L145) for reference
## Installation

To install the node client on your machine, run `make install` command from the project's root folder.

> 💡 you can also use the default `go` command to build the project, check the content of the [Makefile](https://github.com/tendermint/farming/blob/master/Makefile#L90) for reference
2 changes: 1 addition & 1 deletion client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Cosmos SDK Farming Module - REST and gRPC Gateway docs",
"description": "A REST interface for state queries, transactions",
"version": "0.1.2"
"version": "0.1.3"
},
"apis": [
{
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ swagger: '2.0'
info:
title: Cosmos SDK Farming Module - REST and gRPC Gateway docs
description: 'A REST interface for state queries, transactions'
version: 0.1.2
version: 0.1.3
paths:
/cosmos/farming/v1beta1/current_epoch_days:
get:
Expand Down
2 changes: 1 addition & 1 deletion docs/How-To/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: A high-level overview of gRPC-gateway REST Routes in farming module

## Swagger Documentation

- [Swagger Docs v0.1.2](https://app.swaggerhub.com/apis-docs/gravity-devs/farming/0.1.2)
- [Swagger Docs v0.1.3](https://app.swaggerhub.com/apis-docs/gravity-devs/farming/0.1.3)

## gRPC-gateway REST Routes

Expand Down
11 changes: 6 additions & 5 deletions docs/Tutorials/demo/budget_with_farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
## Changelog

- 2021.09.27: initial document
- 2021.10.15: update farming, budget version

## Disclaimer

The [budget](https://github.com/tendermint/budget) and [farming](https://github.com/tendermint/farming) modules are in active development by the Gravity DEX team in Tendermint. This demo includes MVP versions of [budget](https://github.com/tendermint/budget/releases/tag/v0.1.0) and [farming](https://github.com/tendermint/farming/releases/tag/v0.1.0) modules meaning that it is not stable version. We are aware that there are a lot of rooms for improvements and there may be breaking changes along the way. We welcome any outside contributors to contribute to the modules and we are happy to receive any feedbacks or suggestions.
The [budget](https://github.com/tendermint/budget) and [farming](https://github.com/tendermint/farming) modules are in active development by the Gravity DEX team in Tendermint. This demo includes MVP versions of budget and farming modules meaning that it is not stable version. We are aware that there are a lot of rooms for improvements and there may be breaking changes along the way. We welcome any outside contributors to contribute to the modules and we are happy to receive any feedbacks or suggestions.

## What does budget module do?

Expand All @@ -26,25 +27,25 @@ One use case is to use the module to provide incentives for liquidity pool inves

- [Github Repo](https://github.com/tendermint/budget)
- [Spec Docs](https://github.com/tendermint/budget/blob/master/x/budget/spec/01_concepts.md)
- This demo version [v0.1.0](https://github.com/tendermint/budget/releases/tag/v0.1.0)
- This demo version [v0.1.1](https://github.com/tendermint/budget/releases)
- Other useful resources are available in [docs](https://github.com/tendermint/budget/blob/master/docs) folder
- Swagger Docs [v0.1.0](https://app.swaggerhub.com/apis-docs/gravity-devs/budget/0.1.0)

**Farming module**

- [Github Repo](https://github.com/tendermint/farming)
- [Spec Docs](https://github.com/tendermint/farming/blob/master/x/farming/spec/01_concepts.md)
- Today's demo version [v0.1.0](https://github.com/tendermint/farming/releases/tag/v0.1.0)
- Today's demo version [v0.1.1](https://github.com/tendermint/farming/releases)
- Other useful resources are available in [docs](https://github.com/tendermint/farming/blob/master/docs) folder
- Swagger Docs [v0.1.2](https://app.swaggerhub.com/apis-docs/gravity-devs/farming/0.1.2)
- Swagger Docs [v0.1.3](https://app.swaggerhub.com/apis-docs/gravity-devs/farming/0.1.3)

## Demo

### Step 1. Build from source

```bash
# Clone the demo project and build `farmingd` for testing
git clone -b v0.1.0 https://github.com/tendermint/farming.git
git clone -b v0.1.1 https://github.com/tendermint/farming.git
cd farming
make install-testing
```
Expand Down

0 comments on commit 69db071

Please sign in to comment.