diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index d8ecd2c8b68b..c323447ee370 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -16,6 +16,16 @@ module.exports = { } }, base: process.env.VUEPRESS_BASE || "/", + head: [ + ['link', { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" }], + ['link', { rel: "icon", type: "image/png", sizes: "32x32", href: "/favicon-32x32.png" }], + ['link', { rel: "icon", type: "image/png", sizes: "16x16", href: "/favicon-16x16.png" }], + ['link', { rel: "manifest", href: "/site.webmanifest" }], + ['meta', { name: "msapplication-TileColor", content: "#2e3148" }], + ['meta', { name: "theme-color", content: "#ffffff" }], + ['link', { rel: "icon", type: "image/svg+xml", href: "/favicon-svg.svg" }], + ['link', { rel: "apple-touch-icon-precomposed", href: "/apple-touch-icon-precomposed.png" }], + ], themeConfig: { repo: "cosmos/cosmos-sdk", docsRepo: "cosmos/cosmos-sdk", diff --git a/docs/.vuepress/public/android-chrome-192x192.png b/docs/.vuepress/public/android-chrome-192x192.png new file mode 100644 index 000000000000..6d04cf4c0857 Binary files /dev/null and b/docs/.vuepress/public/android-chrome-192x192.png differ diff --git a/docs/.vuepress/public/android-chrome-256x256.png b/docs/.vuepress/public/android-chrome-256x256.png new file mode 100644 index 000000000000..1c30cc026781 Binary files /dev/null and b/docs/.vuepress/public/android-chrome-256x256.png differ diff --git a/docs/.vuepress/public/apple-touch-icon-precomposed.png b/docs/.vuepress/public/apple-touch-icon-precomposed.png new file mode 100644 index 000000000000..bd789213a5dd Binary files /dev/null and b/docs/.vuepress/public/apple-touch-icon-precomposed.png differ diff --git a/docs/.vuepress/public/apple-touch-icon.png b/docs/.vuepress/public/apple-touch-icon.png new file mode 100644 index 000000000000..397e21af2a52 Binary files /dev/null and b/docs/.vuepress/public/apple-touch-icon.png differ diff --git a/docs/.vuepress/public/browserconfig.xml b/docs/.vuepress/public/browserconfig.xml new file mode 100644 index 000000000000..b3930d0f0471 --- /dev/null +++ b/docs/.vuepress/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/docs/.vuepress/public/favicon-16x16.png b/docs/.vuepress/public/favicon-16x16.png new file mode 100644 index 000000000000..5f15c3b0af35 Binary files /dev/null and b/docs/.vuepress/public/favicon-16x16.png differ diff --git a/docs/.vuepress/public/favicon-32x32.png b/docs/.vuepress/public/favicon-32x32.png new file mode 100644 index 000000000000..9433c807fd08 Binary files /dev/null and b/docs/.vuepress/public/favicon-32x32.png differ diff --git a/docs/.vuepress/public/favicon-svg.svg b/docs/.vuepress/public/favicon-svg.svg new file mode 100644 index 000000000000..dbefbad9f4f8 --- /dev/null +++ b/docs/.vuepress/public/favicon-svg.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + diff --git a/docs/.vuepress/public/mstile-150x150.png b/docs/.vuepress/public/mstile-150x150.png new file mode 100644 index 000000000000..b1770354a1a0 Binary files /dev/null and b/docs/.vuepress/public/mstile-150x150.png differ diff --git a/docs/.vuepress/public/safari-pinned-tab.svg b/docs/.vuepress/public/safari-pinned-tab.svg new file mode 100644 index 000000000000..db52b2cd4d83 --- /dev/null +++ b/docs/.vuepress/public/safari-pinned-tab.svg @@ -0,0 +1,25 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + diff --git a/docs/.vuepress/public/site.webmanifest b/docs/.vuepress/public/site.webmanifest new file mode 100644 index 000000000000..5b4c0a3c671a --- /dev/null +++ b/docs/.vuepress/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "Cosmos SDK Documentation", + "short_name": "Cosmos SDK", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-256x256.png", + "sizes": "256x256", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/docs/building-modules/simulator.md b/docs/building-modules/simulator.md index d8b7aca42307..543336fe186a 100644 --- a/docs/building-modules/simulator.md +++ b/docs/building-modules/simulator.md @@ -63,7 +63,7 @@ Operations on the simulation are simulated using the full [transaction cycle](.. Shown below is how weights are set: -+++ https://github.com/cosmos/cosmos-sdk/blob/release%2Fv0.38.0/x/staking/simulation/operations.go#L18-L92 ++++ https://github.com/cosmos/cosmos-sdk/blob/master/x/staking/simulation/operations.go#L18 As you can see the weights are predefined in this case but there are options on how to override this behavior with different weights. One is allowing `*rand.Rand` to define a random weight for the operation, or you can inject your own predefined weights. @@ -83,7 +83,7 @@ them to be used on the parameters. Now that all the required functions are defined, we need to integrate them into the module pattern within the `module.go`: -+++ https://github.com/cosmos/cosmos-sdk/blob/release%2Fv0.38.0/x/distribution/module.go#L156-L185 ++++ https://github.com/cosmos/cosmos-sdk/blob/master/x/distribution/module.go ## App Simulator manager diff --git a/docs/cn/basics/accounts.md b/docs/cn/basics/accounts.md index ce3d0c309de7..c37e45aa69b7 100644 --- a/docs/cn/basics/accounts.md +++ b/docs/cn/basics/accounts.md @@ -12,7 +12,7 @@ Cosmos SDK 使用一套称之为 [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) 的标准来生成公私钥。这个标准定义了怎么去创建一个 HD 钱包(钱包就是一批账户的集合)。每一个账户的核心,都有一个种子,每一个种子都有一个 12 或 24 个字的助记符。使用这个助记符,使用一种单向的加密方法可以派生出任意数量的私钥。公钥可以通过私钥推导出来。当然,助记符是最敏感的信息,因为可以不停通过助记符来重新生成私钥。 -``` +```md Account 0 Account 1 Account 2 +------------------+ +------------------+ +------------------+ @@ -58,7 +58,7 @@ Cosmos SDK 使用一套称之为 [BIP32](https://github.com/bitcoin/bips/blob/ma `Keybase` 是储存和管理账户的对象,在 Cosmos SDK 中,`Keybase` 要实现以下接口 -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/types.go#L13-L86 ++++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/types.go#L13-L86 在 Cosmos SDK 中,`Keybase` 接口的默认实现对象是 `dbKeybase`。 @@ -67,7 +67,9 @@ Cosmos SDK 使用一套称之为 [BIP32](https://github.com/bitcoin/bips/blob/ma `dbKeybase` 上面对 `Keybase` 接口中方法实现的笔记: - `Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error)` 对 `message` 字节进行签名。需要做一些准备工作将 `message` 编码成 []byte 类型,可以参考 `auth` 模块 `message` 准备的例子。注意,SDK 上面没有实现签名的验证,签名验证被推迟到[`anteHandler`](#antehandler)中进行 - +++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/auth/types/txbuilder.go#L176-L209 + ++++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/auth/types/txbuilder.go#L176-L209 + - `CreateMnemonic(name string, language Language, passwd string, algo SigningAlgo) (info Info, seed string, err error)`创建一个新的助记符并打印在日志里,但是**并不保存在磁盘上** - `CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd string, account uint32, index uint32) (Info, error)` 基于[`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)创建一个新的账户并将其保存在磁盘上。注意私钥在[保存前用密码加密](https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/mintkey/mintkey.go),**永远不会储存未加密的私钥**.在这个方法的上下文中, `account`和 `address` 参数指的是 BIP44 派生路径的段(例如`0`, `1`, `2`, ...)用于从助记符派生出私钥和公钥(注意:给相同的助记符和 `account` 将派生出相同的私钥,给相同的 `account` 和 `address` 也会派生出相同的公钥和 `Address`)。最后注意 `CreateAccount` 方法使用在 [Tendermint library](https://github.com/tendermint/tendermint/tree/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/secp256k1) 中的 `secp256k1` 派生出公私钥和 `Address`。总之,这个方法是用来创建用户的钥匙和地址的,并不是共识秘钥,参见[`Addresses`](#addresses) 获取更多信息 @@ -95,7 +97,7 @@ Cosmos SDK 使用一套称之为 [BIP32](https://github.com/bitcoin/bips/blob/ma 在 Cosmos SDK 里面 `PubKey` 遵循在 tendermint 的 `crypto` 包中定义的 `Pubkey` 接口 -+++ https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/crypto.go#L22-L27 ++++ https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/crypto.go#L22-L27 对于 `secp256k1` 类型的秘钥,具体的实现可以在[这里](https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/secp256k1/secp256k1.go#L140)找到。对于`ed25519`类型的密钥,具体实现可以在[这里](https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/ed25519/ed25519.go#L135)找到。 diff --git a/docs/cn/intro/sdk-design.md b/docs/cn/intro/sdk-design.md index c7e4dc69eb90..94af6f87a058 100644 --- a/docs/cn/intro/sdk-design.md +++ b/docs/cn/intro/sdk-design.md @@ -13,7 +13,7 @@ Cosmos SDK 是一个框架,可以促进基于 Tendermint 的安全状态机的 `baseapp` 是 Cosmos SDK 应用程序的样本实现,它拥有能够处理和底层共识引擎的连接的 ABCI 实现。通常,Cosmos SDK 应用程序通过嵌入[`app.go`](https://docs.cosmos.network/master/basics/app-anatomy.html#core-application-file)来实现拓展。查看示例请参考 SDK 应用教程: -+++ https://github.com/cosmos/sdk-tutorials/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/app.go#L72-L9 ++++ https://github.com/cosmos/sdk-tutorials/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/app.go `baseapp` 的目标是在存储和可拓展状态机之间提供安全的接口,同时尽可能少地定义状态机(对 ABCI 保持不变)。 @@ -31,7 +31,7 @@ Cosmos SDK 的强大之处在于其模块化开发的理念。SDK 应用程序 以下的简化视图展示了应用链中的每个全节点如何处理有效区块中的 Transaction。 -``` +```md + | | Transaction relayed from the full-node's Tendermint engine