Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update documentation from cosmos-sdk/docs #278

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions docs/build/building-modules/02-messages-and-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,32 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.2/x/bank/proto/cosmos/ban
If there is a need for custom signers then there is an alternative path which can be taken. A function which returns `signing.CustomGetSigner` for a specific message can be defined.

```go
func ProvideBankSendTransactionGetSigners() signing.CustomGetSigner {
func ProvideCustomMsgTransactionGetSigners() signing.CustomGetSigner {
// Extract the signer from the signature.
signer, err := coretypes.LatestSigner(Tx).Sender(ethTx)
if err != nil {
if err != nil {
return nil, err
}

// Return the signer in the required format.
return [][]byte{signer.Bytes()}, nil
return signing.CustomGetSigner{
MsgType: protoreflect.FullName(gogoproto.MessageName(&types.CustomMsg{})),
Fn: func(msg proto.Message) ([][]byte, error) {
return [][]byte{signer}, nil
}
}
}
```

This can be provided to the application using depinject's `Provide` method in the application's `app.go`:
This can be provided to the application using depinject's `Provide` method in the module that defines the type:

```go
depinject.Provide(banktypes.ProvideBankSendTransactionGetSigners)
```diff
func init() {
appconfig.RegisterModule(&modulev1.Module{},
- appconfig.Provide(ProvideModule),
+ appconfig.Provide(ProvideModule, ProvideCustomMsgTransactionGetSigners),
)
}
```

The Cosmos SDK uses Protobuf definitions to generate client and server code:
Expand Down
4 changes: 2 additions & 2 deletions docs/build/migrations/02-upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,8 @@ The `simapp` package **should not be imported in your own app**. Instead, you sh
#### App Wiring

SimApp's `app_di.go` is using [App Wiring](https://docs.cosmos.network/main/build/building-apps/app-go-di), the dependency injection framework of the Cosmos SDK.
This means that modules are injected directly into SimApp thanks to a [configuration file](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go).
The previous behavior, without the dependency injection framework, is still present in [`app.go`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go) and is not going anywhere.
This means that modules are injected directly into SimApp thanks to a [configuration file](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/simapp/app_config.go).
The previous behavior, without the dependency injection framework, is still present in [`app.go`](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/simapp/app.go) and is not going anywhere.

If you are using a `app.go` without dependency injection, add the following lines to your `app.go` in order to provide newer gRPC services:

Expand Down
45 changes: 31 additions & 14 deletions docs/build/modules/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,52 @@
---
sidebar_position: 0
---
<!-- markdown-link-check-disable -->

# List of Modules

Here are some production-grade modules that can be used in Cosmos SDK applications, along with their respective documentation:

* [Accounts](./accounts/README.md) - Tools and infrastructure for creating advanced smart accounts.
## Essential Modules

Essential modules include functionality that _must_ be included in your Cosmos SDK blockchain.
These modules provide the core behaviors that are needed for users and operators such as balance tracking,
proof-of-stake capabilities and governance.

* [Auth](./auth/README.md) - Authentication of accounts and transactions for Cosmos SDK applications.
* [Authz](./authz/README.md) - Authorization for accounts to perform actions on behalf of other accounts.
* [Bank](./bank/README.md) - Token transfer functionalities.
* [Bank v2](./bank/v2/README.md) - Token transfer functionalities, enhanced.
* [Circuit](./circuit/README.md) - Circuit breaker module for pausing messages.
* [Consensus](./consensus/README.md) - Consensus module for modifying CometBFT's ABCI consensus params.
* [Distribution](./distribution/README.md) - Fee distribution, and staking token provision distribution.
* [Epochs](./epochs/README.md) - Allow other modules to set that they would like to be signaled once every period
* [Evidence](./evidence/README.md) - Evidence handling for double signing, misbehaviour, etc.
* [Feegrant](./feegrant/README.md) - Grant fee allowances for executing transactions.
* [Genutil](./genutil/README.md) - Genesis utilities for the Cosmos SDK.
* [Governance](./gov/README.md) - On-chain proposals and voting.
* [Group](./group/README.md) - On-chain multisig accounts creation and management.
* [Genutil](./genutil/README.md) - Genesis utilities for the Cosmos SDK.
* [Mint](./mint/README.md) - Creation of new units of staking token.
* [NFT](./nft/README.md) - NFT module implemented based on [ADR43](https://docs.cosmos.network/main/build/architecture/adr-043-nft-module).
* [Protocolpool](./protocolpool/README.md) - Functionalities handling community pool funds.
* [Slashing](./slashing/README.md) - Validator punishment mechanisms.
* [Staking](./staking/README.md) - Proof-of-Stake layer for public blockchains.
* [Tx](./tx/README.md) - Tx utilities for the Cosmos SDK.
* [Upgrade](./upgrade/README.md) - Software upgrades handling and coordination.
* [Validate](./validate/README.md) - Global ante/post handlers and tx validator setup.

To learn more about the process of building modules, visit the [building modules reference documentation](https://docs.cosmos.network/main/build/building-modules/intro).
## Supplementary Modules

Supplementary modules are modules that are maintained in the Cosmos SDK but are not necessary for
the core functionality of your blockchain. They can be thought of as ways to extend the
capabilities of your blockchain or further specialize it.

* [Authz](./authz/README.md) - Authorization for accounts to perform actions on behalf of other accounts.
* [Epochs](./epochs/README.md) - Registration so SDK modules can have logic to be executed at the timed tickers.
* [Feegrant](./feegrant/README.md) - Grant fee allowances for executing transactions.
* [Group](./group/README.md) - Allows for the creation and management of on-chain multisig accounts.
* [NFT](./nft/README.md) - NFT module implemented based on [ADR43](https://docs.cosmos.network/main/architecture/adr-043-nft-module.html).
* [ProtocolPool](./protocolpool/README.md) - Extended management of community pool functionality.

## Deprecated Modules

The following modules are deprecated. They will no longer be maintained and eventually will be removed
in an upcoming release of the Cosmos SDK per our [release process](../RELEASE_PROCESS.md).

* [Crisis](./crisis/README.md) - *Deprecated* halting the blockchain under certain circumstances (e.g. if an invariant is broken).
* [Params](./params/README.md) - *Deprecated* Globally available parameter store.

To learn more about the process of building modules, visit the [building modules reference documentation](https://docs.cosmos.network/main/building-modules/intro).

## IBC

Expand All @@ -43,4 +60,4 @@ The CosmWasm module enables smart contracts, learn more by going to their [docum

## EVM

Read more about writing smart contracts with solidity at the official [`evm` documentation page](https://docs.evmos.org/).
Read more about writing smart contracts with solidity at the official [`evm` documentation page](https://docs.evmos.org/modules/evm/).
2 changes: 1 addition & 1 deletion docs/build/packages/01-depinject.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Provider functions serve as the basis for the dependency tree. They are analysed

`depinject` supports the use of interface types as inputs to provider functions, which helps decouple dependencies between modules. This approach is particularly useful for managing complex systems with multiple modules, such as the Cosmos SDK, where dependencies need to be flexible and maintainable.

For example, `x/bank` expects an [AccountKeeper](https://pkg.go.dev/cosmossdk.io/x/bank/types#AccountKeeper) interface as [input to ProvideModule](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/module.go#L208-L260). `SimApp` uses the implementation in `x/auth`, but the modular design allows for easy changes to the implementation if needed.
For example, `x/bank` expects an [AccountKeeper](https://pkg.go.dev/cosmossdk.io/x/bank/types#AccountKeeper) interface as [input to ProvideModule](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/bank/module.go#L208-L260). `SimApp` uses the implementation in `x/auth`, but the modular design allows for easy changes to the implementation if needed.

Consider the following example:

Expand Down
Loading