From 6fa9252f3d9144c47fa98e0a449c50f03bd07fe3 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Apr 2022 11:44:11 +0200 Subject: [PATCH] docs: fixes the documentation build (#11542) * docs: fixes the documentation build * add cname Co-authored-by: Marko --- .github/workflows/deploy-docs.yml | 2 +- docs/core/middleware.md | 35 +++++++++++++------------------ docs/output/.gitkeep | 0 docs/output/CNAME | 1 + 4 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 docs/output/.gitkeep create mode 100644 docs/output/CNAME diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index dd9e25e103..2a5893ff4c 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,4 +1,4 @@ -name: Deploy Documentation +name: Deploy docs # This job builds and deploys documenation to github pages. # It runs on every push to master with a change in the docs folder. on: diff --git a/docs/core/middleware.md b/docs/core/middleware.md index f86cff112c..5cbdb18213 100644 --- a/docs/core/middleware.md +++ b/docs/core/middleware.md @@ -4,20 +4,17 @@ order: 3 # Middlewares - `Middlewares` are objects that the developer can create to add logic before or after the transaction handler in a composable manner. {synopsis} ## Pre-requisite Readings * [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} -* [Transactons](transactions.md){prereq} - +* [Transactons](transactions.md) {prereq} ## Middlewares -The SDK Baseapp's implementation of ABCI CheckTx, DeliverTx, and Baseapp's own Simulate methods use a middleware-based design. Middlewares can add logic to be executed before or after a transaction handler execution. Middlewares are like an `antehandler` with the added feature of being able to add post-transaction handler execution. Middlewares allow us to solve use cases like transaction Tips and refund unused gas (issue [#2150](https://github.com/cosmos/cosmos-sdk/issues/2150)). - +The SDK Baseapp's implementation of ABCI CheckTx, DeliverTx, and Baseapp's own Simulate methods use a middleware-based design. Middlewares can add logic to be executed before or after a transaction handler execution. Middlewares are like an `antehandler` with the added feature of being able to add post-transaction handler execution. Middlewares allow us to solve use cases like transaction Tips and refund unused gas (issue [#2150](https://github.com/cosmos/cosmos-sdk/issues/2150)). ### Type Definition @@ -38,12 +35,11 @@ type BaseApp struct { } ``` - ## Implementing a Middleware To implement a middleware is done simply by a Go function that takes as arguments and some parameters and returns a `tx.Middleware`. -For example, we can create a Generic middleware. +For example, we can create a Generic middleware. ```go // myTxHandler is the tx.Handler of this middleware. Note that it holds a @@ -144,17 +140,14 @@ The app developer can define their own middlewares, or use the Cosmos SDK's pre- While the app developer can define and compose the middlewares of their choice, the Cosmos SDK provides a set of middlewares that caters to the ecosystem's most common use cases. These middlewares are: -| Middleware | Description | -| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| RunMsgsTxHandler | This is the base `tx.Handler`. It replaces the old baseapp's `runMsgs`, and executes a transaction's `Msg`s. | -| TxDecoderMiddleware | This middleware takes in transaction raw bytes, and decodes them into a `sdk.Tx`. It replaces the `baseapp.txDecoder` field, so that BaseApp stays as thin as possible. Since most middlewares read the contents of the `sdk.Tx`, the TxDecoderMiddleware should be run first in the middelware stack. | -| {Antehandlers} | Each antehandler is converted to its own middleware. These middlewares perform signature verification, fee deductions and other validations on the incoming transaction. | -| IndexEventsTxMiddleware | This is a simple middleware that chooses which events to index in Tendermint. Replaces `baseapp.indexEvents` (which unfortunately still exists in baseapp too, because it's used to index Begin/EndBlock events) | -| RecoveryTxMiddleware | This index recovers from panics. It replaces baseapp.runTx's panic recovery described in [ADR-022](./adr-022-custom-panic-handling.md). | -| GasTxMiddleware | This replaces the [`Setup`](https://github.com/cosmos/cosmos-sdk/blob/v0.43.0/x/auth/ante/setup.go) Antehandler. It sets a GasMeter on sdk.Context. Note that before, GasMeter was set on sdk.Context inside the antehandlers, and there was some mess around the fact that antehandlers had their own panic recovery system so that the GasMeter could be read by baseapp's recovery system. Now, this mess is all removed: one middleware sets GasMeter, another one handles recovery. -| TipMiddleware | This pays for transaction fees using another denom than the native fee denom of the chain. [`docs`](tips.md) -| SigGasConsumeMiddleware | SigGasConsumeMiddleware consumes parameter-defined amount of gas for each signature. -| SigVerificationMiddleware | verifies all signatures for a tx and return an error if any are invalid - - - +| Middleware | Description | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| RunMsgsTxHandler | This is the base `tx.Handler`. It replaces the old baseapp's `runMsgs`, and executes a transaction's `Msg`s. | +| TxDecoderMiddleware | This middleware takes in transaction raw bytes, and decodes them into a `sdk.Tx`. It replaces the `baseapp.txDecoder` field, so that BaseApp stays as thin as possible. Since most middlewares read the contents of the `sdk.Tx`, the TxDecoderMiddleware should be run first in the middelware stack. | +| {Antehandlers} | Each antehandler is converted to its own middleware. These middlewares perform signature verification, fee deductions and other validations on the incoming transaction. | +| IndexEventsTxMiddleware | This is a simple middleware that chooses which events to index in Tendermint. Replaces `baseapp.indexEvents` (which unfortunately still exists in baseapp too, because it's used to index Begin/EndBlock events) | +| RecoveryTxMiddleware | This index recovers from panics. It replaces baseapp.runTx's panic recovery described in [ADR-022](./adr-022-custom-panic-handling.md). | +| GasTxMiddleware | This replaces the [`Setup`](https://github.com/cosmos/cosmos-sdk/blob/v0.43.0/x/auth/ante/setup.go) Antehandler. It sets a GasMeter on sdk.Context. Note that before, GasMeter was set on sdk.Context inside the antehandlers, and there was some mess around the fact that antehandlers had their own panic recovery system so that the GasMeter could be read by baseapp's recovery system. Now, this mess is all removed: one middleware sets GasMeter, another one handles recovery. | +| TipMiddleware | This pays for transaction fees using another denom than the native fee denom of the chain. [`docs`](tips.md) | +| SigGasConsumeMiddleware | SigGasConsumeMiddleware consumes parameter-defined amount of gas for each signature. | +| SigVerificationMiddleware | verifies all signatures for a tx and return an error if any are invalid | diff --git a/docs/output/.gitkeep b/docs/output/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/output/CNAME b/docs/output/CNAME new file mode 100644 index 0000000000..784f0db986 --- /dev/null +++ b/docs/output/CNAME @@ -0,0 +1 @@ +docs.cosmos.network \ No newline at end of file