forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(core): add core documentation and principles (cosmos#21511)
Co-authored-by: Aaron Craelius <[email protected]>
- Loading branch information
1 parent
70488a8
commit 6fc677f
Showing
39 changed files
with
118 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
# Cosmos SDK Core | ||
|
||
The [cosmossdk.io/core](https://pkg.go.dev/cosmossdk.io/core) go module defines | ||
"core" functionality for the Cosmos SDK. | ||
The [cosmossdk.io/core](https://pkg.go.dev/cosmossdk.io/core) Go module defines essential APIs and interfaces for the Cosmos SDK ecosystem. It serves as a foundation for building modular blockchain applications. | ||
|
||
Currently functionality for registering modules using the [appmodule](https://pkg.go.dev/cosmossdk.io/core/appmodule) | ||
package and composing apps using the [appconfig](https://pkg.go.dev/cosmossdk.io/core/appconfig) | ||
package is provided. | ||
Key features and principles: | ||
|
||
In the future core functionality for building Cosmos SDK app modules will be | ||
provided in this go module. | ||
1. Provides stable, long-term maintained APIs for module development and app composition. | ||
2. Focuses on interface definitions without implementation details. | ||
3. Implementations are housed in the runtime(/v2) or individual modules. | ||
4. Modules depend solely on core APIs for maximum compatibility. | ||
5. New API additions undergo thorough consideration to maintain stability. | ||
6. Adheres to a no-breaking-changes policy for reliable dependency management. | ||
7. Aimed to have zero dependencies, ensuring a lightweight and self-contained foundation. | ||
|
||
The core module offers the [appmodule](https://pkg.go.dev/cosmossdk.io/core/appmodule) and [appmodule/v2](https://pkg.go.dev/cosmossdk.io/core/appmodule/v2) packages that include APIs to describe how modules can be written. | ||
Additionally, it contains all core services APIs that can be used in modules to interact with the SDK, majoritarily via the `appmodule.Environment` struct. | ||
Last but not least, it provides codecs and packages for the Cosmos SDK's core types (think of, for instance, logger, store interface or an address codec). | ||
|
||
Developers and contributors approach core API design with careful deliberation, ensuring that additions provide significant value while maintaining the module's stability and simplicity. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// Package appmodule defines the functionality for registering Cosmos SDK app | ||
// modules that are assembled using the cosmossdk.io/depinject | ||
// dependency injection system and the declarative app configuration format | ||
// handled by the appconfig package. | ||
// Package appmodule defines what is needed for an module to be used in the Cosmos SDK (runtime). | ||
// It is equivalent to the appmodulev2 package, but less flexible to stay compatible with baseapp instead of server/v2. | ||
// If you are looking at integrating dependency injection into your module please see depinject appconfig documentation. | ||
package appmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package appmodule | ||
|
||
import ( | ||
"cosmossdk.io/core/appmodule/v2" | ||
appmodulev2 "cosmossdk.io/core/appmodule/v2" | ||
) | ||
|
||
// Environment is used to get all services to their respective module | ||
// Contract: All fields of environment are always populated. | ||
type Environment = appmodule.Environment | ||
// Environment is used to get all services to their respective module. | ||
// Contract: All fields of environment are always populated by runtime. | ||
type Environment = appmodulev2.Environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package appmodule | ||
|
||
import ( | ||
"cosmossdk.io/core/appmodule/v2" | ||
appmodulev2 "cosmossdk.io/core/appmodule/v2" | ||
) | ||
|
||
// HasConsensusVersion is the interface for declaring a module consensus version. | ||
type HasConsensusVersion = appmodule.HasConsensusVersion | ||
type HasConsensusVersion = appmodulev2.HasConsensusVersion | ||
|
||
// HasMigrations is implemented by a module which upgrades or has upgraded to a new consensus version. | ||
type HasMigrations = appmodule.HasMigrations | ||
type HasMigrations = appmodulev2.HasMigrations | ||
|
||
// MigrationRegistrar is the interface for registering in-place store migrations. | ||
type MigrationRegistrar = appmodule.MigrationRegistrar | ||
type MigrationRegistrar = appmodulev2.MigrationRegistrar | ||
|
||
// MigrationHandler is the migration function that each module registers. | ||
type MigrationHandler = appmodule.MigrationHandler | ||
type MigrationHandler = appmodulev2.MigrationHandler | ||
|
||
// VersionMap is a map of moduleName -> version | ||
type VersionMap = appmodule.VersionMap | ||
type VersionMap = appmodulev2.VersionMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Package appmodule defines what is needed for an module to be used in the Cosmos SDK (runtime/v2). | ||
// If you are looking at integrating dependency injection into your module please see depinject appconfig documentation. | ||
package appmodulev2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package appmodule | ||
package appmodulev2 | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package appmodule | ||
package appmodulev2 | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package appmodule | ||
package appmodulev2 | ||
|
||
import "context" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package appmodule | ||
package appmodulev2 | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package appmodule | ||
package appmodulev2 | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// package genesis is used to define appmodule.HasGenesisAuto experimental auto genesis. | ||
// This genesis package isn't supported in server/v2. | ||
package genesis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.