From 406669d4d3209913d9140142980a326e5292c191 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 2 Dec 2020 15:00:26 +0100 Subject: [PATCH 01/10] docs: Add grpc & rest endpoints overview --- docs/core/README.md | 9 ++++--- docs/core/encoding.md | 30 +++++++++++----------- docs/core/events.md | 2 +- docs/core/grpc_rest.md | 46 ++++++++++++++++++++++++++++++++++ docs/core/ocap.md | 2 +- docs/core/runtx_middleware.md | 2 +- docs/core/telemetry.md | 2 +- docs/run-node/interact-node.md | 8 +++++- 8 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 docs/core/grpc_rest.md diff --git a/docs/core/README.md b/docs/core/README.md index 20b344d3a0e3..611ab91b3f6d 100644 --- a/docs/core/README.md +++ b/docs/core/README.md @@ -14,10 +14,11 @@ This repository contains reference documentation on the core concepts of the Cos 4. [Node Client](./node.md) 5. [Store](./store.md) 6. [Encoding](./encoding.md) -7. [Events](./events.md) -8. [Telemetry](./telemetry.md) -9. [Object-Capabilities](./ocap.md) -10. [RunTx recovery middleware](./runtx_middleware.md) +7. [gRPC, REST and Other Endpoints](./grpc_rest.md) +8. [Events](./events.md) +9. [Telemetry](./telemetry.md) +10. [Object-Capabilities](./ocap.md) +11. [RunTx recovery middleware](./runtx_middleware.md) After reading about the core concepts, check the [IBC documentation](../ibc/README.md) to learn more about the IBC core concepts and how to integrate it to you application. diff --git a/docs/core/encoding.md b/docs/core/encoding.md index 69059b39c6a0..353b7a6edfbb 100644 --- a/docs/core/encoding.md +++ b/docs/core/encoding.md @@ -78,11 +78,12 @@ Modules are encouraged to utilize Protobuf encoding for their respective types. **Defining module types** Protobuf types can be defined to encode: - - state - - [`Msg`s](../building-modules/messages-and-queries.md#messages) - - [Query services](../building-modules/query-services.md) - - [genesis](../building-modules/genesis.md) - + +- state +- [`Msg`s](../building-modules/messages-and-queries.md#messages) +- [Query services](../building-modules/query-services.md) +- [genesis](../building-modules/genesis.md) + **Naming and conventions** We encourage developers to follow industry guidelines: [Protocol Buffers style guide](https://developers.google.com/protocol-buffers/docs/style) @@ -115,7 +116,7 @@ easy encoding of state to `Any`. Module should register interfaces using `InterfaceRegistry` which provides a mechanism for registering interfaces: `RegisterInterface(protoName string, iface interface{})` and implementations: `RegisterImplementations(iface interface{}, impls ...proto.Message)` that can be safely unpacked from Any, similarly to type registration with Amino: -+++ https://github.com/cosmos/cosmos-sdk/blob/3d969a1ffdf9a80f9ee16db9c16b8a8aa1004af6/codec/types/interface_registry.go#L23-L52 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/codec/types/interface_registry.go#L25-L66 In addition, an `UnpackInterfaces` phase should be introduced to deserialization to unpack interfaces before they're needed. Protobuf types that contain a protobuf `Any` either directly or via one of their members should implement the `UnpackInterfacesMessage` interface: @@ -128,10 +129,11 @@ type UnpackInterfacesMessage interface { #### Guidelines for protobuf message definitions In addition to [following official guidelines](https://developers.google.com/protocol-buffers/docs/proto3#simple), we recommend to use these annotations in .proto files when dealing with interfaces: -* fields which accept interfaces should be annotated with `cosmos_proto.accepts_interface` -using the same full-qualified name passed as `protoName` to `InterfaceRegistry.RegisterInterface` -* interface implementations should be annotated with `cosmos_proto.implements_interface` -using the same full-qualified name passed as `protoName` to `InterfaceRegistry.RegisterInterface` + +- fields which accept interfaces should be annotated with `cosmos_proto.accepts_interface` + using the same full-qualified name passed as `protoName` to `InterfaceRegistry.RegisterInterface` +- interface implementations should be annotated with `cosmos_proto.implements_interface` + using the same full-qualified name passed as `protoName` to `InterfaceRegistry.RegisterInterface` #### Transaction Encoding @@ -142,14 +144,14 @@ other peers. Since the underlying consensus engine is agnostic to the applicatio it only accepts transactions in the form of raw bytes. The encoding is done by an object called `TxEncoder` and the decoding by an object called `TxDecoder`. -+++ https://github.com/cosmos/cosmos-sdk/blob/9ae17669d6715a84c20d52e10e2232be9f467360/types/tx_msg.go#L82-L86 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/types/tx_msg.go#L83-L87 A standard implementation of both these objects can be found in the [`auth` module](https://github.com/cosmos/cosmos-sdk/blob/master/x/auth): -+++ https://github.com/cosmos/cosmos-sdk/blob/9ae17669d6715a84c20d52e10e2232be9f467360/x/auth/tx/decoder.go ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/x/auth/tx/decoder.go -+++ https://github.com/cosmos/cosmos-sdk/blob/9ae17669d6715a84c20d52e10e2232be9f467360/x/auth/tx/encoder.go ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/x/auth/tx/encoder.go ## Next {hide} -Learn about [events](./events.md) {hide} +Learn about [gRPC, REST and other endpoints](./grpc_rest.md) {hide} diff --git a/docs/core/events.md b/docs/core/events.md index d7fe2b8e1300..bffa432ba4bc 100644 --- a/docs/core/events.md +++ b/docs/core/events.md @@ -1,5 +1,5 @@ # Events diff --git a/docs/core/grpc_rest.md b/docs/core/grpc_rest.md new file mode 100644 index 000000000000..d7ba7d95ffee --- /dev/null +++ b/docs/core/grpc_rest.md @@ -0,0 +1,46 @@ + + +# gRPC and REST, and Other Endpoints + +This document prevents an overview of all the endpoints a node exposes: gRPC, REST as well as some other endpoints. {synopsis} + +## An Overview of All Endpoints + +Each node exposes the following endpoints for users to interact with a node, each endpoint is served on a different port. Details on how to configure each endpoint is provided in the endpoint's own section. + +- the gRPC server (default port: `9090`), +- the REST server (default port: `1317`), +- the Tendermint RPC endpoint (default port: `26657`). + +::: tip +The node also exposes some other endpoints, such as the Tendermint P2P endpoint, or the [Prometheus endpoint](https://docs.tendermint.com/master/nodes/metrics.html#metrics), which are not directly related to the Cosmos SDK. Please refer to the [Tendermint documentation](https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#configuration) for more information. +::: + +## gRPC Server + +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. + +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: + +https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/server/types/app.go#L39-L41 + +The `grpc.Server` is a concrete gRPC server, which spawns and serves any gRPC requests. This server can be configured inside `app.toml`: + +- the `grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`. +- the `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:9000`. + +Once the gRPC server is started, you can send requests using a gRPC client. Some examples are given in our [Interact with the Node](../run-node/interact-node.md#using-grpc) tutorial. + +## REST Server + +In Cosmos SDK v0.40, the node continues to serve a REST server. However, the existing routes present in version v0.39 and earlier are now marked as deprecated, and new routes have been added via gRPC-gateway. + +### gRPC-gateway REST Routes + +[gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to transform gRPC endpoints into REST endpoints. For each RPC endpoint defined in a Protobuf service, the SDK offers a REST equivalent. For instances, querying a balance could be done via the `/cosmos.bank.v1beta1.Query/AllBalances` gRPC endpoint, or via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: + +## Next {hide} + +Learn about [events](./events.md) {hide} diff --git a/docs/core/ocap.md b/docs/core/ocap.md index 1634af280808..523595c32479 100644 --- a/docs/core/ocap.md +++ b/docs/core/ocap.md @@ -1,5 +1,5 @@ # Object-Capability Model diff --git a/docs/core/runtx_middleware.md b/docs/core/runtx_middleware.md index a2eaaa735c69..8d205ca284fe 100644 --- a/docs/core/runtx_middleware.md +++ b/docs/core/runtx_middleware.md @@ -1,5 +1,5 @@ # RunTx recovery middleware diff --git a/docs/core/telemetry.md b/docs/core/telemetry.md index 88faa1eef75f..b536fb480dff 100644 --- a/docs/core/telemetry.md +++ b/docs/core/telemetry.md @@ -1,5 +1,5 @@ # Telemetry diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index 78c8b75002f2..7442442d1d59 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -4,11 +4,13 @@ order: 3 # Interacting with the Node +There are multiple ways to interact with a node: using the CLI, using gRPC or using the REST endpoints. {synopsis} + ## Pre-requisite Readings - [Running a Node](./run-node.md) {prereq} -## Via CLI +## Using the CLI Now that your chain is running, it is time to try sending tokens from the first account you created to a second account. In a new terminal window, start by running the following query command: @@ -44,3 +46,7 @@ simd query staking delegations-to $(simd keys show my_validator --bech val -a -- ``` You should see two delegations, the first one made from the `gentx`, and the second one you just performed from the `recipient` account. + +## Using gRPC + +## Using the REST Endpoints From 04e1e3f783e1d0d65367c23755ffa45d6559dcaf Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 2 Dec 2020 16:36:20 +0100 Subject: [PATCH 02/10] Finish overview --- docs/core/README.md | 2 +- docs/core/grpc_rest.md | 69 +++++++++++++++++++++++++++++++++++---- docs/core/transactions.md | 6 +++- 3 files changed, 68 insertions(+), 9 deletions(-) diff --git a/docs/core/README.md b/docs/core/README.md index 611ab91b3f6d..7eb2202829a1 100644 --- a/docs/core/README.md +++ b/docs/core/README.md @@ -14,7 +14,7 @@ This repository contains reference documentation on the core concepts of the Cos 4. [Node Client](./node.md) 5. [Store](./store.md) 6. [Encoding](./encoding.md) -7. [gRPC, REST and Other Endpoints](./grpc_rest.md) +7. [gRPC, REST and Tendermint Endpoints](./grpc_rest.md) 8. [Events](./events.md) 9. [Telemetry](./telemetry.md) 10. [Object-Capabilities](./ocap.md) diff --git a/docs/core/grpc_rest.md b/docs/core/grpc_rest.md index d7ba7d95ffee..52bfda7e0be9 100644 --- a/docs/core/grpc_rest.md +++ b/docs/core/grpc_rest.md @@ -2,7 +2,7 @@ order: 7 --> -# gRPC and REST, and Other Endpoints +# gRPC, REST, and Tendermint Endpoints This document prevents an overview of all the endpoints a node exposes: gRPC, REST as well as some other endpoints. {synopsis} @@ -15,7 +15,7 @@ Each node exposes the following endpoints for users to interact with a node, eac - the Tendermint RPC endpoint (default port: `26657`). ::: tip -The node also exposes some other endpoints, such as the Tendermint P2P endpoint, or the [Prometheus endpoint](https://docs.tendermint.com/master/nodes/metrics.html#metrics), which are not directly related to the Cosmos SDK. Please refer to the [Tendermint documentation](https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#configuration) for more information. +The node also exposes some other endpoints, such as the Tendermint P2P endpoint, or the [Prometheus endpoint](https://docs.tendermint.com/master/nodes/metrics.html#metrics), which are not directly related to the Cosmos SDK. Please refer to the [Tendermint documentation](https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#configuration) for more information about these endpoints. ::: ## gRPC Server @@ -26,20 +26,75 @@ Each module exposes [`Msg` and `Query` Protobuf services](../building-modules/me https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/server/types/app.go#L39-L41 -The `grpc.Server` is a concrete gRPC server, which spawns and serves any gRPC requests. This server can be configured inside `app.toml`: +The `grpc.Server` is a concrete gRPC server, which spawns and serves any gRPC requests. This server can be configured inside `$TMHOME/config/app.toml`: -- the `grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`. -- the `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:9000`. +- `grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`. +- `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:9000`. -Once the gRPC server is started, you can send requests using a gRPC client. Some examples are given in our [Interact with the Node](../run-node/interact-node.md#using-grpc) tutorial. +::tip +`$TMHOME` is the directory where the node's configuration and databases are stored. By default, it's set to `~/.{app_name}`. +:: + +Once the gRPC server is started, you can send requests to it using a gRPC client. Some examples are given in our [Interact with the Node](../run-node/interact-node.md#using-grpc) tutorial. + +An overview of all available gRPC endpoints shipped with the Cosmos SDK is [coming soon](https://github.com/cosmos/cosmos-sdk/issues/7786). ## REST Server In Cosmos SDK v0.40, the node continues to serve a REST server. However, the existing routes present in version v0.39 and earlier are now marked as deprecated, and new routes have been added via gRPC-gateway. +All routes are configured under the following fields in `$TMHOME/config/app.toml`: + +- `api.enable = true|false` field defines if the REST server should be enabled. Defaults to `true`. +- `api.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 `tcp://0.0.0.0:1317`. +- some additional API configuration options are defined in `$TMHOME/config/app.toml`, along with comments, please refer to that file directly. + ### gRPC-gateway REST Routes -[gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to transform gRPC endpoints into REST endpoints. For each RPC endpoint defined in a Protobuf service, the SDK offers a REST equivalent. For instances, querying a balance could be done via the `/cosmos.bank.v1beta1.Query/AllBalances` gRPC endpoint, or via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: +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. + +[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.Query/AllBalances` 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: + ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc0/proto/cosmos/bank/v1beta1/query.proto#L19-L22 + +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. + +### Legacy REST API Routes + +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). + +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. + +### Swagger + +A [Swagger](https://swagger.io/) (or OpenAPIv2) specification file is exposed under the `/swagger` route on the API server. Swagger is an open specification describing the API endpoints a server serves, including description, input arguments, return types and much more about each endpoint. + +Enabling the `/swagger` endpoint is configurable inside `$TMHOME/config/app.toml` via the `api.swagger` field, which is set to true by default. + +For application developers, you may want to generate your own Swagger definitions based on your custom modules. The SDK's [Swagger generation script](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/scripts/protoc-swagger-gen.sh) is a good place to start. + +## Tendermint RPC + +Independently from the Cosmos SDK, Tendermint also exposes a RPC server. This RPC server can be configured by tuning parameters under the `rpc` table in the `$TMHOME/config/config.toml`, the default listening address is `tcp://0.0.0.0:26657`. An OpenAPI specification of all Tendermint RPC endpoints is available [here](https://docs.tendermint.com/master/rpc/). + +Some Tendermint RPC endpoints are directly related to the Cosmos SDK: + +- `/abci_query`: this endpoint will query the application for state. As the `path` parameter, you can send the following strings: + - any Protobuf fully-qualified service method, such as `/cosmos.bank.v1beta1.Query/AllBalances`. The `data` field should then include the method's request parameter(s) encoded as bytes using Protobuf. + - `/app/simulate`: this will simulate a transaction, and return some information such as gas used. + - `/app/version`: this will return the application's version. + - `/store/{path}`: this will query the store directly. + - `/p2p/filter/addr/{port}`: this will return a filtered list of the node's P2P peers by address port. + - `/p2p/filter/id/{id}`: this will return a filtered list of the node's P2P peers by ID. +- `/broadcast_tx_{aync,async,commit}`: these 3 endpoint will broadcast a transaction to other peers. CLI, gRPC and REST expose [a way to broadcast transations](./transactions.md#broadcasting-the-transaction), but they all use these 3 Tendermint RPCs under the hood. + +## Comparison Table + +| Name | Advantages | Disadvantages | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| gRPC | - can use code-generated stubs in various languages
- supports streaming and bidirectional communication (HTTP2)
- small wire binary sizes, faster transmission | - based on HTTP2, not available in browsers
- learning curve (mostly due to Protobuf) | +| REST | - ubiquitous
- client libraries in all languages, faster implementation
| - only supports unary request-response communication (HTTP1.1)
- bigger over-the-wire message sizes (JSON) | +| Tendermint RPC | - easy to use | - bigger over-the-wire message sizes (JSON) | ## Next {hide} diff --git a/docs/core/transactions.md b/docs/core/transactions.md index a2ccbfdb700d..1bf642578874 100644 --- a/docs/core/transactions.md +++ b/docs/core/transactions.md @@ -145,10 +145,14 @@ An example of broadcasting a transaction is shown in [TODO](https://github.com/c #### REST -Each gRPC method has its corresponding REST endpoint, generated using [gRPC-gateway](https://github.com/grpc-ecosystem/grpc-gateway). Therefore, instead of using gRPC, you can also use HTTP to broadcast the same transaction, on the `POST /cosmos/tx/v1beta1/broadcast_tx` endpoint. +Each gRPC method has its corresponding REST endpoint, generated using [gRPC-gateway](https://github.com/grpc-ecosystem/grpc-gateway). Therefore, instead of using gRPC, you can also use HTTP to broadcast the same transaction, on the `POST /cosmos/tx/v1beta1/txs` endpoint. An example can be seen [here TODO](https://github.com/cosmos/cosmos-sdk/issues/7657) +#### Tendermint RPC + +The three methods presented above are actually higher abstractions over the Tendermint RPC `/broadcast_tx_{async,sync,commit}` endpoints, documented [here](https://docs.tendermint.com/master/rpc/#/Tx). This means that you can use the Tendermint RPC endpoints directly to broadcast the transaction, if you wish so. + ## Next {hide} Learn about the [context](./context.md) {hide} From 7aba22bb86853bad2d44a5fcfa0f62b1c4326a57 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 4 Dec 2020 14:10:17 +0100 Subject: [PATCH 03/10] -Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into am-7657-grpc --- docs/README.md | 5 +++-- docs/core/grpc_rest.md | 2 +- docs/interfaces/README.md | 4 ++-- docs/migrations/README.md | 11 +++++++++++ docs/migrations/rest.md | 4 ++++ docs/run-node/README.md | 2 +- docs/run-node/interact-node.md | 8 ++++++++ 7 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 docs/migrations/README.md diff --git a/docs/README.md b/docs/README.md index 73b237262aeb..2e91fcd71c51 100644 --- a/docs/README.md +++ b/docs/README.md @@ -48,7 +48,7 @@ aside: false ## Get Started - **[SDK Intro](./intro/overview.md)**: High-level overview of the Cosmos SDK. -- **[Quick Start Guide](./using-the-sdk/quick-start.md)**: Scaffold a standard Cosmos SDK app and run a node. +- **[Quick Start Guide](./using-the-sdk/quick-start.md)**: Scaffold a standard Cosmos SDK app and run a node. - **[SDK Application Tutorial](https://github.com/cosmos/sdk-application-tutorial)**: A tutorial that showcases how to build an SDK-based blockchain from scratch and explains the basic principles of the SDK in the process. ## Reference @@ -56,7 +56,8 @@ aside: false - **[Basics](./basics/)**: Documentation on the basic concepts of the Cosmos SDK, like the standard anatomy of an application, the transaction lifecycle and accounts management. - **[Core](./core/)**: Documentation on the core concepts of the Cosmos SDK, like `baseapp`, the `store` or the `server`. - **[Building Modules](./building-modules/)**: Important concepts for module developers like `message`s, `keeper`s, `handler`s and `querier`s. -- **[Interfaces](./interfaces/)**: Documentation on building interfaces for Cosmos SDK applications. +- **[Running a Node and API](./run-node/)**: Documentation on how to run a node, and the API used for interacting with it. +- **[Migrations](./migrations/)**: Migration guides for updating to Stargate. ## Other Resources diff --git a/docs/core/grpc_rest.md b/docs/core/grpc_rest.md index 52bfda7e0be9..1d464aaa182e 100644 --- a/docs/core/grpc_rest.md +++ b/docs/core/grpc_rest.md @@ -55,7 +55,7 @@ If, for various reasons, you cannot use gRPC (for example, you are building a we [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.Query/AllBalances` 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: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc0/proto/cosmos/bank/v1beta1/query.proto#L19-L22 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/proto/cosmos/bank/v1beta1/query.proto#L19-L22 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. diff --git a/docs/interfaces/README.md b/docs/interfaces/README.md index 287045901c52..f7fc2cd6e29f 100644 --- a/docs/interfaces/README.md +++ b/docs/interfaces/README.md @@ -1,10 +1,10 @@ -# Interfaces +# Interfaces (Deprecated) This repository contains documentation on interfaces for Cosmos SDK applications. diff --git a/docs/migrations/README.md b/docs/migrations/README.md new file mode 100644 index 000000000000..8e4044a1fcba --- /dev/null +++ b/docs/migrations/README.md @@ -0,0 +1,11 @@ + + +# Core Concepts + +This folder contains all the migration guides to update your app and modules to Cosmos v0.40 Stargate. + +1. [REST Endpoints Migration](./rest.md) diff --git a/docs/migrations/rest.md b/docs/migrations/rest.md index 82881669533c..d62ef9a44f38 100644 --- a/docs/migrations/rest.md +++ b/docs/migrations/rest.md @@ -1,3 +1,7 @@ + + # REST Endpoints Migration Migrate your REST endpoints to the Stargate ones. {synopsis} diff --git a/docs/run-node/README.md b/docs/run-node/README.md index dbc6e284a215..3d8d93b4c876 100644 --- a/docs/run-node/README.md +++ b/docs/run-node/README.md @@ -4,7 +4,7 @@ parent: order: 5 --> -# Running a Node +# Running a Node and API This folder contains documentation on how to run a node and interact with it. diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index 7442442d1d59..198373df87ff 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -49,4 +49,12 @@ You should see two delegations, the first one made from the `gentx`, and the sec ## Using gRPC +The Protobuf ecosystem developed multiple gRPC clients. gRPC clients + +### grpcurl + +### CosmJS + +CosmJS documentation can be found at https://cosmos.github.io/cosmjs/. As of December 2020, CosmJS documentation is still work in progress. + ## Using the REST Endpoints From 61b9378a3e3c263c2250b27e4847c1f6aac61cd2 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 4 Dec 2020 14:14:38 +0100 Subject: [PATCH 04/10] Update READMEs --- docs/README.md | 1 + docs/migrations/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 2e91fcd71c51..f1632e0477fe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,6 +56,7 @@ aside: false - **[Basics](./basics/)**: Documentation on the basic concepts of the Cosmos SDK, like the standard anatomy of an application, the transaction lifecycle and accounts management. - **[Core](./core/)**: Documentation on the core concepts of the Cosmos SDK, like `baseapp`, the `store` or the `server`. - **[Building Modules](./building-modules/)**: Important concepts for module developers like `message`s, `keeper`s, `handler`s and `querier`s. +- **[IBC](./ibc/)**: Documentation for the IBC protocol integration and concepts. - **[Running a Node and API](./run-node/)**: Documentation on how to run a node, and the API used for interacting with it. - **[Migrations](./migrations/)**: Migration guides for updating to Stargate. diff --git a/docs/migrations/README.md b/docs/migrations/README.md index 8e4044a1fcba..faf64e5dedd4 100644 --- a/docs/migrations/README.md +++ b/docs/migrations/README.md @@ -4,7 +4,7 @@ parent: order: 6 --> -# Core Concepts +# Migrations This folder contains all the migration guides to update your app and modules to Cosmos v0.40 Stargate. From 436499ca6f72ca6502bcc0ae39361329070ed835 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 4 Dec 2020 16:03:44 +0100 Subject: [PATCH 05/10] Add grpcurl --- docs/run-node/interact-node.md | 48 ++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index 198373df87ff..a32984c6ea29 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -8,6 +8,7 @@ There are multiple ways to interact with a node: using the CLI, using gRPC or us ## Pre-requisite Readings +- [gRPC, REST and Tendermint Endpoints](../core/grpc_rest.md) {prereq} - [Running a Node](./run-node.md) {prereq} ## Using the CLI @@ -49,9 +50,52 @@ You should see two delegations, the first one made from the `gentx`, and the sec ## Using gRPC -The Protobuf ecosystem developed multiple gRPC clients. gRPC clients +The Protobuf ecosystem developed tools for different use cases, including code-generation from `*.proto` files into various languages. These tools allow to build clients easily. Often, the client connection (i.e. the transport) can be plugged and replaced very easily. Let's explore one of the most popular transport: [gRPC](../core/grpc_rest.md). -### grpcurl +Since the code generation library largely depends on your own tech stack, we will only present two alternatives: + +- `grpcurl` for generic debugging and testing, +- CosmJS for JavaScript/TypeScript developers. + +### grpcurl: Reflection, Queries, and Simulation + +[grpcurl])https://github.com/fullstorydev/grpcurl is like `curl` but for gRPC. It is also available as a Go library, but we will use it only as a CLI command for debugging and testing purposes. Follow the instructions in the previous link to install it. + +Assuming you have a local node running (either a localnet, or connected to our devnet), you should be able to run the following to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node): + +```sh +grpcurl -plaintext localhost:9090 list +``` + +You should see a list of gRPC services, like `cosmos.bank.v1beta1.Query`. This is called reflection, which is a Protobuf endpoint returning a description of all available endpoints. Each of these represents a different Protobuf service, and each service exposes multiple RPC methods you can query against. + +In the Cosmos SDK, we use [gogoprotobuf](https://github.com/gogo/protobuf) for code generation, and [grpc-go](https://github.com/grpc/grpc-go) for creating the gRPC server. Unfortunately, these two don't play well together, and more in-depth reflection (such as using grpcurl's `describe`) is not possible. See [this issue](https://github.com/grpc/grpc-go/issues/1873) for more info. + +Instead, we need to manually pass the reference to relevant `.proto` files. For example: + +```sh +grpcurl \ + -import-path ./proto \ # Import these proto files too + -import-path ./third_party/proto \ # Import these proto files too + -proto ./proto/cosmos/bank/v1beta1/query.proto \ # That's the proto file with the description of your service + localhost:9090 \ + describe cosmos.bank.v1beta1.Query # Service we want to inspect +``` + +#### Queries + +Given the Protobuf definitions, mkeing a gRPC query is straightforward + +```sh +grpcurl \ + -plaintext + -import-path ./proto \ + -import-path ./third_party/proto \ + -proto ./proto/cosmos/bank/v1beta1/query.proto \ + -d '{"address":"$MY_VALIDATOR"}' + localhost:9090 \ + cosmos.bank.v1beta1.Query/AllBalances +``` ### CosmJS From 6ee5e52aa6ab7b966fa1cff242e4186daca4d174 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 7 Dec 2020 15:33:07 +0100 Subject: [PATCH 06/10] Finish docs --- docs/README.md | 2 +- docs/core/node.md | 2 +- docs/run-node/README.md | 2 +- docs/run-node/interact-node.md | 33 ++++++++++++++++++++++++++++----- docs/run-node/keyring.md | 4 ++++ 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/docs/README.md b/docs/README.md index f1632e0477fe..18398752a03f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -57,7 +57,7 @@ aside: false - **[Core](./core/)**: Documentation on the core concepts of the Cosmos SDK, like `baseapp`, the `store` or the `server`. - **[Building Modules](./building-modules/)**: Important concepts for module developers like `message`s, `keeper`s, `handler`s and `querier`s. - **[IBC](./ibc/)**: Documentation for the IBC protocol integration and concepts. -- **[Running a Node and API](./run-node/)**: Documentation on how to run a node, and the API used for interacting with it. +- **[Running a Node, API, CLI](./run-node/)**: Documentation on how to run a node, and how to interact with it using the CLI and the API. - **[Migrations](./migrations/)**: Migration guides for updating to Stargate. ## Other Resources diff --git a/docs/core/node.md b/docs/core/node.md index 825344040d44..005aab3ab188 100644 --- a/docs/core/node.md +++ b/docs/core/node.md @@ -69,7 +69,7 @@ Upon starting, the node will bootstrap its RPC and P2P server and start dialing ## Other commands -To discover how to concretely run a node and interact with it, please refer to our [Running a Node](../run-node/README.md) guide. +To discover how to concretely run a node and interact with it, please refer to our [Running a Node, API and CLI](../run-node/README.md) guide. ## Next {hide} diff --git a/docs/run-node/README.md b/docs/run-node/README.md index 3d8d93b4c876..9ff1d1666ae1 100644 --- a/docs/run-node/README.md +++ b/docs/run-node/README.md @@ -4,7 +4,7 @@ parent: order: 5 --> -# Running a Node and API +# Running a Node, API and CLI This folder contains documentation on how to run a node and interact with it. diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index a32984c6ea29..cc0cc92457cf 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -61,9 +61,9 @@ Since the code generation library largely depends on your own tech stack, we wil [grpcurl])https://github.com/fullstorydev/grpcurl is like `curl` but for gRPC. It is also available as a Go library, but we will use it only as a CLI command for debugging and testing purposes. Follow the instructions in the previous link to install it. -Assuming you have a local node running (either a localnet, or connected to our devnet), you should be able to run the following to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node): +Assuming you have a local node running (either a localnet, or connected to our devnet), you should be able to run the following to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, it's configured under the `grpc.address` field inside `app.toml`): -```sh +```bash grpcurl -plaintext localhost:9090 list ``` @@ -73,7 +73,7 @@ In the Cosmos SDK, we use [gogoprotobuf](https://github.com/gogo/protobuf) for c Instead, we need to manually pass the reference to relevant `.proto` files. For example: -```sh +```bash grpcurl \ -import-path ./proto \ # Import these proto files too -import-path ./third_party/proto \ # Import these proto files too @@ -84,9 +84,9 @@ grpcurl \ #### Queries -Given the Protobuf definitions, mkeing a gRPC query is straightforward +Given the Protobuf definitions, mkeing a gRPC query is straightforward, by calling the correct `Query` service RPC method, and by passing the request argument as data (`-d` flag): -```sh +```bash grpcurl \ -plaintext -import-path ./proto \ @@ -97,8 +97,31 @@ grpcurl \ cosmos.bank.v1beta1.Query/AllBalances ``` +As described in the previous paragraph, passing the paths to `.proto` files is necessary. + +The list of all available gRPC query endpoints is [coming soon](https://github.com/cosmos/cosmos-sdk/issues/7786). + ### CosmJS CosmJS documentation can be found at https://cosmos.github.io/cosmjs/. As of December 2020, CosmJS documentation is still work in progress. ## Using the REST Endpoints + +As described in the [gRPC guide](../core/grpc_rest.md), all gRPC services on the Cosmos SDK are made available for more convenient REST-based queries through gRPC-gateway. The format of the URL path is based on the Protobuf service method's full-qualified name, but may contain small customizations so that final URLs look more idiomatic. For example, the REST endpoint for the `cosmos.bank.v1beta1.Query/AllBalances` method is `GET /cosmos/bank/v1beta1/balances`. + +Concretely, the `curl` command to make this request is: + +```bash +curl \ + -X GET + -d '{"address":"$MY_VALIDATOR"}' + http://localhost:1317/cosmos/bank/v1beta1/balances +``` + +Make sure to replace `localhost:1317` with the REST endpoint of your node, configured under the `api.address` field. + +The list of all available REST endpoints is available as a Swagger specification file, it can be viewed at `localhost:1317/swagger`. Make sure that the `api.swagger` field is set to true in your `app.toml` file. + +## Next {hide} + +Read about [generating and signing transactions](TODO https://github.com/cosmos/cosmos-sdk/issues/7657). {hide} diff --git a/docs/run-node/keyring.md b/docs/run-node/keyring.md index a0bc0254f7f3..e84a4d07181b 100644 --- a/docs/run-node/keyring.md +++ b/docs/run-node/keyring.md @@ -121,3 +121,7 @@ MY_VALIDATOR_ADDRESS=$(simd keys show my_validator -a --keyring-backend test) This command generates a new 24-word mnemonic phrase, persists it to the relevant backend, and outputs information about the keypair. If this keypair will be used to hold value-bearing tokens, be sure to write down the mnemonic phrase somewhere safe! By default, the keyring generates a `secp256k1` keypair. The keyring also supports `ed25519` keys, which may be created by passing the `--algo ed25519` flag. A keyring can of course hold both types of keys simultaneously, and the Cosmos SDK's `x/auth` module (in particular its [AnteHandlers](../core/baseapp.md#antehandler)) supports natively these two public key algorithms. + +## Next {hide} + +Read about [running a node](./run-node.md) {hide} From 84768c28f6ea564dd73a8a95cc57e6e1fc87e66b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 7 Dec 2020 15:57:19 +0100 Subject: [PATCH 07/10] Add gRPC historical blocks --- docs/core/transactions.md | 2 +- docs/run-node/interact-node.md | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/core/transactions.md b/docs/core/transactions.md index 1bf642578874..581a8a4de021 100644 --- a/docs/core/transactions.md +++ b/docs/core/transactions.md @@ -141,7 +141,7 @@ simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake The `Tx` service exposes a handful of utility functions, such as simulating a transaction or querying a transaction, and also one method to broadcast transactions. -An example of broadcasting a transaction is shown in [TODO](https://github.com/cosmos/cosmos-sdk/issues/7657). Please note that the `BroadcastTx` endpoint takes `TxRaw`, not bytes. +An example of broadcasting a transaction is shown in [TODO](https://github.com/cosmos/cosmos-sdk/issues/7657). #### REST diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index cc0cc92457cf..6b9b60a02d57 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -84,7 +84,7 @@ grpcurl \ #### Queries -Given the Protobuf definitions, mkeing a gRPC query is straightforward, by calling the correct `Query` service RPC method, and by passing the request argument as data (`-d` flag): +Given the Protobuf definitions, making a gRPC query is straightforward, by calling the correct `Query` service RPC method, and by passing the request argument as data (`-d` flag): ```bash grpcurl \ @@ -92,13 +92,29 @@ grpcurl \ -import-path ./proto \ -import-path ./third_party/proto \ -proto ./proto/cosmos/bank/v1beta1/query.proto \ - -d '{"address":"$MY_VALIDATOR"}' + -d '{"address":"$MY_VALIDATOR"}' \ localhost:9090 \ cosmos.bank.v1beta1.Query/AllBalances ``` As described in the previous paragraph, passing the paths to `.proto` files is necessary. +You may also query for historical data by passing some [gRPC metadata](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md): the `x-cosmos-block-height` metadata should contain the block to query: + +```bash +grpcurl \ + -plaintext + -import-path ./proto \ + -import-path ./third_party/proto \ + -proto ./proto/cosmos/bank/v1beta1/query.proto \ + -H "x-cosmos-block-height: 279256" \ + -d '{"address":"$MY_VALIDATOR"}' \ + localhost:9090 \ + cosmos.bank.v1beta1.Query/AllBalances +``` + +Assuming the state at that block has not yet been pruned by the node, this query should return a non-empty response. + The list of all available gRPC query endpoints is [coming soon](https://github.com/cosmos/cosmos-sdk/issues/7786). ### CosmJS @@ -107,15 +123,14 @@ CosmJS documentation can be found at https://cosmos.github.io/cosmjs/. As of Dec ## Using the REST Endpoints -As described in the [gRPC guide](../core/grpc_rest.md), all gRPC services on the Cosmos SDK are made available for more convenient REST-based queries through gRPC-gateway. The format of the URL path is based on the Protobuf service method's full-qualified name, but may contain small customizations so that final URLs look more idiomatic. For example, the REST endpoint for the `cosmos.bank.v1beta1.Query/AllBalances` method is `GET /cosmos/bank/v1beta1/balances`. +As described in the [gRPC guide](../core/grpc_rest.md), all gRPC services on the Cosmos SDK are made available for more convenient REST-based queries through gRPC-gateway. The format of the URL path is based on the Protobuf service method's full-qualified name, but may contain small customizations so that final URLs look more idiomatic. For example, the REST endpoint for the `cosmos.bank.v1beta1.Query/AllBalances` method is `GET /cosmos/bank/v1beta1/balances/{address}`. Request arguments are passed as query parameters. -Concretely, the `curl` command to make this request is: +As a concrete example, the `curl` command to make balances request is: ```bash curl \ - -X GET - -d '{"address":"$MY_VALIDATOR"}' - http://localhost:1317/cosmos/bank/v1beta1/balances + -X GET \ + http://localhost:1317/cosmos/bank/v1beta1/balances/$MY_VALIDATOR ``` Make sure to replace `localhost:1317` with the REST endpoint of your node, configured under the `api.address` field. @@ -124,4 +139,4 @@ The list of all available REST endpoints is available as a Swagger specification ## Next {hide} -Read about [generating and signing transactions](TODO https://github.com/cosmos/cosmos-sdk/issues/7657). {hide} +Sending transactions using gRPC and REST requires some additional steps: generating the transaction, signing it, and finally broadcasting it. Read about [generating and signing transactions](TODO https://github.com/cosmos/cosmos-sdk/issues/7657). {hide} From 41713773a075a91ed2d29d28e855c255e719d42b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 7 Dec 2020 16:02:36 +0100 Subject: [PATCH 08/10] Add historical queries --- docs/run-node/interact-node.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index 6b9b60a02d57..5e22d482aabe 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -82,8 +82,6 @@ grpcurl \ describe cosmos.bank.v1beta1.Query # Service we want to inspect ``` -#### Queries - Given the Protobuf definitions, making a gRPC query is straightforward, by calling the correct `Query` service RPC method, and by passing the request argument as data (`-d` flag): ```bash @@ -99,7 +97,11 @@ grpcurl \ As described in the previous paragraph, passing the paths to `.proto` files is necessary. -You may also query for historical data by passing some [gRPC metadata](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md): the `x-cosmos-block-height` metadata should contain the block to query: +The list of all available gRPC query endpoints is [coming soon](https://github.com/cosmos/cosmos-sdk/issues/7786). + +### Query for historical state using gRPC + +You may also query for historical data by passing some [gRPC metadata](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md) to the query: the `x-cosmos-block-height` metadata should contain the block to query. Using grpcurl as above, the command looks like: ```bash grpcurl \ @@ -115,8 +117,6 @@ grpcurl \ Assuming the state at that block has not yet been pruned by the node, this query should return a non-empty response. -The list of all available gRPC query endpoints is [coming soon](https://github.com/cosmos/cosmos-sdk/issues/7786). - ### CosmJS CosmJS documentation can be found at https://cosmos.github.io/cosmjs/. As of December 2020, CosmJS documentation is still work in progress. @@ -130,6 +130,7 @@ As a concrete example, the `curl` command to make balances request is: ```bash curl \ -X GET \ + -H "Content-Type: application/json" \ http://localhost:1317/cosmos/bank/v1beta1/balances/$MY_VALIDATOR ``` @@ -137,6 +138,20 @@ Make sure to replace `localhost:1317` with the REST endpoint of your node, confi The list of all available REST endpoints is available as a Swagger specification file, it can be viewed at `localhost:1317/swagger`. Make sure that the `api.swagger` field is set to true in your `app.toml` file. +### Query for historical state using REST + +Querying for historical state is done using the HTTP header `x-cosmos-block-height`. For example, a curl command would look like: + +```bash +curl \ + -X GET \ + -H "Content-Type: application/json" \ + -H "x-cosmos-block-height: 279256" + http://localhost:1317/cosmos/bank/v1beta1/balances/$MY_VALIDATOR +``` + +Assuming the state at that block has not yet been pruned by the node, this query should return a non-empty response. + ## Next {hide} Sending transactions using gRPC and REST requires some additional steps: generating the transaction, signing it, and finally broadcasting it. Read about [generating and signing transactions](TODO https://github.com/cosmos/cosmos-sdk/issues/7657). {hide} From 5671fd105402a24c489b7449e4a320a1030e33d5 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 7 Dec 2020 16:24:14 +0100 Subject: [PATCH 09/10] Small tweaks --- docs/run-node/interact-node.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index 5e22d482aabe..ca338c1313e3 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -61,7 +61,7 @@ Since the code generation library largely depends on your own tech stack, we wil [grpcurl])https://github.com/fullstorydev/grpcurl is like `curl` but for gRPC. It is also available as a Go library, but we will use it only as a CLI command for debugging and testing purposes. Follow the instructions in the previous link to install it. -Assuming you have a local node running (either a localnet, or connected to our devnet), you should be able to run the following to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, it's configured under the `grpc.address` field inside `app.toml`): +Assuming you have a local node running (either a localnet, or connected a live network), you should be able to run the following command to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, which is configured under the `grpc.address` field inside `app.toml`): ```bash grpcurl -plaintext localhost:9090 list @@ -82,7 +82,7 @@ grpcurl \ describe cosmos.bank.v1beta1.Query # Service we want to inspect ``` -Given the Protobuf definitions, making a gRPC query is straightforward, by calling the correct `Query` service RPC method, and by passing the request argument as data (`-d` flag): +Once the Protobuf definitions are given, making a gRPC query is then straightforward, by calling the correct `Query` service RPC method, and by passing the request argument as data (`-d` flag): ```bash grpcurl \ @@ -95,8 +95,6 @@ grpcurl \ cosmos.bank.v1beta1.Query/AllBalances ``` -As described in the previous paragraph, passing the paths to `.proto` files is necessary. - The list of all available gRPC query endpoints is [coming soon](https://github.com/cosmos/cosmos-sdk/issues/7786). ### Query for historical state using gRPC From d7f28d0fa1818be9cf92f5961d234931ddc046c3 Mon Sep 17 00:00:00 2001 From: Amaury Date: Wed, 9 Dec 2020 17:50:40 +0100 Subject: [PATCH 10/10] Update docs/core/grpc_rest.md Co-authored-by: Marie Gauthier --- docs/core/grpc_rest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/grpc_rest.md b/docs/core/grpc_rest.md index 1d464aaa182e..d24309f024fe 100644 --- a/docs/core/grpc_rest.md +++ b/docs/core/grpc_rest.md @@ -4,7 +4,7 @@ order: 7 # gRPC, REST, and Tendermint Endpoints -This document prevents an overview of all the endpoints a node exposes: gRPC, REST as well as some other endpoints. {synopsis} +This document presents an overview of all the endpoints a node exposes: gRPC, REST as well as some other endpoints. {synopsis} ## An Overview of All Endpoints