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

refactor: add redirects to docusaurus config #12

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 1 addition & 1 deletion docs/integrate/architecture/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "ADRs",
"label": "Architecture Decision Records (ADR)",
"position": 11,
"link": null
}
8 changes: 4 additions & 4 deletions docs/user/run-node/02-interact-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ There are multiple ways to interact with a node: using the CLI, using gRPC or us
### Pre-requisite Readings

* [gRPC, REST and CometBFT Endpoints](../../develop/advanced-concepts/09-grpc_rest.md)
* [Running a Node](01-run-node.md)
* [Running a Node](./01-run-node.md)

:::

Expand Down Expand Up @@ -68,7 +68,7 @@ Since the code generation library largely depends on your own tech stack, we wil

[grpcurl](https://github.com/fullstorydev/grpcurl) is like `curl` but for gRPC. It is also available as a Go library, but we will use it only as a CLI command for debugging and testing purposes. Follow the instructions in the previous link to install it.

Assuming you have a local node running (either a localnet, or connected a live network), you should be able to run the following command to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, which is configured under the `grpc.address` field inside [`app.toml`](01-run-node.md#configuring-the-node-using-apptoml-and-configtoml)):
Assuming you have a local node running (either a localnet, or connected a live network), you should be able to run the following command to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, which is configured under the `grpc.address` field inside [`app.toml`](./01-run-node.md#configuring-the-node-using-apptoml-and-configtoml)):

```bash
grpcurl -plaintext localhost:9090 list
Expand Down Expand Up @@ -270,7 +270,7 @@ curl \

Make sure to replace `localhost:1317` with the REST endpoint of your node, configured under the `api.address` field.

The list of all available REST endpoints is available as a Swagger specification file, it can be viewed at `localhost:1317/swagger`. Make sure that the `api.swagger` field is set to true in your [`app.toml`](01-run-node.md#configuring-the-node-using-apptoml) file.
The list of all available REST endpoints is available as a Swagger specification file, it can be viewed at `localhost:1317/swagger`. Make sure that the `api.swagger` field is set to true in your [`app.toml`](./01-run-node.md#configuring-the-node-using-apptoml) file.

### Query for historical state using REST

Expand All @@ -288,4 +288,4 @@ Assuming the state at that block has not yet been pruned by the node, this query

### Cross-Origin Resource Sharing (CORS)

[CORS policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) are not enabled by default to help with security. If you would like to use the rest-server in a public environment we recommend you provide a reverse proxy, this can be done with [nginx](https://www.nginx.com/). For testing and development purposes there is an `enabled-unsafe-cors` field inside [`app.toml`](01-run-node.md#configuring-the-node-using-apptoml).
[CORS policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) are not enabled by default to help with security. If you would like to use the rest-server in a public environment we recommend you provide a reverse proxy, this can be done with [nginx](https://www.nginx.com/). For testing and development purposes there is an `enabled-unsafe-cors` field inside [`app.toml`](./01-run-node.md#configuring-the-node-using-apptoml).
228 changes: 219 additions & 9 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

// const lastVersion = "v0.47";
const lastVersion = "current";
const lastVersion = "v0.47";
// const lastVersion = "current";

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -40,6 +40,13 @@ const config = {
docs: {
sidebarPath: require.resolve("./sidebars.js"),
routeBasePath: "/",
versions: {
current: {
path: "main",
label: "Main",
banner: "unreleased",
},
},
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
Expand All @@ -62,7 +69,7 @@ const config = {
hideOnScroll: false,
logo: {
alt: "Cosmos SDK Logo",
src: "img/logo-sdk.svg",
src: "/img/logo-sdk.svg",
href: "/",
target: "_self",
},
Expand Down Expand Up @@ -105,11 +112,11 @@ const config = {
footer: {
links: [
{
items: [
{
html: `<a href="https://cosmos.network"><img src="/img/logo-bw.svg" alt="Cosmos Logo"></a>`,
},
],
// items: [
// {
// html: `<a href="https://cosmos.network"><img src="static/img/logo-bw.svg" alt="Cosmos Logo"></a>`,
// },
// ],
},
{
title: "Documentation",
Expand Down Expand Up @@ -158,7 +165,7 @@ const config = {
},
{
label: "Twitter",
href: "https://twitter.com/cosmos",
href: "https://twitter.com/cosmos_sdk",
},
{
label: "Youtube",
Expand Down Expand Up @@ -206,6 +213,209 @@ const config = {
anonymizeIP: true,
},
],
[
"@docusaurus/plugin-client-redirects",
samricotta marked this conversation as resolved.
Show resolved Hide resolved
{
fromExtensions: ["html"],
toExtensions: ["html"],
createRedirects(existingPath) {
return [
existingPath.replace('/core', '/develop/advanced-concepts'),
existingPath.replace('/basics', '/develop/high-level-concepts'),
existingPath.replace('/intro', '/develop/intro'),
existingPath.replace('/architecture', '/integrate/architecture/'),
existingPath.replace('/building-apps', '/integrate/building-apps'),
existingPath.replace('/building-modules', '/integrate/building-modules'),
existingPath.replace('/tooling', '/integrate/libraries'),
existingPath.replace('/migrations', '/integrate/libraries'),
existingPath.replace('/modules', '/integrate/modules'),
existingPath.replace('/rfc', '/integrate/rfc'),
existingPath.replace('/spec', '/integrate/spec'),
existingPath.replace('/tooling', '/integrate/tooling'),
existingPath.replace('/run-node', '/user/run-node'),
existingPath.replace('/validate', '/user/validate')
];
},
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/integrate/modules/auth",
},
{
from: "/main/modules/auth/05_vesting",
to: "/main/integrate/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/integrate/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/integrate/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/integrate/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/integrate/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/integrate/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/integrate/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/integrate/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: "/modules",
},
{
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/integrate/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/integrate/modules/nft/",
},
{
from: [
"/main/modules/params/01_keeper",
"/main/modules/params/02_subspace",
],
to: "/main/integrate/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/integrate/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/integrate/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/integrate/modules/upgrade/",
},
{
from: ["/main/modules/capability", "/main/ecosystem"],
to: "/modules",
},
],
},
],
],
};

Expand Down
10 changes: 5 additions & 5 deletions src/components/HomepageFeatures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const FeatureList = [
},
{
title: `Join the Community`,
to: "/develop/intro/what-is-sdk",
to: "https://discord.com/invite/cosmosnetwork",
Svg: require('@site/static/img/public-service.svg').default,
description: (
<>
Expand All @@ -60,13 +60,13 @@ const FeatureList = [
),
},
{
title: `Our Vision`,
to: "/develop/intro/what-is-sdk",
title: `Discuss`,
to: "https://github.com/orgs/cosmos/discussions",
Svg: require('@site/static/img/ecosystem.svg').default,
description: (
<>
Learn about the long-term vision of the Cosmos project and how it aims to create an interoperable,
scalable, and sustainable ecosystem of blockchain applications.
Collaborative forum for the community to ask/answer questions, share information, discuss
items and give feedbacks on the teams roadmaps.
</>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Pre-requisite Readings

- [Anatomy of an SDK Application](../high-level-concepts/overview-app.md) {prereq}
- [Anatomy of an SDK Application](../high-level-concepts/00-overview-app.md) {prereq}

## Transactions

Expand Down Expand Up @@ -124,7 +124,7 @@ Once the transaction bytes are generated, there are currently three ways of broa

Application developers create entrypoints to the application by creating a [command-line interface](../06-cli.md), [gRPC and/or REST interface](../08-grpc_rest.md), typically found in the application's `./cmd` folder. These interfaces allow users to interact with the application through command-line.

For the [command-line interface](../building-modules/09-module-interfaces.md#cli), module developers create subcommands to add as children to the application top-level transaction command `TxCmd`. CLI commands actually bundle all the steps of transaction processing into one simple command: creating messages, generating transactions and broadcasting. For concrete examples, see the [Interacting with a Node](../run-node/interact-node.md) section. An example transaction made using CLI looks like:
For the [command-line interface](../building-modules/09-module-interfaces.md#cli), module developers create subcommands to add as children to the application top-level transaction command `TxCmd`. CLI commands actually bundle all the steps of transaction processing into one simple command: creating messages, generating transactions and broadcasting. For concrete examples, see the [Interacting with a Node](../run-node/02-interact-node.md) section. An example transaction made using CLI looks like:

```bash
simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `context` is a data structure intended to be passed from function to functio

## Pre-requisites Readings

- [Anatomy of an SDK Application](../high-level-concepts/overview-app.md) {prereq}
- [Anatomy of an SDK Application](../high-level-concepts/00-overview-app.md) {prereq}
- [Lifecycle of a Transaction](../high-level-concepts/01-tx-lifecycle.md) {prereq}

## Context Definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The main endpoint of an SDK application is the daemon client, otherwise known as

## Pre-requisite Readings

- [Anatomy of an SDK application](../high-level-concepts/overview-app.md) {prereq}
- [Anatomy of an SDK application](../high-level-concepts/00-overview-app.md) {prereq}

## `main` function

Expand Down Expand Up @@ -47,7 +47,7 @@ With the `db`, the `start` command creates a new instance of the application usi
Note that an `appCreator` is a function that fulfills the `AppCreator` signature:
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/server/types/app.go#L48-L50

In practice, the [constructor of the application](../high-level-concepts/overview-app.md#constructor-function) is passed as the `appCreator`.
In practice, the [constructor of the application](../high-level-concepts/00-overview-app.md#constructor-function) is passed as the `appCreator`.

+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/simapp/simd/cmd/root.go#L170-L215

Expand Down
Loading