docs: Docs theme bump, Algolia DocSearch (#7164)

* bump docs theme to 1.0.171

* Fix typo, chinese character in URL
* update dead doc links

* bump docs theme to 1.0.172

* [favicons] add favicons

Co-authored-by: vms <vince19972@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Cyrus Goh 2020-08-25 13:10:20 -07:00 committed by GitHub
parent 7b52911b2a
commit d9fd4d2ca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 94 additions and 8 deletions

View File

@ -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",

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

View File

@ -0,0 +1,21 @@
<svg width="260" height="260" viewBox="0 0 260 260" fill="none" xmlns="http://www.w3.org/2000/svg">
<style>
path {
fill: black; <!-- set icon color for light mode -->
}
@media (prefers-color-scheme: dark) {
path {
fill: #F8F8FD; <!-- set icon color for dark mode -->
}
}
</style>
<g clip-path="url(#clip0)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M161.69 76.4992L77.7047 160.372C76.6218 158.273 75.6441 156.087 74.7683 153.819C71.8353 146.198 70.3688 138.113 70.3688 129.573C70.3688 121.027 71.8353 112.945 74.7683 105.324C77.7047 97.7003 81.7716 91.0864 86.9723 85.4725C92.1729 79.8621 98.4226 75.4245 105.718 72.1566C113.016 68.892 121.024 67.258 129.745 67.258C138.47 67.258 146.522 68.9326 153.899 72.2854C156.642 73.5295 159.239 74.933 161.69 76.4992ZM154.279 187.488C146.98 190.756 138.972 192.387 130.251 192.387C121.527 192.387 113.475 190.712 106.094 187.363C103.355 186.115 100.758 184.712 98.3104 183.142L182.292 99.2765C183.375 101.372 184.353 103.555 185.228 105.826C188.161 113.447 189.628 121.532 189.628 130.075C189.628 138.618 188.161 146.699 185.228 154.324C182.292 161.944 178.225 168.558 173.024 174.169C167.824 179.779 161.577 184.22 154.279 187.488ZM166.985 213.493C178.225 208.635 187.954 202.062 196.173 193.767C204.391 185.478 210.763 175.803 215.292 164.748C219.824 153.693 222.088 141.967 222.088 129.573C222.088 117.176 219.824 105.45 215.292 94.3916C212.607 87.8353 209.3 81.7808 205.376 76.2245L260 21.6758L238.294 -2.28882e-05L183.504 54.7149C178.585 51.3655 173.245 48.4705 167.488 46.0262C156.248 41.2531 143.837 38.8631 130.251 38.8631C116.662 38.8631 104.251 41.2938 93.0114 46.1517C81.7715 51.0096 72.0423 57.5828 63.8237 65.8748C55.6052 74.1668 49.2299 83.8419 44.7014 94.8967C40.1729 105.952 37.9086 117.678 37.9086 130.075C37.9086 142.469 40.1729 154.192 44.7014 165.25C47.39 171.809 50.6964 177.864 54.6207 183.424L0 237.966L21.7057 259.641L76.4928 204.93C81.4117 208.279 86.7515 211.174 92.509 213.619C103.749 218.392 116.16 220.778 129.745 220.778C143.334 220.778 155.745 218.348 166.985 213.493V213.493Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="260" height="260" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="260.000000pt" height="260.000000pt" viewBox="0 0 260.000000 260.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,260.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M2111 2328 l-274 -272 -76 41 c-161 86 -286 114 -491 108 -110 -2
-163 -8 -219 -25 -322 -93 -555 -327 -643 -645 -18 -67 -22 -105 -21 -240 0
-143 3 -169 26 -245 27 -90 73 -195 107 -245 11 -16 20 -33 20 -37 0 -5 -121
-129 -270 -278 l-270 -270 105 -105 c57 -58 108 -105 112 -105 5 0 129 121
277 269 l269 269 71 -38 c149 -81 270 -112 444 -115 170 -4 310 27 447 97 256
131 424 355 480 640 13 69 15 291 2 343 -3 11 -8 34 -12 50 -19 80 -59 177
-111 268 l-28 48 272 272 272 272 -107 107 -108 107 -274 -271z m-668 -417
c50 -12 167 -66 167 -78 0 -3 -187 -192 -416 -420 -308 -307 -419 -412 -425
-402 -13 19 -47 135 -57 189 -8 47 -8 177 1 220 39 194 154 360 304 438 123
64 292 85 426 53z m403 -353 c9 -24 18 -47 19 -53 2 -5 8 -30 15 -55 18 -63
16 -231 -4 -313 -57 -239 -252 -424 -479 -454 -143 -19 -302 11 -397 76 -12 9
64 90 400 426 228 228 418 415 421 415 4 0 15 -19 25 -42z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -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"
}

View File

@ -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

View File

@ -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://githubcom/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://githubcom/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)找到。

View File

@ -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