From 4c010229bb1e836f5a4e6629ba6e3d2a32f02ba1 Mon Sep 17 00:00:00 2001 From: samricotta <37125168+samricotta@users.noreply.github.com> Date: Wed, 20 Sep 2023 22:53:25 +0300 Subject: [PATCH] fix: amend redirect links so that they point to main (#33) * Update docusaurus.config.js * Update docusaurus.config.js * Update docusaurus.config.js * main updates * First iteration of redirects * Update docusaurus.config.js * Update docusaurus.config.js * Create README.md * Update docusaurus.config.js * homepage * Update docusaurus.config.js * update versions * update to links * packages update * review updates * Update docusaurus.config.js * fix links and redirects --- docs/build/modules/README.md | 1 - .../{libraries => packages}/01-depinject.md | 0 .../{libraries => packages}/02-collections.md | 0 docs/build/{libraries => packages}/03-orm.md | 0 docs/build/{libraries => packages}/README.md | 0 .../{libraries => packages}/_category_.json | 0 docs/build/tooling/README.md | 19 + docusaurus.config.js | 491 +++++++++--------- .../build/building-apps/01-app-go-v2.md | 4 +- .../build/building-modules/15-depinject.md | 4 +- .../build/building-modules/16-testing.md | 2 +- .../version-0.47/build/modules/README.md | 1 - .../{libraries => packages}/01-depinject.md | 0 .../{libraries => packages}/02-collections.md | 0 .../build/{libraries => packages}/03-orm.md | 0 .../04-packages.md => packages/README.md} | 0 .../{libraries => packages}/_category_.json | 0 .../version-0.47/build/tooling/README.md | 11 + .../build/building-modules/00-intro.md | 2 +- .../building-modules/01-module-manager.md | 24 +- .../build/building-modules/06-keeper.md | 4 +- .../build/building-modules/07-invariants.md | 2 +- .../build/building-modules/08-genesis.md | 2 +- .../version-0.50/build/modules/README.md | 41 ++ .../version-0.50/build/packages/README.md | 39 ++ .../version-0.50/build/tooling/README.md | 19 + .../develop/advanced/00-baseapp.md | 18 +- .../develop/advanced/01-transactions.md | 2 +- .../develop/advanced/02-context.md | 2 +- .../version-0.50/develop/advanced/03-node.md | 4 +- .../version-0.50/develop/advanced/04-store.md | 4 +- .../develop/advanced/05-encoding.md | 2 +- .../version-0.50/develop/advanced/07-cli.md | 2 +- .../develop/advanced/08-events.md | 2 +- .../{00-app-anatomy.md => 00-overview-app.md} | 0 .../develop/beginner/01-tx-lifecycle.md | 2 +- .../develop/beginner/03-accounts.md | 2 +- .../develop/beginner/04-gas-fees.md | 2 +- .../develop/intro/03-sdk-design.md | 2 +- .../version-0.50/user/run-node/00-keyring.md | 2 +- .../version-0.50/user/run-node/01-run-node.md | 2 +- 41 files changed, 422 insertions(+), 292 deletions(-) rename docs/build/{libraries => packages}/01-depinject.md (100%) rename docs/build/{libraries => packages}/02-collections.md (100%) rename docs/build/{libraries => packages}/03-orm.md (100%) rename docs/build/{libraries => packages}/README.md (100%) rename docs/build/{libraries => packages}/_category_.json (100%) create mode 100644 docs/build/tooling/README.md rename versioned_docs/version-0.47/build/{libraries => packages}/01-depinject.md (100%) rename versioned_docs/version-0.47/build/{libraries => packages}/02-collections.md (100%) rename versioned_docs/version-0.47/build/{libraries => packages}/03-orm.md (100%) rename versioned_docs/version-0.47/build/{libraries/04-packages.md => packages/README.md} (100%) rename versioned_docs/version-0.47/build/{libraries => packages}/_category_.json (100%) create mode 100644 versioned_docs/version-0.47/build/tooling/README.md create mode 100644 versioned_docs/version-0.50/build/modules/README.md create mode 100644 versioned_docs/version-0.50/build/packages/README.md create mode 100644 versioned_docs/version-0.50/build/tooling/README.md rename versioned_docs/version-0.50/develop/beginner/{00-app-anatomy.md => 00-overview-app.md} (100%) diff --git a/docs/build/modules/README.md b/docs/build/modules/README.md index c5a8cc63d..5638335f1 100644 --- a/docs/build/modules/README.md +++ b/docs/build/modules/README.md @@ -1,6 +1,5 @@ --- sidebar_position: 0 -slug : /modules --- # Module Summary diff --git a/docs/build/libraries/01-depinject.md b/docs/build/packages/01-depinject.md similarity index 100% rename from docs/build/libraries/01-depinject.md rename to docs/build/packages/01-depinject.md diff --git a/docs/build/libraries/02-collections.md b/docs/build/packages/02-collections.md similarity index 100% rename from docs/build/libraries/02-collections.md rename to docs/build/packages/02-collections.md diff --git a/docs/build/libraries/03-orm.md b/docs/build/packages/03-orm.md similarity index 100% rename from docs/build/libraries/03-orm.md rename to docs/build/packages/03-orm.md diff --git a/docs/build/libraries/README.md b/docs/build/packages/README.md similarity index 100% rename from docs/build/libraries/README.md rename to docs/build/packages/README.md diff --git a/docs/build/libraries/_category_.json b/docs/build/packages/_category_.json similarity index 100% rename from docs/build/libraries/_category_.json rename to docs/build/packages/_category_.json diff --git a/docs/build/tooling/README.md b/docs/build/tooling/README.md new file mode 100644 index 000000000..1fa6ea2cc --- /dev/null +++ b/docs/build/tooling/README.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 0 +--- + +# Tools + +This section provides documentation on various tooling maintained by the SDK team. +This includes tools for development, operating a node, and ease of use of a Cosmos SDK chain. + +## CLI Tools + +* [Cosmovisor](./01-cosmovisor.md) +* [Confix](./02-confix.md) +* [Hubl](./03-hubl.md) +* [Rosetta](https://docs.cosmos.network/main/run-node/rosetta) + +## Other Tools + +* [Protocol Buffers](./00-protobuf.md) \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index 6a785c9d6..e00111896 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,6 +1,12 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion +const redirectVersions = ["main","v0.50","v0.47"] +const redirects = []; +redirectVersions.forEach((version) => { + redirects.push(...generateRedirects(version)); +}); + const lightCodeTheme = require("prism-react-renderer/themes/github"); const darkCodeTheme = require("prism-react-renderer/themes/dracula"); @@ -49,7 +55,7 @@ const config = { path: "v0.50", label: "v0.50", }, - 0.47: { + "0.47": { path: "v0.47", label: "v0.47", }, @@ -235,252 +241,249 @@ const config = { { fromExtensions: ["html"], toExtensions: ["html"], - // createRedirects(existingPath) { - // return [ - // existingPath.replace("/core", "/develop/advanced"), - // existingPath.replace("/basics", "/develop/beginner"), - // existingPath.replace("/intro", "/develop/intro"), - // existingPath.replace("/architecture", "/build/architecture/"), - // existingPath.replace("/building-apps", "/build/building-apps"), - // existingPath.replace( - // "/building-modules", - // "/build/building-modules" - // ), - // existingPath.replace("/tooling", "/build/libraries"), - // existingPath.replace("/migrations", "/build/libraries"), - // existingPath.replace("/modules", "/build/modules"), - // existingPath.replace("/rfc", "/build/rfc"), - // existingPath.replace("/spec", "/build/spec"), - // existingPath.replace("/tooling", "/build/tooling"), - // existingPath.replace("/run-node", "/user/run-node"), - // existingPath.replace("/validate", "/user/validate"), - // ]; - // }, - // redirects: [ - // { - // from: '/core', - // to: '/develop/advanced', - // }, - // { - // from: '/basics', - // to: '/develop/beginner', - // }, - // { - // from: '/intro', - // to: '/develop/intro', - // }, - // { - // from: '/architecture', - // to: '/build/architecture/', - // }, - // { - // from: '/building-apps', - // to: '/build/building-apps', - // }, - // { - // from: '/tooling', - // to: '/build/libraries', - // }, - // { - // from: '/migrations', - // to: '/build/libraries', - // }, - // { - // from: '/rfc', - // to: '/build/rfc', - // }, - // { - // from: '/spec', - // to: '/build/spec', - // }, - // { - // from: '/tooling', - // to: '/build/tooling', - // }, - // { - // from: '/run-node', - // to: '/user/run-node', - // }, - // { - // from: ["/master", "/v0.43", "/v0.44"], - // to: "/", - // }, - // { - // from: [ - // "/main/modules/auth/01_concepts", - // "/main/modules/auth/02_state", - // "/main/modules/auth/03_antehandlers", - // "/main/modules/auth/04_keepers", - // "/main/modules/auth/06_params", - // "/main/modules/auth/07_client", - // ], - // to: "/main/build/modules/auth", - // }, - // { - // from: "/main/modules/auth/05_vesting", - // to: "/main/build/modules/auth/vesting", - // }, - // { - // from: [ - // "/main/modules/authz/01_concepts", - // "/main/modules/authz/02_state", - // "/main/modules/authz/03_messages", - // "/main/modules/authz/04_events", - // "/main/modules/authz/05_client", - // ], - // to: "/main/build/modules/authz", - // }, - // { - // from: [ - // "/main/modules/bank/01_state", - // "/main/modules/bank/02_keepers", - // "/main/modules/bank/04_events", - // "/main/modules/bank/05_params", - // "/main/modules/bank/06_client", - // ], - // to: "/main/build/modules/bank", - // }, - // { - // from: [ - // "/main/modules/crisis/01_state", - // "/main/modules/crisis/02_messages", - // "/main/modules/crisis/03_events", - // "/main/modules/crisis/04_params", - // "/main/modules/crisis/05_client", - // ], - // to: "/main/build/modules/crisis", - // }, - // { - // from: [ - // "/main/modules/distribution/01_concepts", - // "/main/modules/distribution/02_state", - // "/main/modules/distribution/03_begin_block", - // "/main/modules/distribution/04_messages", - // "/main/modules/distribution/05_hooks", - // "/main/modules/distribution/06_events", - // "/main/modules/distribution/07_params", - // "/main/modules/distribution/08_client", - // ], - // to: "/main/build/modules/distribution", - // }, - // { - // from: [ - // "/main/modules/evidence/01_concepts", - // "/main/modules/evidence/02_state", - // "/main/modules/evidence/03_messages", - // "/main/modules/evidence/04_events", - // "/main/modules/evidence/05_params", - // "/main/modules/evidence/06_begin_block", - // "/main/modules/evidence/07_client", - // ], - // to: "/main/build/modules/evidence", - // }, - // { - // from: [ - // "/main/modules/feegrant/01_concepts", - // "/main/modules/feegrant/02_state", - // "/main/modules/feegrant/03_messages", - // "/main/modules/feegrant/04_events", - // "/main/modules/feegrant/05_client", - // ], - // to: "/main/build/modules/feegrant", - // }, - // { - // from: [ - // "/main/modules/gov/01_concepts", - // "/main/modules/gov/02_state", - // "/main/modules/gov/03_messages", - // "/main/modules/gov/04_events", - // "/main/modules/gov/05_future_improvements", - // "/main/modules/gov/06_params", - // "/main/modules/gov/07_client", - // "/main/modules/gov/08_metadata", - // ], - // to: "/main/build/modules/gov", - // }, - // { - // from: [ - // "/main/modules/group/01_concepts", - // "/main/modules/group/02_state", - // "/main/modules/group/03_messages", - // "/main/modules/group/04_events", - // "/main/modules/group/05_client", - // "/main/modules/group/06_metadata", - // ], - // to: "/main/build/modules/auth", - // }, - // { - // from: [ - // "/main/modules/mint/01_concepts", - // "/main/modules/mint/02_state", - // "/main/modules/mint/03_begin_block", - // "/main/modules/mint/04_params", - // "/main/modules/mint/05_events", - // "/main/modules/mint/06_client", - // ], - // to: "/main/build/modules/mint/", - // }, - // { - // from: [ - // "/main/modules/nft/01_concepts", - // "/main/modules/nft/02_state", - // "/main/modules/nft/03_messages", - // "/main/modules/nft/04_events", - // ], - // to: "/main/build/modules/nft/", - // }, - // { - // from: [ - // "/main/modules/params/01_keeper", - // "/main/modules/params/02_subspace", - // ], - // to: "/main/build/modules/params/", - // }, - // { - // from: [ - // "/main/modules/slashing/01_concepts", - // "/main/modules/slashing/02_state", - // "/main/modules/slashing/03_messages", - // "/main/modules/slashing/04_begin_block", - // "/main/modules/slashing/05_hooks", - // "/main/modules/slashing/06_events", - // "/main/modules/slashing/07_tombstone", - // "/main/modules/slashing/08_params", - // "/main/modules/slashing/09_client", - // ], - // to: "/main/build/modules/slashing/", - // }, - // { - // from: [ - // "/main/modules/staking/01_state", - // "/main/modules/staking/02_state_transitions", - // "/main/modules/staking/03_messages", - // "/main/modules/staking/04_begin_block", - // "/main/modules/staking/05_end_block", - // "/main/modules/staking/06_hooks", - // "/main/modules/staking/07_events", - // "/main/modules/staking/08_params", - // "/main/modules/staking/09_client", - // ], - // to: "/main/build/modules/staking/", - // }, - // { - // from: [ - // "/main/modules/upgrade/01_concepts", - // "/main/modules/upgrade/02_state", - // "/main/modules/upgrade/03_events", - // "/main/modules/upgrade/04_client", - // ], - // to: "/main/build/modules/upgrade/", - // }, - // { - // from: ["/main/modules/capability", "/main/ecosystem"], - // to: "/main/build/modules/auth", // TODO this should point to /modules - to debug before going live - // }, - // ], + redirects: [...redirects, + { + from: ["/master", "/v0.43", "/v0.44"], + to: "/", + }, + { + from: [ + "/main/modules/auth/01_concepts", + "/main/modules/auth/02_state", + "/main/modules/auth/03_antehandlers", + "/main/modules/auth/04_keepers", + "/main/modules/auth/06_params", + "/main/modules/auth/07_client", + ], + to: "/main/build/modules/auth", + }, + { + from: "/main/modules/auth/05_vesting", + to: "/main/build/modules/auth/vesting", + }, + { + from: [ + "/main/modules/authz/01_concepts", + "/main/modules/authz/02_state", + "/main/modules/authz/03_messages", + "/main/modules/authz/04_events", + "/main/modules/authz/05_client", + ], + to: "/main/build/modules/authz", + }, + { + from: [ + "/main/modules/bank/01_state", + "/main/modules/bank/02_keepers", + "/main/modules/bank/04_events", + "/main/modules/bank/05_params", + "/main/modules/bank/06_client", + ], + to: "/main/build/modules/bank", + }, + { + from: [ + "/main/modules/crisis/01_state", + "/main/modules/crisis/02_messages", + "/main/modules/crisis/03_events", + "/main/modules/crisis/04_params", + "/main/modules/crisis/05_client", + ], + to: "/main/build/modules/crisis", + }, + { + from: [ + "/main/modules/distribution/01_concepts", + "/main/modules/distribution/02_state", + "/main/modules/distribution/03_begin_block", + "/main/modules/distribution/04_messages", + "/main/modules/distribution/05_hooks", + "/main/modules/distribution/06_events", + "/main/modules/distribution/07_params", + "/main/modules/distribution/08_client", + ], + to: "/main/build/modules/distribution", + }, + { + from: [ + "/main/modules/evidence/01_concepts", + "/main/modules/evidence/02_state", + "/main/modules/evidence/03_messages", + "/main/modules/evidence/04_events", + "/main/modules/evidence/05_params", + "/main/modules/evidence/06_begin_block", + "/main/modules/evidence/07_client", + ], + to: "/main/build/modules/evidence", + }, + { + from: [ + "/main/modules/feegrant/01_concepts", + "/main/modules/feegrant/02_state", + "/main/modules/feegrant/03_messages", + "/main/modules/feegrant/04_events", + "/main/modules/feegrant/05_client", + ], + to: "/main/build/modules/feegrant", + }, + { + from: [ + "/main/modules/gov/01_concepts", + "/main/modules/gov/02_state", + "/main/modules/gov/03_messages", + "/main/modules/gov/04_events", + "/main/modules/gov/05_future_improvements", + "/main/modules/gov/06_params", + "/main/modules/gov/07_client", + "/main/modules/gov/08_metadata", + ], + to: "/main/build/modules/gov", + }, + { + from: [ + "/main/modules/group/01_concepts", + "/main/modules/group/02_state", + "/main/modules/group/03_messages", + "/main/modules/group/04_events", + "/main/modules/group/05_client", + "/main/modules/group/06_metadata", + ], + to: "/main/build/modules/auth", + }, + { + from: [ + "/main/modules/mint/01_concepts", + "/main/modules/mint/02_state", + "/main/modules/mint/03_begin_block", + "/main/modules/mint/04_params", + "/main/modules/mint/05_events", + "/main/modules/mint/06_client", + ], + to: "/main/build/modules/mint/", + }, + { + from: [ + "/main/modules/nft/01_concepts", + "/main/modules/nft/02_state", + "/main/modules/nft/03_messages", + "/main/modules/nft/04_events", + ], + to: "/main/build/modules/nft/", + }, + { + from: [ + "/main/modules/params/01_keeper", + "/main/modules/params/02_subspace", + ], + to: "/main/build/modules/params/", + }, + { + from: [ + "/main/modules/slashing/01_concepts", + "/main/modules/slashing/02_state", + "/main/modules/slashing/03_messages", + "/main/modules/slashing/04_begin_block", + "/main/modules/slashing/05_hooks", + "/main/modules/slashing/06_events", + "/main/modules/slashing/07_tombstone", + "/main/modules/slashing/08_params", + "/main/modules/slashing/09_client", + ], + to: "/main/build/modules/slashing/", + }, + { + from: [ + "/main/modules/staking/01_state", + "/main/modules/staking/02_state_transitions", + "/main/modules/staking/03_messages", + "/main/modules/staking/04_begin_block", + "/main/modules/staking/05_end_block", + "/main/modules/staking/06_hooks", + "/main/modules/staking/07_events", + "/main/modules/staking/08_params", + "/main/modules/staking/09_client", + ], + to: "/main/build/modules/staking/", + }, + { + from: [ + "/main/modules/upgrade/01_concepts", + "/main/modules/upgrade/02_state", + "/main/modules/upgrade/03_events", + "/main/modules/upgrade/04_client", + ], + to: "/main/build/modules/upgrade/", + }, + { + from: ["/main/modules/capability", "/main/ecosystem"], + to: "/main/build/modules/", + }, + ], }, ], ], }; +function generateRedirects(version) { + const redirects = [ + { + from: `/${version}`, + to: `/`, + }, + { + from: `/${version}/core`, + to: `/${version}/develop/advanced/baseapp`, + }, + { + from: `/${version}/basics`, + to: `/${version}/develop/beginner/overview-app`, + }, + { + from: `/${version}/intro`, + to: `/${version}/develop/intro/what-is-sdk`, + }, + { + from: `/${version}/architecture`, + to: `/${version}/build/architecture/`, + }, + { + from: `/${version}/building-apps`, + to: `/${version}/build/building-apps/app-go`, + }, + { + from: `/${version}/building-modules`, + to: `/${version}/build/building-modules/intro`, + }, + { + from: `/${version}/modules`, + to: `/${version}/build/modules`, + }, + { + from: `/${version}/packages`, + to: `/${version}/build/packages`, + }, + { + from: `/${version}/tooling`, + to: `/${version}/build/tooling`, + }, + { + from: `/${version}/migrations`, + to: `/${version}/build/migrations/intro`, + }, + { + from: `/${version}/rfc`, + to: `/${version}/build/rfc`, + }, + { + from: `/${version}/spec`, + to: `/${version}/build/spec/addresses`, + }, + { + from: `/${version}/run-node`, + to: `/${version}/user/run-node/keyring`, + }, + ]; + + return redirects; +} module.exports = config; diff --git a/versioned_docs/version-0.47/build/building-apps/01-app-go-v2.md b/versioned_docs/version-0.47/build/building-apps/01-app-go-v2.md index 60f95acae..57c1ef0ad 100644 --- a/versioned_docs/version-0.47/build/building-apps/01-app-go-v2.md +++ b/versioned_docs/version-0.47/build/building-apps/01-app-go-v2.md @@ -7,7 +7,7 @@ sidebar_position: 1 :::note Synopsis -The Cosmos SDK allows much easier wiring of an `app.go` thanks to App Wiring and [`depinject`](../libraries/01-depinject.md). +The Cosmos SDK allows much easier wiring of an `app.go` thanks to App Wiring and [`depinject`](../packages/01-depinject.md). Learn more about the rationale of App Wiring in [ADR-057](../architecture/adr-057-app-wiring.md). ::: @@ -17,7 +17,7 @@ Learn more about the rationale of App Wiring in [ADR-057](../architecture/adr-05 ### Pre-requisite Readings * [ADR 057: App Wiring](../architecture/adr-057-app-wiring.md) -* [Depinject Documentation](../libraries/01-depinject.md) +* [Depinject Documentation](../packages/01-depinject.md) * [Modules depinject-ready](../building-modules/15-depinject.md) ::: diff --git a/versioned_docs/version-0.47/build/building-modules/15-depinject.md b/versioned_docs/version-0.47/build/building-modules/15-depinject.md index 9a51850d0..fc793f04b 100644 --- a/versioned_docs/version-0.47/build/building-modules/15-depinject.md +++ b/versioned_docs/version-0.47/build/building-modules/15-depinject.md @@ -8,11 +8,11 @@ sidebar_position: 1 ### Pre-requisite Readings -* [Depinject Documentation](../libraries/01-depinject.md) +* [Depinject Documentation](../packages/01-depinject.md) ::: -[`depinject`](../libraries/01-depinject.md) is used to wire any module in `app.go`. +[`depinject`](../packages/01-depinject.md) is used to wire any module in `app.go`. All core modules are already configured to support dependency injection. To work with `depinject` a module must define its configuration and requirements so that `depinject` can provide the right dependencies. diff --git a/versioned_docs/version-0.47/build/building-modules/16-testing.md b/versioned_docs/version-0.47/build/building-modules/16-testing.md index b76f626da..cd49fc454 100644 --- a/versioned_docs/version-0.47/build/building-modules/16-testing.md +++ b/versioned_docs/version-0.47/build/building-modules/16-testing.md @@ -86,7 +86,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/tests/integration/bank/kee ## Simulations -Simulations uses as well a minimal application, built with [`depinject`](../libraries/01-depinject.md): +Simulations uses as well a minimal application, built with [`depinject`](../packages/01-depinject.md): :::note You can as well use the `AppConfig` `configurator` for creating an `AppConfig` [inline](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/slashing/app_test.go#L54-L62). There is no difference between those two ways, use whichever you prefer. diff --git a/versioned_docs/version-0.47/build/modules/README.md b/versioned_docs/version-0.47/build/modules/README.md index c5a8cc63d..5638335f1 100644 --- a/versioned_docs/version-0.47/build/modules/README.md +++ b/versioned_docs/version-0.47/build/modules/README.md @@ -1,6 +1,5 @@ --- sidebar_position: 0 -slug : /modules --- # Module Summary diff --git a/versioned_docs/version-0.47/build/libraries/01-depinject.md b/versioned_docs/version-0.47/build/packages/01-depinject.md similarity index 100% rename from versioned_docs/version-0.47/build/libraries/01-depinject.md rename to versioned_docs/version-0.47/build/packages/01-depinject.md diff --git a/versioned_docs/version-0.47/build/libraries/02-collections.md b/versioned_docs/version-0.47/build/packages/02-collections.md similarity index 100% rename from versioned_docs/version-0.47/build/libraries/02-collections.md rename to versioned_docs/version-0.47/build/packages/02-collections.md diff --git a/versioned_docs/version-0.47/build/libraries/03-orm.md b/versioned_docs/version-0.47/build/packages/03-orm.md similarity index 100% rename from versioned_docs/version-0.47/build/libraries/03-orm.md rename to versioned_docs/version-0.47/build/packages/03-orm.md diff --git a/versioned_docs/version-0.47/build/libraries/04-packages.md b/versioned_docs/version-0.47/build/packages/README.md similarity index 100% rename from versioned_docs/version-0.47/build/libraries/04-packages.md rename to versioned_docs/version-0.47/build/packages/README.md diff --git a/versioned_docs/version-0.47/build/libraries/_category_.json b/versioned_docs/version-0.47/build/packages/_category_.json similarity index 100% rename from versioned_docs/version-0.47/build/libraries/_category_.json rename to versioned_docs/version-0.47/build/packages/_category_.json diff --git a/versioned_docs/version-0.47/build/tooling/README.md b/versioned_docs/version-0.47/build/tooling/README.md new file mode 100644 index 000000000..886fed510 --- /dev/null +++ b/versioned_docs/version-0.47/build/tooling/README.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 0 +--- + +# Tools + +This section provides documentation on various tooling used in development of a Cosmos SDK chain, operating a node and testing. + +* [Protocol Buffers](./00-protobuf.md) +* [Cosmovisor](./01-cosmovisor.md) +* [Depinject](./02-depinject.md) \ No newline at end of file diff --git a/versioned_docs/version-0.50/build/building-modules/00-intro.md b/versioned_docs/version-0.50/build/building-modules/00-intro.md index 7bfaf8e98..6f5303150 100644 --- a/versioned_docs/version-0.50/build/building-modules/00-intro.md +++ b/versioned_docs/version-0.50/build/building-modules/00-intro.md @@ -10,7 +10,7 @@ Modules define most of the logic of Cosmos SDK applications. Developers compose :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK application](../../develop/beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../../develop/beginner/00-overview-app.md) * [Lifecycle of a Cosmos SDK transaction](../../develop/beginner/01-tx-lifecycle.md) ::: diff --git a/versioned_docs/version-0.50/build/building-modules/01-module-manager.md b/versioned_docs/version-0.50/build/building-modules/01-module-manager.md index 7666cfec5..cbad8367a 100644 --- a/versioned_docs/version-0.50/build/building-modules/01-module-manager.md +++ b/versioned_docs/version-0.50/build/building-modules/01-module-manager.md @@ -5,7 +5,7 @@ sidebar_position: 1 # Module Manager :::note Synopsis -Cosmos SDK modules need to implement the [`AppModule` interfaces](#application-module-interfaces), in order to be managed by the application's [module manager](#module-manager). The module manager plays an important role in [`message` and `query` routing](../../develop/advanced/00-baseapp.md#routing), and allows application developers to set the order of execution of a variety of functions like [`PreBlocker`](../../develop/beginner/00-app-anatomy#preblocker) and [`BeginBlocker` and `EndBlocker`](../../develop/beginner/00-app-anatomy.md#begingblocker-and-endblocker). +Cosmos SDK modules need to implement the [`AppModule` interfaces](#application-module-interfaces), in order to be managed by the application's [module manager](#module-manager). The module manager plays an important role in [`message` and `query` routing](../../develop/advanced/00-baseapp.md#routing), and allows application developers to set the order of execution of a variety of functions like [`PreBlocker`](../../develop/beginner/00-app-anatomy#preblocker) and [`BeginBlocker` and `EndBlocker`](../../develop/beginner/00-overview-app.md#begingblocker-and-endblocker). ::: :::note Pre-requisite Readings @@ -46,7 +46,7 @@ The above interfaces are mostly embedding smaller interfaces (extension interfac * (legacy) [`module.HasInvariants`](#hasinvariants): The extension interface for registering invariants. * (legacy) [`module.HasConsensusVersion`](#hasconsensusversion): The extension interface for declaring a module consensus version. -The `AppModuleBasic` interface exists to define independent methods of the module, i.e. those that do not depend on other modules in the application. This allows for the construction of the basic application structure early in the application definition, generally in the `init()` function of the [main application file](../../develop/beginner/00-app-anatomy.md#core-application-file). +The `AppModuleBasic` interface exists to define independent methods of the module, i.e. those that do not depend on other modules in the application. This allows for the construction of the basic application structure early in the application definition, generally in the `init()` function of the [main application file](../../develop/beginner/00-overview-app.md#core-application-file). The `AppModule` interface exists to define inter-dependent module methods. Many modules need to interact with other modules, typically through [`keeper`s](./06-keeper.md), which means there is a need for an interface where modules list their `keeper`s and other methods that require a reference to another module's object. `AppModule` interface extension, such as `HasBeginBlocker` and `HasEndBlocker`, also enables the module manager to set the order of execution between module's methods like `BeginBlock` and `EndBlock`, which is important in cases where the order of execution between modules matters in the context of the application. @@ -272,9 +272,9 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go It implements the following methods: -* `NewBasicManager(modules ...AppModuleBasic)`: Constructor function. It takes a list of the application's `AppModuleBasic` and builds a new `BasicManager`. This function is generally called in the `init()` function of [`app.go`](../../develop/beginner/00-app-anatomy.md#core-application-file) to quickly initialize the independent elements of the application's modules (click [here](https://github.com/cosmos/gaia/blob/main/app/app.go#L59-L74) to see an example). +* `NewBasicManager(modules ...AppModuleBasic)`: Constructor function. It takes a list of the application's `AppModuleBasic` and builds a new `BasicManager`. This function is generally called in the `init()` function of [`app.go`](../../develop/beginner/00-overview-app.md#core-application-file) to quickly initialize the independent elements of the application's modules (click [here](https://github.com/cosmos/gaia/blob/main/app/app.go#L59-L74) to see an example). * `NewBasicManagerFromManager(manager *Manager, customModuleBasics map[string]AppModuleBasic)`: Contructor function. It creates a new `BasicManager` from a `Manager`. The `BasicManager` will contain all `AppModuleBasic` from the `AppModule` manager using `CoreAppModuleBasicAdaptor` whenever possible. Module's `AppModuleBasic` can be overridden by passing a custom AppModuleBasic map -* `RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)`: Registers the [`codec.LegacyAmino`s](../../develop/advanced/05-encoding.md#amino) of each of the application's `AppModuleBasic`. This function is usually called early on in the [application's construction](../../develop/beginner/00-app-anatomy.md#constructor). +* `RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)`: Registers the [`codec.LegacyAmino`s](../../develop/advanced/05-encoding.md#amino) of each of the application's `AppModuleBasic`. This function is usually called early on in the [application's construction](../../develop/beginner/00-overview-app.md#constructor). * `RegisterInterfaces(registry codectypes.InterfaceRegistry)`: Registers interface types and implementations of each of the application's `AppModuleBasic`. * `DefaultGenesis(cdc codec.JSONCodec)`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis(cdc codec.JSONCodec)`](./08-genesis.md#defaultgenesis) function of each module. It only calls the modules that implements the `HasGenesisBasics` interfaces. * `ValidateGenesis(cdc codec.JSONCodec, txEncCfg client.TxEncodingConfig, genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage)`](./08-genesis.md#validategenesis) function of modules implementing the `HasGenesisBasics` interface. @@ -292,15 +292,15 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go The module manager is used throughout the application whenever an action on a collection of modules is required. It implements the following methods: -* `NewManager(modules ...AppModule)`: Constructor function. It takes a list of the application's `AppModule`s and builds a new `Manager`. It is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). -* `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./08-genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). +* `NewManager(modules ...AppModule)`: Constructor function. It takes a list of the application's `AppModule`s and builds a new `Manager`. It is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). +* `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./08-genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). To initialize modules successfully, module dependencies should be considered. For example, the `genutil` module must occur after `staking` module so that the pools are properly initialized with tokens from genesis accounts, the `genutils` module must also occur after `auth` so that it can access the params from auth, IBC's `capability` module should be initialized before all other modules so that it can initialize any capabilities. -* `SetOrderExportGenesis(moduleNames ...string)`: Sets the order in which the [`ExportGenesis`](./08-genesis.md#exportgenesis) function of each module will be called in case of an export. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). -* `SetOrderPreBlockers(moduleNames ...string)`: Sets the order in which the `PreBlock()` function of each module will be called before `BeginBlock()` of all modules. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). -* `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). -* `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the end of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). -* `SetOrderPrecommiters(moduleNames ...string)`: Sets the order in which the `Precommit()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). -* `SetOrderPrepareCheckStaters(moduleNames ...string)`: Sets the order in which the `PrepareCheckState()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderExportGenesis(moduleNames ...string)`: Sets the order in which the [`ExportGenesis`](./08-genesis.md#exportgenesis) function of each module will be called in case of an export. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). +* `SetOrderPreBlockers(moduleNames ...string)`: Sets the order in which the `PreBlock()` function of each module will be called before `BeginBlock()` of all modules. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). +* `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). +* `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the end of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). +* `SetOrderPrecommiters(moduleNames ...string)`: Sets the order in which the `Precommit()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). +* `SetOrderPrepareCheckStaters(moduleNames ...string)`: Sets the order in which the `PrepareCheckState()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../../develop/beginner/00-overview-app.md#constructor-function). * `SetOrderMigrations(moduleNames ...string)`: Sets the order of migrations to be run. If not set then migrations will be run with an order defined in `DefaultMigrationsOrder`. * `RegisterInvariants(ir sdk.InvariantRegistry)`: Registers the [invariants](./07-invariants.md) of module implementing the `HasInvariants` interface. * `RegisterServices(cfg Configurator)`: Registers the services of modules implementing the `HasServices` interface. diff --git a/versioned_docs/version-0.50/build/building-modules/06-keeper.md b/versioned_docs/version-0.50/build/building-modules/06-keeper.md index 45143323d..a2a77e0ba 100644 --- a/versioned_docs/version-0.50/build/building-modules/06-keeper.md +++ b/versioned_docs/version-0.50/build/building-modules/06-keeper.md @@ -20,7 +20,7 @@ The Cosmos SDK is a framework that makes it easy for developers to build complex The Cosmos SDK adopts an [object-capabilities-based approach](../../develop/advanced/10-ocap.md) to help developers better protect their application from unwanted inter-module interactions, and `keeper`s are at the core of this approach. A `keeper` can be considered quite literally to be the gatekeeper of a module's store(s). Each store (typically an [`IAVL` Store](../../develop/advanced/04-store.md#iavl-store)) defined within a module comes with a `storeKey`, which grants unlimited access to it. The module's `keeper` holds this `storeKey` (which should otherwise remain unexposed), and defines [methods](#implementing-methods) for reading and writing to the store(s). -The core idea behind the object-capabilities approach is to only reveal what is necessary to get the work done. In practice, this means that instead of handling permissions of modules through access-control lists, module `keeper`s are passed a reference to the specific instance of the other modules' `keeper`s that they need to access (this is done in the [application's constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function)). As a consequence, a module can only interact with the subset of state defined in another module via the methods exposed by the instance of the other module's `keeper`. This is a great way for developers to control the interactions that their own module can have with modules developed by external developers. +The core idea behind the object-capabilities approach is to only reveal what is necessary to get the work done. In practice, this means that instead of handling permissions of modules through access-control lists, module `keeper`s are passed a reference to the specific instance of the other modules' `keeper`s that they need to access (this is done in the [application's constructor function](../../develop/beginner/00-overview-app.md#constructor-function)). As a consequence, a module can only interact with the subset of state defined in another module via the methods exposed by the instance of the other module's `keeper`. This is a great way for developers to control the interactions that their own module can have with modules developed by external developers. ## Type Definition @@ -50,7 +50,7 @@ Let us go through the different parameters: * `storeKey`s grant access to the store(s) of the [multistore](../../develop/advanced/04-store.md) managed by the module. They should always remain unexposed to external modules. * `cdc` is the [codec](../develop/advanced/05-encoding.md) used to marshall and unmarshall structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. The authority listed is a module account or user account that has the right to change module level parameters. Previously this was handled by the param module, which has been deprecated. -Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../../develop/beginner/00-app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. +Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../../develop/beginner/00-overview-app.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. ## Implementing Methods diff --git a/versioned_docs/version-0.50/build/building-modules/07-invariants.md b/versioned_docs/version-0.50/build/building-modules/07-invariants.md index cd85864bf..fe18ba6e1 100644 --- a/versioned_docs/version-0.50/build/building-modules/07-invariants.md +++ b/versioned_docs/version-0.50/build/building-modules/07-invariants.md @@ -79,7 +79,7 @@ Typically, this interface is implemented in the `keeper` of a specific module. T https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/crisis/keeper/keeper.go#L48-L50 ``` -The `InvariantRegistry` is therefore typically instantiated by instantiating the `keeper` of the `crisis` module in the [application's constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). +The `InvariantRegistry` is therefore typically instantiated by instantiating the `keeper` of the `crisis` module in the [application's constructor function](../../develop/beginner/00-overview-app.md#constructor-function). `Invariant`s can be checked manually via [`message`s](./02-messages-and-queries.md), but most often they are checked automatically at the end of each block. Here is an example from the `crisis` module: diff --git a/versioned_docs/version-0.50/build/building-modules/08-genesis.md b/versioned_docs/version-0.50/build/building-modules/08-genesis.md index 546eb5fb9..9fdb2cef1 100644 --- a/versioned_docs/version-0.50/build/building-modules/08-genesis.md +++ b/versioned_docs/version-0.50/build/building-modules/08-genesis.md @@ -51,7 +51,7 @@ Other than the methods related directly to `GenesisState`, module developers are The `InitGenesis` method is executed during [`InitChain`](../../develop/advanced/00-baseapp.md#initchain) when the application is first started. Given a `GenesisState`, it initializes the subset of the state managed by the module by using the module's [`keeper`](./06-keeper.md) setter function on each parameter within the `GenesisState`. -The [module manager](./01-module-manager.md#manager) of the application is responsible for calling the `InitGenesis` method of each of the application's modules in order. This order is set by the application developer via the manager's `SetOrderGenesisMethod`, which is called in the [application's constructor function](../../develop/beginner/00-app-anatomy.md#constructor-function). +The [module manager](./01-module-manager.md#manager) of the application is responsible for calling the `InitGenesis` method of each of the application's modules in order. This order is set by the application developer via the manager's `SetOrderGenesisMethod`, which is called in the [application's constructor function](../../develop/beginner/00-overview-app.md#constructor-function). See an example of `InitGenesis` from the `auth` module: diff --git a/versioned_docs/version-0.50/build/modules/README.md b/versioned_docs/version-0.50/build/modules/README.md new file mode 100644 index 000000000..5638335f1 --- /dev/null +++ b/versioned_docs/version-0.50/build/modules/README.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 0 +--- + +# Module Summary + +Here are some production-grade modules that can be used in Cosmos SDK applications, along with their respective documentation: + +* [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. +* [Crisis](crisis/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken). +* [Distribution](distribution/README.md) - Fee distribution, and staking token provision distribution. +* [Evidence](evidence/README.md) - Evidence handling for double signing, misbehaviour, etc. +* [Feegrant](feegrant/README.md) - Grant fee allowances for executing transactions. +* [Governance](gov/README.md) - On-chain proposals and voting. +* [Mint](mint/README.md) - Creation of new units of staking token. +* [Params](params/README.md) - Globally available parameter store. +* [Slashing](slashing/README.md) - Validator punishment mechanisms. +* [Staking](staking/README.md) - Proof-of-Stake layer for public blockchains. +* [Upgrade](upgrade/README.md) - Software upgrades handling and coordination. +* [NFT](nft/README.md) - NFT module implemented based on [ADR43](https://docs.cosmos.network/main/architecture/adr-043-nft-module.html). +* [Consensus](consensus/README.md) - Consensus module for modifying CometBFT's ABCI consensus params. +* [Circuit](circuit/README.md) - Circuit breaker module for pausing messages. +* [Genutil](genutil/README.md) - Genesis utilities for the Cosmos SDK. + +To learn more about the process of building modules, visit the [building modules reference documentation](https://docs.cosmos.network/main/building-modules/intro). + +## IBC + +The IBC module for the SDK is maintained by the IBC Go team in its [own repository](https://github.com/cosmos/ibc-go). + +Additionally, the [capability module](https://github.com/cosmos/ibc-go/tree/fdd664698d79864f1e00e147f9879e58497b5ef1/modules/capability) is from v0.48+ maintained by the IBC Go team in its [own repository](https://github.com/cosmos/ibc-go/tree/fdd664698d79864f1e00e147f9879e58497b5ef1/modules/capability). + +## CosmWasm + +The CosmWasm module enables smart contracts, learn more by going to their [documentation site](https://book.cosmwasm.com/), or visit [the repository](https://github.com/CosmWasm/cosmwasm). + +## EVM + +Read more about writing smart contracts with solidity at the official [`evm` documentation page](https://docs.evmos.org/modules/evm/). diff --git a/versioned_docs/version-0.50/build/packages/README.md b/versioned_docs/version-0.50/build/packages/README.md new file mode 100644 index 000000000..6892dad8e --- /dev/null +++ b/versioned_docs/version-0.50/build/packages/README.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 0 +--- + +# Packages + +The Cosmos SDK is a collection of Go modules. This section provides documentation on various packages that can used when developing a Cosmos SDK chain. +It lists all standalone Go modules that are part of the Cosmos SDK. + +:::tip +For more information on SDK modules, see the [SDK Modules](https://docs.cosmos.network/main/modules) section. +For more information on SDK tooling, see the [Tooling](https://docs.cosmos.network/main/tooling) section. +::: + +## Core + +* [Core](https://pkg.go.dev/cosmossdk.io/core) - Core library defining SDK interfaces ([ADR-063](https://docs.cosmos.network/main/architecture/adr-063-core-module-api)) +* [API](https://pkg.go.dev/cosmossdk.io/api) - API library containing generated SDK Pulsar API +* [Store](https://pkg.go.dev/cosmossdk.io/store) - Implementation of the Cosmos SDK store + +## State Management + +* [Collections](./02-collections.md) - State management library +* [ORM](./03-orm.md) - State management library + +## Automation + +* [Depinject](./01-depinject.md) - Dependency injection framework +* [Client/v2](https://pkg.go.dev/cosmossdk.io/client/v2) - Library powering [AutoCLI](https://docs.cosmos.network/main/core/autocli) + +## Utilities + +* [Log](https://pkg.go.dev/cosmossdk.io/log) - Logging library +* [Errors](https://pkg.go.dev/cosmossdk.io/errors) - Error handling library +* [Math](https://pkg.go.dev/cosmossdk.io/math) - Math library for SDK arithmetic operations + +## Example + +* [SimApp](https://pkg.go.dev/cosmossdk.io/simapp) - SimApp is **the** sample Cosmos SDK chain. This package should not be imported in your application. \ No newline at end of file diff --git a/versioned_docs/version-0.50/build/tooling/README.md b/versioned_docs/version-0.50/build/tooling/README.md new file mode 100644 index 000000000..1fa6ea2cc --- /dev/null +++ b/versioned_docs/version-0.50/build/tooling/README.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 0 +--- + +# Tools + +This section provides documentation on various tooling maintained by the SDK team. +This includes tools for development, operating a node, and ease of use of a Cosmos SDK chain. + +## CLI Tools + +* [Cosmovisor](./01-cosmovisor.md) +* [Confix](./02-confix.md) +* [Hubl](./03-hubl.md) +* [Rosetta](https://docs.cosmos.network/main/run-node/rosetta) + +## Other Tools + +* [Protocol Buffers](./00-protobuf.md) \ No newline at end of file diff --git a/versioned_docs/version-0.50/develop/advanced/00-baseapp.md b/versioned_docs/version-0.50/develop/advanced/00-baseapp.md index 293a82928..cc59baced 100644 --- a/versioned_docs/version-0.50/develop/advanced/00-baseapp.md +++ b/versioned_docs/version-0.50/develop/advanced/00-baseapp.md @@ -10,7 +10,7 @@ This document describes `BaseApp`, the abstraction that implements the core func :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-overview-app.md) * [Lifecycle of a Cosmos SDK transaction](../beginner/01-tx-lifecycle.md) ::: @@ -78,7 +78,7 @@ First, the important parameters that are initialized during the bootstrapping of * [`AnteHandler`](#antehandler): This handler is used to handle signature verification, fee payment, and other pre-message execution checks when a transaction is received. It's executed during [`CheckTx/RecheckTx`](#checktx) and [`FinalizeBlock`](#finalizeblock). -* [`InitChainer`](../beginner/00-app-anatomy.md#initchainer), [`PreBlocker`](../beginner/00-app-anatomy.md#preblocker), [`BeginBlocker` and `EndBlocker`](../beginner/00-app-anatomy.md#beginblocker-and-endblocker): These are +* [`InitChainer`](../beginner/00-overview-app.md#initchainer), [`PreBlocker`](../beginner/00-overview-app.md#preblocker), [`BeginBlocker` and `EndBlocker`](../beginner/00-overview-app.md#beginblocker-and-endblocker): These are the functions executed when the application receives the `InitChain` and `FinalizeBlock` ABCI messages from the underlying CometBFT engine. @@ -104,7 +104,7 @@ Finally, a few more important parameters: `minGasPrices` (e.g. if `minGasPrices == 1uatom,1photon`, the `gas-price` of the transaction must be greater than `1uatom` OR `1photon`). * `appVersion`: Version of the application. It is set in the - [application's constructor function](../beginner/00-app-anatomy.md#constructor-function). + [application's constructor function](../beginner/00-overview-app.md#constructor-function). ## Constructor @@ -220,13 +220,13 @@ When messages and queries are received by the application, they must be routed t The [default `msgServiceRouter` included in `BaseApp`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go) is stateless. However, some applications may want to make use of more stateful routing mechanisms such as allowing governance to disable certain routes or point them to new modules for upgrade purposes. For this reason, the `sdk.Context` is also passed into each [route handler inside `msgServiceRouter`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go#L31-L32). For a stateless router that doesn't want to make use of this, you can just ignore the `ctx`. -The application's `msgServiceRouter` is initialized with all the routes using the application's [module manager](../../build/building-modules/01-module-manager.md#manager) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../beginner/00-app-anatomy.md#constructor-function). +The application's `msgServiceRouter` is initialized with all the routes using the application's [module manager](../../build/building-modules/01-module-manager.md#manager) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../beginner/00-overview-app.md#constructor-function). ### gRPC Query Router Similar to `sdk.Msg`s, [`queries`](../../build/building-modules/02-messages-and-queries.md#queries) need to be routed to the appropriate module's [`Query` service](../../build/building-modules/04-query-services.md). To do so, `BaseApp` holds a `grpcQueryRouter`, which maps modules' fully-qualified service methods (`string`, defined in their Protobuf `Query` gRPC) to their `QueryServer` implementation. The `grpcQueryRouter` is called during the initial stages of query processing, which can be either by directly sending a gRPC query to the gRPC endpoint, or via the [`Query` ABCI message](#query) on the CometBFT RPC endpoint. -Just like the `msgServiceRouter`, the `grpcQueryRouter` is initialized with all the query routes using the application's [module manager](../../build/building-modules/01-module-manager.md) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../beginner/00-app-anatomy.md#app-constructor). +Just like the `msgServiceRouter`, the `grpcQueryRouter` is initialized with all the query routes using the application's [module manager](../../build/building-modules/01-module-manager.md) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../beginner/00-overview-app.md#app-constructor). ## Main ABCI 2.0 Messages @@ -398,7 +398,7 @@ The `AnteHandler` is theoretically optional, but still a very important componen * Perform preliminary _stateful_ validity checks like ensuring signatures are valid or that the sender has enough funds to pay for fees. * Play a role in the incentivisation of stakeholders via the collection of transaction fees. -`BaseApp` holds an `anteHandler` as parameter that is initialized in the [application's constructor](../beginner/00-app-anatomy.md#application-constructor). The most widely used `anteHandler` is the [`auth` module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/ante/ante.go). +`BaseApp` holds an `anteHandler` as parameter that is initialized in the [application's constructor](../beginner/00-overview-app.md#application-constructor). The most widely used `anteHandler` is the [`auth` module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/ante/ante.go). Click [here](../beginner/04-gas-fees.md#antehandler) for more on the `anteHandler`. @@ -431,7 +431,7 @@ The [`InitChain` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x * [`checkState` and `finalizeBlockState`](#state-updates) via `setState`. * The [block gas meter](../beginner/04-gas-fees.md#block-gas-meter), with infinite gas to process genesis transactions. -Finally, the `InitChain(req abci.RequestInitChain)` method of `BaseApp` calls the [`initChainer()`](../beginner/00-app-anatomy.md#initchainer) of the application in order to initialize the main state of the application from the `genesis file` and, if defined, call the [`InitGenesis`](../../build/building-modules/08-genesis.md#initgenesis) function of each of the application's modules. +Finally, the `InitChain(req abci.RequestInitChain)` method of `BaseApp` calls the [`initChainer()`](../beginner/00-overview-app.md#initchainer) of the application in order to initialize the main state of the application from the `genesis file` and, if defined, call the [`InitGenesis`](../../build/building-modules/08-genesis.md#initgenesis) function of each of the application's modules. ### FinalizeBlock @@ -445,7 +445,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci.go#L623 #### PreBlock -* Run the application's [`preBlocker()`](../beginner/00-app-anatomy.md#preblocker), which mainly runs the [`PreBlocker()`](../../build/building-modules/17-preblock.md#preblock) method of each of the modules. +* Run the application's [`preBlocker()`](../beginner/00-overview-app.md#preblocker), which mainly runs the [`PreBlocker()`](../../build/building-modules/17-preblock.md#preblock) method of each of the modules. #### BeginBlock @@ -458,7 +458,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci.go#L623 This function also resets the [main gas meter](../beginner/04-gas-fees.md#main-gas-meter). * Initialize the [block gas meter](../beginner/04-gas-fees.md#block-gas-meter) with the `maxGas` limit. The `gas` consumed within the block cannot go above `maxGas`. This parameter is defined in the application's consensus parameters. -* Run the application's [`beginBlocker()`](../beginner/00-app-anatomy.md#beginblocker-and-endblocker), which mainly runs the [`BeginBlocker()`](../../build/building-modules/06-beginblock-endblock.md#beginblock) method of each of the modules. +* Run the application's [`beginBlocker()`](../beginner/00-overview-app.md#beginblocker-and-endblocker), which mainly runs the [`BeginBlocker()`](../../build/building-modules/06-beginblock-endblock.md#beginblock) method of each of the modules. * Set the [`VoteInfos`](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_methods.md#voteinfo) of the application, i.e. the list of validators whose _precommit_ for the previous block was included by the proposer of the current block. This information is carried into the [`Context`](./02-context.md) so that it can be used during transaction execution and EndBlock. #### Transaction Execution diff --git a/versioned_docs/version-0.50/develop/advanced/01-transactions.md b/versioned_docs/version-0.50/develop/advanced/01-transactions.md index eee4fae37..a56aa3008 100644 --- a/versioned_docs/version-0.50/develop/advanced/01-transactions.md +++ b/versioned_docs/version-0.50/develop/advanced/01-transactions.md @@ -10,7 +10,7 @@ sidebar_position: 1 :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](../beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](../beginner/00-overview-app.md) ::: diff --git a/versioned_docs/version-0.50/develop/advanced/02-context.md b/versioned_docs/version-0.50/develop/advanced/02-context.md index 4d9ecdf69..d49d0bf04 100644 --- a/versioned_docs/version-0.50/develop/advanced/02-context.md +++ b/versioned_docs/version-0.50/develop/advanced/02-context.md @@ -10,7 +10,7 @@ The `context` is a data structure intended to be passed from function to functio :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](../beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](../beginner/00-overview-app.md) * [Lifecycle of a Transaction](../beginner/01-tx-lifecycle.md) ::: diff --git a/versioned_docs/version-0.50/develop/advanced/03-node.md b/versioned_docs/version-0.50/develop/advanced/03-node.md index 47b691b32..32ab24043 100644 --- a/versioned_docs/version-0.50/develop/advanced/03-node.md +++ b/versioned_docs/version-0.50/develop/advanced/03-node.md @@ -10,7 +10,7 @@ The main endpoint of a Cosmos SDK application is the daemon client, otherwise kn :::note Pre-requisite Readings -* [Anatomy of an SDK application](../beginner/00-app-anatomy.md) +* [Anatomy of an SDK application](../beginner/00-overview-app.md) ::: @@ -69,7 +69,7 @@ Note that an `appCreator` is a function that fulfills the `AppCreator` signature https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/types/app.go#L68 ``` -In practice, the [constructor of the application](../beginner/00-app-anatomy.md#constructor-function) is passed as the `appCreator`. +In practice, the [constructor of the application](../beginner/00-overview-app.md#constructor-function) is passed as the `appCreator`. ```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L294-L308 diff --git a/versioned_docs/version-0.50/develop/advanced/04-store.md b/versioned_docs/version-0.50/develop/advanced/04-store.md index 35f676657..a60ddd108 100644 --- a/versioned_docs/version-0.50/develop/advanced/04-store.md +++ b/versioned_docs/version-0.50/develop/advanced/04-store.md @@ -10,7 +10,7 @@ A store is a data structure that holds the state of the application. :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-overview-app.md) ::: @@ -138,7 +138,7 @@ A `KVStore` is a simple key-value store used to store and retrieve data. A `Comm Individual `KVStore`s are used by modules to manage a subset of the global state. `KVStores` can be accessed by objects that hold a specific key. This `key` should only be exposed to the [`keeper`](../../build/building-modules/06-keeper.md) of the module that defines the store. -`CommitKVStore`s are declared by proxy of their respective `key` and mounted on the application's [multistore](#multistore) in the [main application file](../beginner/00-app-anatomy.md#core-application-file). In the same file, the `key` is also passed to the module's `keeper` that is responsible for managing the store. +`CommitKVStore`s are declared by proxy of their respective `key` and mounted on the application's [multistore](#multistore) in the [main application file](../beginner/00-overview-app.md#core-application-file). In the same file, the `key` is also passed to the module's `keeper` that is responsible for managing the store. ```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L229-L266 diff --git a/versioned_docs/version-0.50/develop/advanced/05-encoding.md b/versioned_docs/version-0.50/develop/advanced/05-encoding.md index 097767d97..f1aca5835 100644 --- a/versioned_docs/version-0.50/develop/advanced/05-encoding.md +++ b/versioned_docs/version-0.50/develop/advanced/05-encoding.md @@ -10,7 +10,7 @@ While encoding in the Cosmos SDK used to be mainly handled by `go-amino` codec, :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-overview-app.md) ::: diff --git a/versioned_docs/version-0.50/develop/advanced/07-cli.md b/versioned_docs/version-0.50/develop/advanced/07-cli.md index 802e89eed..140b13490 100644 --- a/versioned_docs/version-0.50/develop/advanced/07-cli.md +++ b/versioned_docs/version-0.50/develop/advanced/07-cli.md @@ -5,7 +5,7 @@ sidebar_position: 1 # Command-Line Interface :::note Synopsis -This document describes how command-line interface (CLI) works on a high-level, for an [**application**](../beginner/00-app-anatomy.md). A separate document for implementing a CLI for a Cosmos SDK [**module**](../../build/building-modules/00-intro.md) can be found [here](../../build/building-modules/09-module-interfaces.md#cli). +This document describes how command-line interface (CLI) works on a high-level, for an [**application**](../beginner/00-overview-app.md). A separate document for implementing a CLI for a Cosmos SDK [**module**](../../build/building-modules/00-intro.md) can be found [here](../../build/building-modules/09-module-interfaces.md#cli). ::: ## Command-Line Interface diff --git a/versioned_docs/version-0.50/develop/advanced/08-events.md b/versioned_docs/version-0.50/develop/advanced/08-events.md index 410e20ade..cf2de31be 100644 --- a/versioned_docs/version-0.50/develop/advanced/08-events.md +++ b/versioned_docs/version-0.50/develop/advanced/08-events.md @@ -9,7 +9,7 @@ sidebar_position: 1 :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-overview-app.md) * [CometBFT Documentation on Events](https://docs.cometbft.com/v0.37/spec/abci/abci++_basic_concepts#events) ::: diff --git a/versioned_docs/version-0.50/develop/beginner/00-app-anatomy.md b/versioned_docs/version-0.50/develop/beginner/00-overview-app.md similarity index 100% rename from versioned_docs/version-0.50/develop/beginner/00-app-anatomy.md rename to versioned_docs/version-0.50/develop/beginner/00-overview-app.md diff --git a/versioned_docs/version-0.50/develop/beginner/01-tx-lifecycle.md b/versioned_docs/version-0.50/develop/beginner/01-tx-lifecycle.md index e3831ae3b..f8828e714 100644 --- a/versioned_docs/version-0.50/develop/beginner/01-tx-lifecycle.md +++ b/versioned_docs/version-0.50/develop/beginner/01-tx-lifecycle.md @@ -10,7 +10,7 @@ This document describes the lifecycle of a transaction from creation to committe :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](./00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](./00-overview-app.md) ::: ## Creation diff --git a/versioned_docs/version-0.50/develop/beginner/03-accounts.md b/versioned_docs/version-0.50/develop/beginner/03-accounts.md index 7280108ac..3e0bd45aa 100644 --- a/versioned_docs/version-0.50/develop/beginner/03-accounts.md +++ b/versioned_docs/version-0.50/develop/beginner/03-accounts.md @@ -11,7 +11,7 @@ This document describes the in-built account and public key system of the Cosmos :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](./00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](./00-overview-app.md) ::: diff --git a/versioned_docs/version-0.50/develop/beginner/04-gas-fees.md b/versioned_docs/version-0.50/develop/beginner/04-gas-fees.md index 2e04af462..b822d2bdf 100644 --- a/versioned_docs/version-0.50/develop/beginner/04-gas-fees.md +++ b/versioned_docs/version-0.50/develop/beginner/04-gas-fees.md @@ -10,7 +10,7 @@ This document describes the default strategies to handle gas and fees within a C :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](./00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](./00-overview-app.md) ::: diff --git a/versioned_docs/version-0.50/develop/intro/03-sdk-design.md b/versioned_docs/version-0.50/develop/intro/03-sdk-design.md index 78afb1298..ae4a05611 100644 --- a/versioned_docs/version-0.50/develop/intro/03-sdk-design.md +++ b/versioned_docs/version-0.50/develop/intro/03-sdk-design.md @@ -15,7 +15,7 @@ Here is a simplified view of how transactions are handled by an application buil ## `baseapp` -`baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`]../beginner/00-app-anatomy.md#core-application-file). +`baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`]../beginner/00-overview-app.md#core-application-file). Here is an example of this from `simapp`, the Cosmos SDK demonstration app: diff --git a/versioned_docs/version-0.50/user/run-node/00-keyring.md b/versioned_docs/version-0.50/user/run-node/00-keyring.md index 09d8b0742..a1fd99b72 100644 --- a/versioned_docs/version-0.50/user/run-node/00-keyring.md +++ b/versioned_docs/version-0.50/user/run-node/00-keyring.md @@ -5,7 +5,7 @@ sidebar_position: 1 # Setting up the keyring :::note Synopsis -This document describes how to configure and use the keyring and its various backends for an [**application**](../../develop/beginner/00-app-anatomy.md). +This document describes how to configure and use the keyring and its various backends for an [**application**](../../develop/beginner/00-overview-app.md). ::: The keyring holds the private/public keypairs used to interact with a node. For instance, a validator key needs to be set up before running the blockchain node, so that blocks can be correctly signed. The private key can be stored in different locations, called "backends", such as a file or the operating system's own key storage. diff --git a/versioned_docs/version-0.50/user/run-node/01-run-node.md b/versioned_docs/version-0.50/user/run-node/01-run-node.md index fc539989b..95c814e82 100644 --- a/versioned_docs/version-0.50/user/run-node/01-run-node.md +++ b/versioned_docs/version-0.50/user/run-node/01-run-node.md @@ -10,7 +10,7 @@ Now that the application is ready and the keyring populated, it's time to see ho :::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](../../develop/beginner/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](../../develop/beginner/00-overview-app.md) * [Setting up the keyring](./00-keyring.md) :::