You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, each PR should only address a single issue.
80
80
81
81
### Pull Request Templates
82
82
83
-
There are currently three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url:
83
+
There are three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url:
84
84
85
85
-`template=docs.md`
86
86
-`template=other.md`
87
87
88
88
### Requesting Reviews
89
89
90
-
In order to accomodate the review process, the author of the PR must complete the author checklist
90
+
In order to accommodate the review process, the author of the PR must complete the author checklist
91
91
to the best of their abilities before marking the PR as "Ready for Review". If you would like to
92
92
receive early feedback on the PR, open the PR as a "Draft" and leave a comment in the PR indicating
93
93
that you would like early feedback and tagging whoever you would like to receive feedback from.
94
94
95
95
### Reviewing Pull Requests
96
96
97
-
All PRs require at least two reviews before they can be merged (one review might be acceptable in
98
-
the case of minor changes to [docs](./.github/PULL_REQUEST_TEMPLATE/docs.md) or [other](./.github/PULL_REQUEST_TEMPLATE/other.md) changes that do not affect production code). Each PR template has a
99
-
reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible
97
+
All PRs require at least two review approvals before they can be merged (one review might be acceptable in
98
+
the case of minor changes to [docs](./.github/PULL_REQUEST_TEMPLATE/docs.md) or [other](./.github/PULL_REQUEST_TEMPLATE/other.md) changes that do not affect production code). Each PR template has a reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible
100
99
for all checked items unless they have indicated otherwise by leaving their handle next to specific
101
-
items. In addition, please use the following review explanations:
100
+
items. In addition, use the following review explanations:
102
101
103
102
-`LGTM` without an explicit approval means that the changes look good, but you haven't thoroughly reviewed the reviewer checklist items.
104
-
-`Approval` means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you have added your handle next to the items that you have reviewed. In addition, please follow these guidelines:
103
+
-`Approval` means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you must add your handle next to the items that you have reviewed. In addition, follow these guidelines:
105
104
- You must also think through anything which ought to be included but is not
106
105
- You must think through whether any added code could be partially combined (DRYed) with existing code
107
106
- You must think through any potential security issues or incentive-compatibility flaws introduced by the changes
108
107
- Naming must be consistent with conventions and the rest of the codebase
109
-
- Code must live in a reasonable location, considering dependency structures (e.g. not importing testing modules in production code, or including example code modules in production code).
110
-
- If you approve of the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template.
111
-
- If you sat down with the PR submitter and did a pairing review please note that in the `Approval`, or your PR comments.
108
+
- Code must live in a reasonable location, considering dependency structures (for example, not importing testing modules in production code, or including example code modules in production code).
109
+
- If you approve the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template.
110
+
- If you sat down with the PR submitter and did a pairing review, add this information in the `Approval` or your PR comments.
112
111
- If you are only making "surface level" reviews, submit any notes as `Comments` without adding a review.
113
112
114
113
### Updating Documentation
115
114
116
115
If you open a PR on the Cosmos SDK, it is mandatory to update the relevant documentation in `/docs`.
117
116
118
-
- If your change relates to the core SDK (baseapp, store, ...), please update the `docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders.
119
-
- If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), please modify the `docs/run-node/` folder.
120
-
- If your changes relate to a module, please update the module's spec in `x/moduleName/docs/spec/`.
117
+
- If your change relates to the core SDK (baseapp, store, ...), be sure to update the content in`docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders.
118
+
- If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), then modify the content in the `docs/run-node/` folder.
119
+
- If your changes relate to a module, then be sure to update the module's spec in `x/moduleName/docs/spec/`.
121
120
122
121
When writing documentation, follow the [Documentation Writing Guidelines](./docs/DOC_WRITING_GUIDELINES.md).
123
122
124
123
## Forking
125
124
126
-
Please note that Go requires code to live under absolute paths, which complicates forking.
125
+
Go requires code to live under absolute paths, and this requirement complicates forking.
127
126
While my fork lives at `https://github.com/rigeyrigerige/cosmos-sdk`,
128
127
the code should never exist at `$GOPATH/src/github.com/rigeyrigerige/cosmos-sdk`.
129
128
Instead, we use `git remote` to add the fork as a new remote for the original repo,
Copy file name to clipboardExpand all lines: cosmovisor/README.md
+10-4
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ All arguments passed to `cosmovisor` will be passed to the application binary (a
39
39
└── $DAEMON_NAME
40
40
```
41
41
42
-
The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/<name>`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e `genesis` or `upgrades/<name>`). The `name` variable in `upgrades/<name>` is the URI-encoded name of the upgrade as specified in the upgrade module plan.
42
+
The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/<name>`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e.`genesis` or `upgrades/<name>`). The `name` variable in `upgrades/<name>` is the URI-encoded name of the upgrade as specified in the upgrade module plan.
43
43
44
44
Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries*. The `cosmovisor` binary itself can be stored in any typical location (e.g. `/usr/local/bin`). The application will continue to store its data in the default data directory (e.g. `$HOME/.gaiad`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is independent of the data directory and can be set to any location. If you set `$DAEMON_HOME` to the same directory as the data directory, you will end up with a configuation like the following:
When `cosmovisor` is triggered to download the new binary, `cosmovisor` will parse the `"binaries"` field, download the new binary with [go-getter](https://github.com/hashicorp/go-getter), and unpack the new binary in the `upgrades/<name>` folder so that it can be run as if it was installed manually.
92
92
93
-
Note that for this mechanism to provide strong security guarantees, all URLs should include a SHA 256/512 checksum. This ensures that no false binary is run, even if someone hacks the server or hijacks the DNS. `go-getter` will always ensure the downloaded file matches the checksum if it is provided.
93
+
Note that for this mechanism to provide strong security guarantees, all URLs should include a SHA 256/512 checksum. This ensures that no false binary is run, even if someone hacks the server or hijacks the DNS. `go-getter` will always ensure the downloaded file matches the checksum if it is provided.`go-getter` will also handle unpacking archives into directories (in this case the download link should point to a `zip` file of all data in the `bin` directory).
94
94
95
95
To properly create a sha256 checksum on linux, you can use the `sha256sum` utility. For example:
96
96
@@ -106,7 +106,13 @@ You can also use `sha512sum` if you would prefer to use longer hashes, or `md5su
106
106
107
107
The following instructions provide a demonstration of `cosmovisor` using the simulation application (`simapp`) shipped with the Cosmos SDK's source code. The following commands are to be run from within the `cosmos-sdk` repository.
Copy file name to clipboardExpand all lines: docs/basics/accounts.md
+5-6
Original file line number
Diff line number
Diff line change
@@ -70,12 +70,11 @@ The Cosmos SDK supports the following digital key schemes for creating digital s
70
70
-`secp256r1`, as implemented in the [SDK's `crypto/keys/secp256r1` package](https://github.com/cosmos/cosmos-sdk/blob/master/crypto/keys/secp256r1/pubkey.go),
71
71
-`tm-ed25519`, as implemented in the [SDK `crypto/keys/ed25519` package](https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/crypto/keys/ed25519/ed25519.go). This scheme is supported only for the consensus validation.
72
72
73
-
|| Address length | Public key length | Used for transaction | Used for consensus |
74
-
|| in bytes | in bytes | authentication | (tendermint) |
Copy file name to clipboardExpand all lines: docs/basics/app-anatomy.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ See an example of a `MakeTestEncodingConfig` from `simapp`:
135
135
136
136
Modules must implement [interfaces](../building-modules/module-manager.md#application-module-interfaces) defined in the Cosmos SDK, [`AppModuleBasic`](../building-modules/module-manager.md#appmodulebasic) and [`AppModule`](../building-modules/module-manager.md#appmodule). The former implements basic non-dependant elements of the module, such as the `codec`, while the latter handles the bulk of the module methods (including methods that require references to other modules' `keeper`s). Both the `AppModule` and `AppModuleBasic` types are defined in a file called `./module.go`.
137
137
138
-
`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are are called from the `module manager`(../building-modules/module-manager.md#manager), which manages the application's collection of modules.
138
+
`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are called from the `module manager`(../building-modules/module-manager.md#manager), which manages the application's collection of modules.
Copy file name to clipboardExpand all lines: docs/core/grpc_rest.md
+7-5
Original file line number
Diff line number
Diff line change
@@ -34,11 +34,13 @@ Please see [issue #8392](https://github.com/cosmos/cosmos-sdk/issues/8392) for m
34
34
35
35
Cosmos SDK v0.40 introduced Protobuf as the main [encoding](./encoding) library, and this brings a wide range of Protobuf-based tools that can be plugged into the SDK. One such tool is [gRPC](https://grpc.io), a modern open source high performance RPC framework that has decent client support in several languages.
36
36
37
-
Each module exposes [`Msg` and `Query`Protobuf services](../building-modules/messages-and-queries.md) to define state transitions and state queries. These services are hooked up to gRPC via the following function inside the application:
37
+
Each module exposes a [Protobuf `Query`service](../building-modules/messages-and-queries.md#queries) that defines state queries. The `Query` services and a transaction service used to broadcast transactions are hooked up to the gRPC server via the following function inside the application:
The `grpc.Server` is a concrete gRPC server, which spawns and serves any gRPC requests. This server can be configured inside `~/.simapp/config/app.toml`:
41
+
Note: It is not possible to expose any [Protobuf `Msg` service](../building-modules/messages-and-queries.md#messages) endpoints via gRPC. Transactions must be generated and signed using the CLI or programatically before they can be broadcasted using gRPC. See [Generating, Signing, and Broadcasting Transactions](../run-node/txs.html) for more information.
42
+
43
+
The `grpc.Server` is a concrete gRPC server, which spawns and serves all gRPC query requests and a broadcast transaction request. This server can be configured inside `~/.simapp/config/app.toml`:
42
44
43
45
-`grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`.
44
46
-`grpc.address = {string}` field defines the address (really, the port, since the host should be kept at `0.0.0.0`) the server should bind to. Defaults to `0.0.0.0:9090`.
@@ -65,15 +67,15 @@ All routes are configured under the following fields in `~/.simapp/config/app.to
65
67
66
68
If, for various reasons, you cannot use gRPC (for example, you are building a web application, and browsers don't support HTTP2 on which gRPC is built), then the SDK offers REST routes via gRPC-gateway.
67
69
68
-
[gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to expose gRPC endpoints as REST endpoints. For each RPC endpoint defined in a Protobuf service, the SDK offers a REST equivalent. For instance, querying a balance could be done via the `/cosmos.bank.v1beta1.QueryAllBalances` gRPC endpoint, or alternatively via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: both will return the same result. For each RPC method defined in a Protobuf service, the corresponding REST endpoint is defined as an option:
70
+
[gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to expose gRPC endpoints as REST endpoints. For each gRPC endpoint defined in a Protobuf `Query`service, the SDK offers a REST equivalent. For instance, querying a balance could be done via the `/cosmos.bank.v1beta1.QueryAllBalances` gRPC endpoint, or alternatively via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: both will return the same result. For each RPC method defined in a Protobuf`Query` service, the corresponding REST endpoint is defined as an option:
For application developers, gRPC-gateway REST routes needs to be wired up to the REST server, this is done by calling the `RegisterGRPCGatewayRoutes` function on the ModuleManager.
73
75
74
76
### Legacy REST API Routes
75
77
76
-
The REST routes present in Cosmos SDK v0.39 and earlier are marked as deprecated via a [HTTP deprecation header](https://tools.ietf.org/id/draft-dalal-deprecation-header-01.html). They are still maintained to keep backwards compatibility, but will be removed in v0.41. For updating from Legacy REST routes to new gRPC-gateway REST routes, please refer to our [migration guide](../migrations/rest.md).
78
+
The REST routes present in Cosmos SDK v0.39 and earlier are marked as deprecated via a [HTTP deprecation header](https://tools.ietf.org/id/draft-dalal-deprecation-header-01.html). They are still maintained to keep backwards compatibility, but will be removed in v0.44. For updating from Legacy REST routes to new gRPC-gateway REST routes, please refer to our [migration guide](../migrations/rest.md).
77
79
78
80
For application developers, Legacy REST API routes needs to be wired up to the REST server, this is done by calling the `RegisterRESTRoutes` function on the ModuleManager.
Copy file name to clipboardExpand all lines: docs/pre.sh
+2
Original file line number
Diff line number
Diff line change
@@ -10,3 +10,5 @@ for D in ../x/*; do
10
10
done
11
11
12
12
cat ../x/README.md | sed 's/\.\/x/\/modules/g'| sed 's/spec\/README.md//g'| sed 's/\.\.\/docs\/building-modules\/README\.md/\/building-modules\/intro\.html/g'> ./modules/README.md
0 commit comments