You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
8.9 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
  1. # Contributing
  2. Thank you for considering making contributions to Tendermint and related repositories! Start by taking a look at the [coding repo](https://github.com/tendermint/coding) for overall information on repository workflow and standards.
  3. Please follow standard github best practices: fork the repo, branch from the tip of `master`, make some commits, and submit a pull request to `master`.
  4. See the [open issues](https://github.com/tendermint/tendermint/issues) for things we need help with!
  5. Before making a pull request, please open an issue describing the
  6. change you would like to make. If an issue for your change already exists,
  7. please comment on it that you will submit a pull request. Be sure to reference the issue in the opening
  8. comment of your pull request. If your change is substantial, you will be asked
  9. to write a more detailed design document in the form of an
  10. Architectural Decision Record (ie. see [here](./docs/architecture/)) before submitting code
  11. changes.
  12. Please open a [Draft PR](https://github.blog/2019-02-14-introducing-draft-pull-requests/), even if your contribution is incomplete, this inidicates to the community you're working on something and allows them to provide comments early in the development process. When the code is complete it can be marked as ready-for-review.
  13. Please make sure to use `gofmt` before every commit - the easiest way to do this is have your editor run it for you upon saving a file. Additionally please ensure that your code is lint compliant by running `make lint`
  14. ## Forking
  15. Please note that Go requires code to live under absolute paths, which complicates forking.
  16. While my fork lives at `https://github.com/ebuchman/tendermint`,
  17. the code should never exist at `$GOPATH/src/github.com/ebuchman/tendermint`.
  18. Instead, we use `git remote` to add the fork as a new remote for the original repo,
  19. `$GOPATH/src/github.com/tendermint/tendermint`, and do all the work there.
  20. For instance, to create a fork and work on a branch of it, I would:
  21. - Create the fork on github, using the fork button.
  22. - Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/tendermint/tendermint`)
  23. - `git remote rename origin upstream`
  24. - `git remote add origin git@github.com:ebuchman/basecoin.git`
  25. Now `origin` refers to my fork and `upstream` refers to the tendermint version.
  26. So I can `git push -u origin master` to update my fork, and make pull requests to tendermint from there.
  27. Of course, replace `ebuchman` with your git handle.
  28. To pull in updates from the origin repo, run
  29. - `git fetch upstream`
  30. - `git rebase upstream/master` (or whatever branch you want)
  31. ## Dependencies
  32. We use [go modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
  33. That said, the master branch of every Tendermint repository should just build
  34. with `go get`, which means they should be kept up-to-date with their
  35. dependencies so we can get away with telling people they can just `go get` our
  36. software.
  37. Since some dependencies are not under our control, a third party may break our
  38. build, in which case we can fall back on `go mod tidy`. Even for dependencies under our control, go helps us to
  39. keep multiple repos in sync as they evolve. Anything with an executable, such
  40. as apps, tools, and the core, should use dep.
  41. Run `go list -u -m all` to get a list of dependencies that may not be
  42. up-to-date.
  43. When updating dependencies, please only update the particular dependencies you
  44. need. Instead of running `go get -u=patch`, which will update anything,
  45. specify exactly the dependency you want to update, eg.
  46. `GO111MODULE=on go get -u github.com/tendermint/go-amino@master`.
  47. ## Vagrant
  48. If you are a [Vagrant](https://www.vagrantup.com/) user, you can get started
  49. hacking Tendermint with the commands below.
  50. NOTE: In case you installed Vagrant in 2017, you might need to run
  51. `vagrant box update` to upgrade to the latest `ubuntu/xenial64`.
  52. ```
  53. vagrant up
  54. vagrant ssh
  55. make test
  56. ```
  57. ## Changelog
  58. Every fix, improvement, feature, or breaking change should be made in a
  59. pull-request that includes an update to the `CHANGELOG_PENDING.md` file.
  60. Changelog entries should be formatted as follows:
  61. ```
  62. - [module] \#xxx Some description about the change (@contributor)
  63. ```
  64. Here, `module` is the part of the code that changed (typically a
  65. top-level Go package), `xxx` is the pull-request number, and `contributor`
  66. is the author/s of the change.
  67. It's also acceptable for `xxx` to refer to the relevent issue number, but pull-request
  68. numbers are preferred.
  69. Note this means pull-requests should be opened first so the changelog can then
  70. be updated with the pull-request's number.
  71. There is no need to include the full link, as this will be added
  72. automatically during release. But please include the backslash and pound, eg. `\#2313`.
  73. Changelog entries should be ordered alphabetically according to the
  74. `module`, and numerically according to the pull-request number.
  75. Changes with multiple classifications should be doubly included (eg. a bug fix
  76. that is also a breaking change should be recorded under both).
  77. Breaking changes are further subdivided according to the APIs/users they impact.
  78. Any change that effects multiple APIs/users should be recorded multiply - for
  79. instance, a change to the `Blockchain Protocol` that removes a field from the
  80. header should also be recorded under `CLI/RPC/Config` since the field will be
  81. removed from the header in rpc responses as well.
  82. ## Branching Model and Release
  83. The main development branch is master.
  84. Every release is maintained in a release branch named `vX.Y.Z`.
  85. Note all pull requests should be squash merged except for merging to a release branch (named `vX.Y`). This keeps the commit history clean and makes it
  86. easy to reference the pull request where a change was introduced.
  87. ### Development Procedure
  88. - the latest state of development is on `master`
  89. - `master` must never fail `make test`
  90. - never --force onto `master` (except when reverting a broken commit, which should seldom happen)
  91. - create a development branch either on github.com/tendermint/tendermint, or your fork (using `git remote add origin`)
  92. - make changes and update the `CHANGELOG_PENDING.md` to record your change
  93. - before submitting a pull request, run `git rebase` on top of the latest `master`
  94. ### Pull Merge Procedure
  95. - ensure pull branch is based on a recent `master`
  96. - run `make test` to ensure that all tests pass
  97. - squash merge pull request
  98. - the `unstable` branch may be used to aggregate pull merges before fixing tests
  99. ### Release Procedure
  100. #### Major Release
  101. 1. start on `master`
  102. 2. run integration tests (see `test_integrations` in Makefile)
  103. 3. prepare release in a pull request against `master` (to be squash merged):
  104. - copy `CHANGELOG_PENDING.md` to top of `CHANGELOG.md`
  105. - run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
  106. all issues
  107. - run `bash ./scripts/authors.sh` to get a list of authors since the latest
  108. release, and add the github aliases of external contributors to the top of
  109. the changelog. To lookup an alias from an email, try `bash ./scripts/authors.sh <email>`
  110. - reset the `CHANGELOG_PENDING.md`
  111. - bump versions
  112. 4. push your changes with prepared release details to `vX.X` (this will trigger the release `vX.X.0`)
  113. 5. merge back to master (don't squash merge!)
  114. #### Minor Release
  115. If there were no breaking changes and you need to create a release nonetheless,
  116. the procedure is almost exactly like with a new release above.
  117. The only difference is that in the end you create a pull request against the existing `X.X` branch.
  118. The branch name should match the release number you want to create.
  119. Merging this PR will trigger the next release.
  120. For example, if the PR is against an existing 0.34 branch which already contains a v0.34.0 release/tag,
  121. the patch version will be incremented and the created release will be v0.34.1.
  122. #### Backport Release
  123. 1. start from the existing release branch you want to backport changes to (e.g. v0.30)
  124. Branch to a release/vX.X.X branch locally (e.g. release/v0.30.7)
  125. 2. cherry pick the commit(s) that contain the changes you want to backport (usually these commits are from squash-merged PRs which were already reviewed)
  126. 3. steps 2 and 3 from [Major Release](#major-release)
  127. 4. push changes to release/vX.X.X branch
  128. 5. open a PR against the existing vX.X branch
  129. ## Testing
  130. All repos should be hooked up to [CircleCI](https://circleci.com/).
  131. If they have `.go` files in the root directory, they will be automatically
  132. tested by circle using `go test -v -race ./...`. If not, they will need a
  133. `circle.yml`. Ideally, every repo has a `Makefile` that defines `make test` and
  134. includes its continuous integration status using a badge in the `README.md`.
  135. ### RPC Testing
  136. If you contribute to the RPC endpoints it's important to document your changes in the [Swagger file](./docs/spec/rpc/swagger.yaml)
  137. To test your changes you should install `nodejs` and run:
  138. ```bash
  139. npm i -g dredd
  140. make build-linux build-contract-tests-hooks
  141. make contract-tests
  142. ```
  143. This command will popup a network and check every endpoint against what has been documented