Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000000..e69de29bb2d diff --git a/404.html b/404.html new file mode 100644 index 00000000000..12570d323ba --- /dev/null +++ b/404.html @@ -0,0 +1,26 @@ + + +
+ + +We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
MinimumGasPricesParam
",id:"zerocoins-in-minimumgaspricesparam",level:3},{value:"Coins Split",id:"coins-split",level:4},{value:"Fee Checks",id:"fee-checks",level:4},{value:"Bypass Message Types",id:"bypass-message-types",level:3},{value:"Fee Checks in DeliverTx
",id:"fee-checks-in--delivertx",level:3},{value:"Consequences",id:"consequences",level:2},{value:"Positive",id:"positive",level:3},{value:"Negative",id:"negative",level:3},{value:"References",id:"references",level:2}],p={toc:m},d="wrapper";function c(e){let{components:n,...o}=e;return(0,a.yg)(d,(0,i.A)({},p,o,{components:n,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"adr-002-globalfee-module"},"ADR 002: Globalfee Module"),(0,a.yg)("h2",{id:"changelog"},"Changelog"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"2023-06-12: Initial Draft"),(0,a.yg)("li",{parentName:"ul"},"2024-06-06: Change status to deprecated")),(0,a.yg)("h2",{id:"status"},"Status"),(0,a.yg)("p",null,"Deprecated"),(0,a.yg)("h2",{id:"context"},"Context"),(0,a.yg)("p",null,"The globalfee module was created to manage a parameter called ",(0,a.yg)("inlineCode",{parentName:"p"},"MinimumGasPricesParam"),", which sets a network-wide minimum fee requirement. The intention was to stop random denominations from entering fee collections and to reduce the time validators take to check a long list of transaction fees. To address scenarios where no fee payment is required but the denominations for volunteered paid fees are still restricted, the zero coins was introduced to serve as a means of limiting the denoms. Nevertheless, the initial version of the globalfee module had some issues:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("p",{parentName:"li"},"In the globalfee module, several Cosmos SDK coins methods were redefined because of the allowance of zero-value coins in the ",(0,a.yg)("inlineCode",{parentName:"p"},"MinimumGasPricesParam"),". The ",(0,a.yg)("inlineCode",{parentName:"p"},"MinimumGasPricesParam")," is of ",(0,a.yg)("inlineCode",{parentName:"p"},"sdk.DecCoins")," type. In the Cosmos SDK, ",(0,a.yg)("inlineCode",{parentName:"p"},"sdk.DecCoins")," are ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/cosmos/cosmos-sdk/blob/67f04e629623d4691c4b2e48806f7793a3aa211e/types/dec_coin.go#L160-L177"},"sanitized")," to remove zero-value coins. As a result, several methods from ",(0,a.yg)("inlineCode",{parentName:"p"},"sdk.Coins")," were ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/cosmos/gaia/blob/890ab3aa2e5788537b0d2ebc9bafdc968340e0e5/x/globalfee/ante/fee_utils.go#L46-L104"},"redefined in the Gaia fee antehandler"),".")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("inlineCode",{parentName:"p"},"BypassMinFeeMsgTypes")," exists in ",(0,a.yg)("inlineCode",{parentName:"p"},"app.toml"),", which means each node can define its own value. Thus, it's not clear whether a transaction containing bypass-messages will be exempted from paying a fee.")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("p",{parentName:"li"},"The fee check logic is only executed in ",(0,a.yg)("inlineCode",{parentName:"p"},"CheckTx"),". This could enable malicious validators to change the fee check code and propose transactions that do not meet the fee requirement."))),(0,a.yg)("h2",{id:"decision"},"Decision"),(0,a.yg)("p",null,"To fix these problems, the following changes are added to the globalfee module:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"ZeroCoins in ",(0,a.yg)("inlineCode",{parentName:"strong"},"MinimumGasPricesParam"),":"),"\\\nRefactor the fee check logics, in order to use the Cosmos SDK coins' methods instead of the redefined methods."),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"Bypass Message Types:"),"\\\n",(0,a.yg)("inlineCode",{parentName:"li"},"BypassMinFeeMsgTypes")," is refactored to be a param of the globalfee module, in order to make the bypass messages deterministic."),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"Check Fees in ",(0,a.yg)("inlineCode",{parentName:"strong"},"DeliverTx"),":"),"\\\nThe fee check is factored to executed in both ",(0,a.yg)("inlineCode",{parentName:"li"},"DeliverTx")," and ",(0,a.yg)("inlineCode",{parentName:"li"},"CheckTx"),". This is to prevent malicious validators from changing the fee check logic and allowing any transactions to pass fee check. As a consequence, ",(0,a.yg)("inlineCode",{parentName:"li"},"MinimumGasPricesParam")," is introduced as a globalfee param.")),(0,a.yg)("h3",{id:"zerocoins-in-minimumgaspricesparam"},"ZeroCoins in ",(0,a.yg)("inlineCode",{parentName:"h3"},"MinimumGasPricesParam")),(0,a.yg)("h4",{id:"coins-split"},"Coins Split"),(0,a.yg)("p",null,(0,a.yg)("inlineCode",{parentName:"p"},"CombinedFeeRequirement")," refers to the fee requirement that takes into account both ",(0,a.yg)("inlineCode",{parentName:"p"},"globalFees")," (",(0,a.yg)("inlineCode",{parentName:"p"},"MinimumGasPricesParam")," in the globalfee module) and ",(0,a.yg)("inlineCode",{parentName:"p"},"localFees")," (",(0,a.yg)("inlineCode",{parentName:"p"},"minimum-gas-prices")," in ",(0,a.yg)("inlineCode",{parentName:"p"},"app.toml"),"). This requirement is calculated as the maximum value between ",(0,a.yg)("inlineCode",{parentName:"p"},"globalFees")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"localFees")," for denomination exists ",(0,a.yg)("inlineCode",{parentName:"p"},"globalFees"),".\nThe allowance of zero coins in the ",(0,a.yg)("inlineCode",{parentName:"p"},"MinimumGasPricesParam")," within the globalfee module implies that ",(0,a.yg)("inlineCode",{parentName:"p"},"CombinedFeeRequirement(globalFees, localFees)")," also permits zero coins. Therefore, the ",(0,a.yg)("inlineCode",{parentName:"p"},"CombinedFeeRequirement")," doesn't meet the requirements of certain ",(0,a.yg)("inlineCode",{parentName:"p"},"sdk.Coins")," methods. For instance, the ",(0,a.yg)("inlineCode",{parentName:"p"},"DenomsSubsetOf")," method requires coins that do not contain zero coins."),(0,a.yg)("p",null,"To address this issue, the ",(0,a.yg)("inlineCode",{parentName:"p"},"CombinedFeeRequirement")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoins")," are split as shown in the chart below."),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-mermaid"},"---\ntitle: Fee Requirements and Fee Splits\n---\nflowchart TD\n subgraph feeReq\n A[CombinedFeeRequirement]--\x3eB[/Split zero/nonzero coins/]\n B--\x3e|zero coins| C[zeroCoinFeesDenomReq];\n B--\x3e|nonzero coins| D[nonzeroCoinFeesDenomReq];\n\n end\n\n subgraph feeCoin\n E[feeCoins]--\x3eF[/Split by the denoms in zero/nonzero CoinFeesDenomReq/]\n F--\x3e|denoms in zeroCoinFeesDenomReq set| G[feeCoinsZeroDenom]\n F--\x3e|denoms in nonzeroCoinFeesDenomReq set| H[feeCoinsNonZeroDenom]\n end\n")),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"CombinedFeeRequirement")," is split into zero and non-zero coins, forming ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq"),". Similarly, the paid fees (feeCoins) are split into ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsNonZeroDenom")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsZeroDenom"),", based on the denominations of ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq")," as shown in the following code snippet."),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-go"}," nonZeroCoinFeesReq, zeroCoinFeesDenomReq := getNonZeroFees(feeRequired)\n\n // feeCoinsNonZeroDenom contains non-zero denominations from the feeRequired\n // feeCoinsNonZeroDenom is used to check if the fees meets the requirement imposed by nonZeroCoinFeesReq\n // when feeCoins does not contain zero coins' denoms in feeRequired\n feeCoinsNonZeroDenom, feeCoinsZeroDenom := splitCoinsByDenoms(feeCoins, zeroCoinFeesDenomReq)\n\n")),(0,a.yg)("h4",{id:"fee-checks"},"Fee Checks"),(0,a.yg)("p",null,"The Workflow of feeCheck is shown below:"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-mermaid"},"---\ntitle: Fee Check\n---\nflowchart TD\n\nA[feeCoinsNonZeroDenom]--\x3eB[/DenomsSubsetOf_nonZeroCoinFeesReq/];\nB--\x3e|yes|C[is_bypass_msg];\nB--\x3e|no|D((reject));\n\nC--\x3e|yes|pass1((pass));\nC--\x3e|no|D[/contain_zeroCoinFeesDenomReq_denom/];\n\nD--\x3e|yes|pass2((pass));\nD--\x3e|no|E[/feeCoinsZeroDenom_nonEmpty/];\n\n\nE--\x3e|yes|pass3((pass));\nE--\x3e|no|F[/IsAnyGTE_nonZeroCoinFeesDenomReq/];\n\nF--\x3e|yes|pass4((pass));\nF--\x3e|no|reject2((reject));\n")),(0,a.yg)("p",null,"The split enable checking ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsNonZeroDenom")," against ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq"),", and ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsZeroDenom")," against\n",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq")," (as shown in the following code snippet). In the check of ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsNonZeroDenom")," against ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq"),", the Cosmos SDK coins' methods can be used since zero coins are removed from the ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq"),", while in the check ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsZeroDenom")," against ",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq"),", only denoms need to be checked."),(0,a.yg)("p",null,"Checking ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsNonZeroDenom")," against ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq"),":"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-go"},' if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) {\n return ctx, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String())\n }\n')),(0,a.yg)("p",null,"Here is an example of how the coins split and checked in fee antehandler:"),(0,a.yg)("p",null,(0,a.yg)("strong",{parentName:"p"},"assumption"),":"),(0,a.yg)("p",null,(0,a.yg)("inlineCode",{parentName:"p"},"globalfee=[1photon, 0uatom, 1stake]")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"local min-gas-prices=[0.5stake]")),(0,a.yg)("p",null,(0,a.yg)("strong",{parentName:"p"},"fee requirement"),":"),(0,a.yg)("p",null,(0,a.yg)("inlineCode",{parentName:"p"},"combinedFeeRequirement=[1photon, 0uatom, 1stake]")),(0,a.yg)("p",null,(0,a.yg)("strong",{parentName:"p"},"split fee requirement"),":"),(0,a.yg)("p",null,"the ",(0,a.yg)("inlineCode",{parentName:"p"},"combinedFeeRequirement")," into ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq=[0uatom]"),", and ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq=[1photon, 1stake]")),(0,a.yg)("p",null,(0,a.yg)("strong",{parentName:"p"},"split the paid fees"),":"),(0,a.yg)("p",null,"if ",(0,a.yg)("inlineCode",{parentName:"p"},"paidFee=[1uatom, 0.5photon]"),",\nthe ",(0,a.yg)("inlineCode",{parentName:"p"},"splitCoinsByDenoms")," splits the paidFee into ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsZeroDenom=[1uatom]")," (the same denom as zero coins in ",(0,a.yg)("inlineCode",{parentName:"p"},"combinedFeeRequirement"),"), and ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsNonZeroDenom=[0.5stake]"),"\nthen ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoinsZeroDenom=[1uatom]")," is checked by ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesReq=[1photon, 1stake]"),"."),(0,a.yg)("p",null,"Please note that ",(0,a.yg)("inlineCode",{parentName:"p"},"feeCoins")," does not contain zero coins. The fee coins are split according to the denoms in ",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesDenomReq"),". If feeCoins contains coins not in both ",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesDenomReq"),", the transaction should be rejected. On the contrary, if feeCoins' denoms are in either ",(0,a.yg)("inlineCode",{parentName:"p"},"zeroCoinFeesDenomReq")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"nonZeroCoinFeesDenomReq"),", and ",(0,a.yg)("inlineCode",{parentName:"p"},"len(zeroCoinFeesDenomReq)!=0"),", the transaction can directly pass, otherwise, the fee amount need to be checked."),(0,a.yg)("h3",{id:"bypass-message-types"},"Bypass Message Types"),(0,a.yg)("p",null,(0,a.yg)("inlineCode",{parentName:"p"},"BypassMinFeeMsgTypes")," was a setup in ",(0,a.yg)("inlineCode",{parentName:"p"},"config/app.toml")," before the refactor. ",(0,a.yg)("inlineCode",{parentName:"p"},"BypassMinFeeMsgTypes")," is refactored to be a param of the globalfee module to get a network level agreement. Correspondingly,",(0,a.yg)("inlineCode",{parentName:"p"},"MaxTotalBypassMinFeeMsgGasUsage")," is also introduced as a globalfee param."),(0,a.yg)("h3",{id:"fee-checks-in--delivertx"},"Fee Checks in ",(0,a.yg)("inlineCode",{parentName:"h3"},"DeliverTx")),(0,a.yg)("p",null,"Implementing fee checks within the ",(0,a.yg)("inlineCode",{parentName:"p"},"DeliverTx")," function introduces a few requirements:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"Deterministic Minimum Fee Requirement"),": For the ",(0,a.yg)("inlineCode",{parentName:"li"},"DeliverTx")," process, it is essential to have a deterministic minimum fee requirement. In ",(0,a.yg)("inlineCode",{parentName:"li"},"CheckTx"),", fee is checked by the ",(0,a.yg)("inlineCode",{parentName:"li"},"CombinedFeeRequirement(globalFees, localFees)"),", which considers both ",(0,a.yg)("inlineCode",{parentName:"li"},"minimum-gas-prices")," from ",(0,a.yg)("inlineCode",{parentName:"li"},"config/app.toml")," and ",(0,a.yg)("inlineCode",{parentName:"li"},"MinimumGasPricesParam")," from the globalfee Params (For more details, see ",(0,a.yg)("a",{parentName:"li",href:"../../modules/globalfee.md"},"globalfee"),"). ",(0,a.yg)("inlineCode",{parentName:"li"},"CombinedFeeRequirement")," contains non-deterministic part: ",(0,a.yg)("inlineCode",{parentName:"li"},"minimum-gas-prices")," from ",(0,a.yg)("inlineCode",{parentName:"li"},"app.toml"),". Therefore, ",(0,a.yg)("inlineCode",{parentName:"li"},"CombinedFeeRequirement")," cannot be used in ",(0,a.yg)("inlineCode",{parentName:"li"},"DeliverTx"),". In ",(0,a.yg)("inlineCode",{parentName:"li"},"DeliverTx"),", only ",(0,a.yg)("inlineCode",{parentName:"li"},"MinimumGasPricesParam")," in globalfee Params is used for fee verification. The code implementation is shown below. ")),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-go"},'func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error) {\n // Get required global fee min gas prices\n // Note that it should never be empty since its default value is set to coin={"StakingBondDenom", 0}\n globalFees, err := mfd.GetGlobalFee(ctx, tx)\n if err != nil {\n return sdk.Coins{}, err\n }\n\n // In DeliverTx, the global fee min gas prices are the only tx fee requirements.\n if !ctx.IsCheckTx() {\n return globalFees, nil\n }\n\n // In CheckTx mode, the local and global fee min gas prices are combined\n // to form the tx fee requirements\n\n // Get local minimum-gas-prices\n localFees := GetMinGasPrice(ctx, int64(tx.GetGas()))\n\n // Return combined fee requirements\n return CombinedFeeRequirement(globalFees, localFees)\n}\n')),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Deterministic Bypass Parameters"),": The decision of whether a message can bypass the minimum fee has to be deterministic as well. To ensure this, ",(0,a.yg)("inlineCode",{parentName:"p"},"BypassMinFeeMsgTypes")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"MaxTotalBypassMinFeeMsgGasUsage")," parameters are moved to a persistent store.")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Module Initialization Order"),": The genutils module must be initialized before the globalfee module. This is due to the ",(0,a.yg)("inlineCode",{parentName:"p"},"DeliverGenTxs")," in the genutils module, is called during ",(0,a.yg)("inlineCode",{parentName:"p"},"initGenesis"),". This function executes ",(0,a.yg)("inlineCode",{parentName:"p"},"DeliverTx"),", which subsequently calls the AnteHandle in FeeDecorator, triggering the fee check in ",(0,a.yg)("inlineCode",{parentName:"p"},"DeliverTx"),".\nTo prevent the ",(0,a.yg)("inlineCode",{parentName:"p"},"DeliverGenTxs")," go through a fee check, the initialization of the globalfee module should occur after the genutils module. This sequencing ensures that all necessary components are in place when the fee check occurs. See ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/cosmos/gaia/issues/2489"},"Gaia Issue #2489")," for more context."))),(0,a.yg)("h2",{id:"consequences"},"Consequences"),(0,a.yg)("h3",{id:"positive"},"Positive"),(0,a.yg)("p",null,"This refactor results in code that is easier to maintain. It prevents malicious validators from escaping fee checks and make the bypass messages work at network level."),(0,a.yg)("h3",{id:"negative"},"Negative"),(0,a.yg)("p",null,"The introduction of FeeDecorator has replaced the usage of ",(0,a.yg)("inlineCode",{parentName:"p"},"MempoolFeeDecorator")," in the Cosmos SDK. Currently, if both FeeDecorator and MempoolFeeDecorator are added to the AnteDecorator chain, it will result in redundant checks. However, there's potential for FeeDecorator and MempoolFeeDecorator to become incompatible in the future, depending on updates to the Cosmos SDK."),(0,a.yg)("h2",{id:"references"},"References"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"../../modules/globalfee"},"Documentation of the globalfee module"))))}c.isMDXComponent=!0}}]);
\ No newline at end of file
diff --git a/assets/js/0ce6bca3.7f4755fc.js b/assets/js/0ce6bca3.7f4755fc.js
new file mode 100644
index 00000000000..16e4701e345
--- /dev/null
+++ b/assets/js/0ce6bca3.7f4755fc.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[4036],{5680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>g});var n=a(6540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t["'])(?.*?)\1/,f=/\{(? [\d,-]+)\}/,h={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};function g(e,t){const n=e.map((e=>{const{start:n,end:a}=h[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${a})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function b(e,t){let n=e.replace(/\n$/,"");const{language:a,magicComments:o,metastring:r}=t;if(r&&f.test(r)){const e=r.match(f).groups.range;if(0===o.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${r}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=o[0].className,a=m()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(a),code:n}}if(void 0===a)return{lineClassNames:{},code:n};const l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return g(["js","jsBlock"],t);case"jsx":case"tsx":return g(["js","jsBlock","jsx"],t);case"html":return g(["js","jsBlock","html"],t);case"python":case"py":case"bash":return g(["bash"],t);case"markdown":case"md":return g(["html","jsx","bash"],t);default:return g(Object.keys(h),t)}}(a,o),c=n.split("\n"),i=Object.fromEntries(o.map((e=>[e.className,{start:0,range:""}]))),s=Object.fromEntries(o.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),d=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),u=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let m=0;m void 0!==e));s[t]?i[s[t]].range+=`${m},`:d[t]?i[d[t]].start=m:u[t]&&(i[u[t]].range+=`${i[u[t]].start}-${m-1},`),c.splice(m,1)}n=c.join("\n");const p={};return Object.entries(i).forEach((e=>{let[t,{range:n}]=e;m()(n).forEach((e=>{p[e]??=[],p[e].push(t)}))})),{lineClassNames:p,code:n}}const v={codeBlockContainer:"codeBlockContainer_Ckt0"};function E(e){let{as:t,...n}=e;const r=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[a,o]=e;const r=t[a];r&&"string"==typeof o&&(n[r]=o)})),n}(s());return o.createElement(t,(0,a.A)({},n,{style:r,className:(0,l.A)(n.className,v.codeBlockContainer,d.G.common.codeBlock)}))}const y={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function k(e){let{children:t,className:n}=e;return o.createElement(E,{as:"pre",tabIndex:0,className:(0,l.A)(y.codeBlockStandalone,"thin-scrollbar",n)},o.createElement("code",{className:y.codeBlockLines},t))}var N=n(9532);const A={attributes:!0,characterData:!0,childList:!0,subtree:!0};function C(e,t){const[n,a]=(0,o.useState)(),r=(0,o.useCallback)((()=>{a(e.current?.closest("[role=tabpanel][hidden]"))}),[e,a]);(0,o.useEffect)((()=>{r()}),[r]),function(e,t,n){void 0===n&&(n=A);const a=(0,N._q)(t),r=(0,N.Be)(n);(0,o.useEffect)((()=>{const t=new MutationObserver(a);return e&&t.observe(e,r),()=>t.disconnect()}),[e,a,r])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),r())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}const L={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]};var _={Prism:n(1258).A,theme:L};function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(){return w=Object.assign||function(e){for(var t=1;t 0&&e[n-1]===t?e:e.concat(t)};function j(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===t.indexOf(a)&&(n[a]=e[a]);return n}var H=function(e){function t(){for(var t=this,n=[],a=arguments.length;a--;)n[a]=arguments[a];e.apply(this,n),T(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,a=Object.create(null),o=e.styles.reduce((function(e,n){var a=n.languages,o=n.style;return a&&!a.includes(t)||n.types.forEach((function(t){var n=w({},e[t],o);e[t]=n})),e}),a);return o.root=n,o.plain=w({},n,{backgroundColor:null}),o}(e.theme,e.language):void 0;return t.themeDict=n})),T(this,"getLineProps",(function(e){var n=e.key,a=e.className,o=e.style,r=w({},j(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),l=t.getThemeDict(t.props);return void 0!==l&&(r.style=l.plain),void 0!==o&&(r.style=void 0!==r.style?w({},r.style,o):o),void 0!==n&&(r.key=n),a&&(r.className+=" "+a),r})),T(this,"getStyleForToken",(function(e){var n=e.types,a=e.empty,o=n.length,r=t.getThemeDict(t.props);if(void 0!==r){if(1===o&&"plain"===n[0])return a?{display:"inline-block"}:void 0;if(1===o&&!a)return r[n[0]];var l=a?{display:"inline-block"}:{},c=n.map((function(e){return r[e]}));return Object.assign.apply(Object,[l].concat(c))}})),T(this,"getTokenProps",(function(e){var n=e.key,a=e.className,o=e.style,r=e.token,l=w({},j(e,["key","className","style","token"]),{className:"token "+r.types.join(" "),children:r.content,style:t.getStyleForToken(r),key:void 0});return void 0!==o&&(l.style=void 0!==l.style?w({},l.style,o):o),void 0!==n&&(l.key=n),a&&(l.className+=" "+a),l})),T(this,"tokenize",(function(e,t,n,a){var o={code:t,grammar:n,language:a,tokens:[]};e.hooks.run("before-tokenize",o);var r=o.tokens=e.tokenize(o.code,o.grammar,o.language);return e.hooks.run("after-tokenize",o),r}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,a=e.code,o=e.children,r=this.getThemeDict(this.props),l=t.languages[n];return o({tokens:function(e){for(var t=[[]],n=[e],a=[0],o=[e.length],r=0,l=0,c=[],i=[c];l>-1;){for(;(r=a[l]++) 0?d:["plain"],s=u):(d=O(d,u.type),u.alias&&(d=O(d,u.alias)),s=u.content),"string"==typeof s){var m=s.split(x),p=m.length;c.push({types:d,content:m[0]});for(var f=1;f o.createElement("span",(0,a.A)({key:t},i({token:e,key:t})))));return o.createElement("span",s,r?o.createElement(o.Fragment,null,o.createElement("span",{className:S.codeLineNumber}),o.createElement("span",{className:S.codeLineContent},d)):d,o.createElement("br",null))}var I=n(1312);function U(e){return o.createElement("svg",(0,a.A)({viewBox:"0 0 24 24"},e),o.createElement("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}))}function D(e){return o.createElement("svg",(0,a.A)({viewBox:"0 0 24 24"},e),o.createElement("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}const R={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function V(e){let{code:t,className:n}=e;const[a,r]=(0,o.useState)(!1),c=(0,o.useRef)(void 0),i=(0,o.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const a=document.createElement("textarea"),o=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection(),l=r.rangeCount>0&&r.getRangeAt(0);n.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch{}a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),o&&o.focus()}(t),r(!0),c.current=window.setTimeout((()=>{r(!1)}),1e3)}),[t]);return(0,o.useEffect)((()=>()=>window.clearTimeout(c.current)),[]),o.createElement("button",{type:"button","aria-label":a?(0,I.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,I.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,I.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,l.A)("clean-btn",n,R.copyButton,a&&R.copyButtonCopied),onClick:i},o.createElement("span",{className:R.copyButtonIcons,"aria-hidden":"true"},o.createElement(U,{className:R.copyButtonIcon}),o.createElement(D,{className:R.copyButtonSuccessIcon})))}function z(e){return o.createElement("svg",(0,a.A)({viewBox:"0 0 24 24"},e),o.createElement("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}))}const W={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function $(e){let{className:t,onClick:n,isEnabled:a}=e;const r=(0,I.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return o.createElement("button",{type:"button",onClick:n,className:(0,l.A)("clean-btn",t,a&&W.wordWrapButtonEnabled),"aria-label":r,title:r},o.createElement(z,{className:W.wordWrapButtonIcon,"aria-hidden":"true"}))}function G(e){let{children:t,className:n="",metastring:r,title:c,showLineNumbers:d,language:u}=e;const{prism:{defaultLanguage:m,magicComments:f}}=(0,i.p)(),h=u??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??m,g=s(),v=function(){const[e,t]=(0,o.useState)(!1),[n,a]=(0,o.useState)(!1),r=(0,o.useRef)(null),l=(0,o.useCallback)((()=>{const n=r.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[r,e]),c=(0,o.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=r.current,n=e>t||r.current.querySelector("code").hasAttribute("style");a(n)}),[r]);return C(r,c),(0,o.useEffect)((()=>{c()}),[e,c]),(0,o.useEffect)((()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)})),[c]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:n,toggle:l}}(),k=function(e){return e?.match(p)?.groups.title??""}(r)||c,{lineClassNames:N,code:A}=b(t,{metastring:r,language:h,magicComments:f}),L=d??function(e){return Boolean(e?.includes("showLineNumbers"))}(r);return o.createElement(E,{as:"div",className:(0,l.A)(n,h&&!n.includes(`language-${h}`)&&`language-${h}`)},k&&o.createElement("div",{className:y.codeBlockTitle},k),o.createElement("div",{className:y.codeBlockContent},o.createElement(M,(0,a.A)({},_,{theme:g,code:A,language:h??"text"}),(e=>{let{className:t,tokens:n,getLineProps:a,getTokenProps:r}=e;return o.createElement("pre",{tabIndex:0,ref:v.codeBlockRef,className:(0,l.A)(t,y.codeBlock,"thin-scrollbar")},o.createElement("code",{className:(0,l.A)(y.codeBlockLines,L&&y.codeBlockLinesWithNumbering)},n.map(((e,t)=>o.createElement(P,{key:t,line:e,getLineProps:a,getTokenProps:r,classNames:N[t],showLineNumbers:L})))))})),o.createElement("div",{className:y.buttonGroup},(v.isEnabled||v.isCodeScrollable)&&o.createElement($,{className:y.codeButton,onClick:()=>v.toggle(),isEnabled:v.isEnabled}),o.createElement(V,{className:y.codeButton,code:A}))))}function F(e){let{children:t,...n}=e;const l=(0,r.A)(),c=function(e){return o.Children.toArray(e).some((e=>(0,o.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),i="string"==typeof c?G:k;return o.createElement(i,(0,a.A)({key:String(l)},n),c)}},6140:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Xe});var a=n(6540),o=n(9024),r=n(9532);const l=a.createContext(null);function c(e){let{children:t,content:n}=e;const o=function(e){return(0,a.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return a.createElement(l.Provider,{value:o},t)}function i(){const e=(0,a.useContext)(l);if(null===e)throw new r.dV("DocProvider");return e}function s(){const{metadata:e,frontMatter:t,assets:n}=i();return a.createElement(o.be,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var d=n(53),u=n(4581),m=n(8168),p=n(1312),f=n(5489);function h(e){const{permalink:t,title:n,subLabel:o,isNext:r}=e;return a.createElement(f.A,{className:(0,d.A)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t},o&&a.createElement("div",{className:"pagination-nav__sublabel"},o),a.createElement("div",{className:"pagination-nav__label"},n))}function g(e){const{previous:t,next:n}=e;return a.createElement("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,p.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"})},t&&a.createElement(h,(0,m.A)({},t,{subLabel:a.createElement(p.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc"},"Previous")})),n&&a.createElement(h,(0,m.A)({},n,{subLabel:a.createElement(p.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc"},"Next"),isNext:!0})))}function b(){const{metadata:e}=i();return a.createElement(g,{previous:e.previous,next:e.next})}var v=n(4586),E=n(4070),y=n(7559),k=n(5597),N=n(2252);const A={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return a.createElement(p.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:a.createElement("b",null,n.label)}},"This is unreleased documentation for {siteTitle} {versionLabel} version.")},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return a.createElement(p.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:a.createElement("b",null,n.label)}},"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.")}};function C(e){const t=A[e.versionMetadata.banner];return a.createElement(t,e)}function L(e){let{versionLabel:t,to:n,onClick:o}=e;return a.createElement(p.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:a.createElement("b",null,a.createElement(f.A,{to:n,onClick:o},a.createElement(p.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label"},"latest version")))}},"For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).")}function _(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:o}}=(0,v.A)(),{pluginId:r}=(0,E.vT)({failfast:!0}),{savePreferredVersionName:l}=(0,k.g1)(r),{latestDocSuggestion:c,latestVersionSuggestion:i}=(0,E.HW)(r),s=c??(u=i).docs.find((e=>e.id===u.mainDocId));var u;return a.createElement("div",{className:(0,d.A)(t,y.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert"},a.createElement("div",null,a.createElement(C,{siteTitle:o,versionMetadata:n})),a.createElement("div",{className:"margin-top--md"},a.createElement(L,{versionLabel:i.label,to:s.path,onClick:()=>l(i.name)})))}function T(e){let{className:t}=e;const n=(0,N.r)();return n.banner?a.createElement(_,{className:t,versionMetadata:n}):null}function w(e){let{className:t}=e;const n=(0,N.r)();return n.badge?a.createElement("span",{className:(0,d.A)(t,y.G.docs.docVersionBadge,"badge badge--secondary")},a.createElement(p.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label}},"Version: {versionLabel}")):null}function x(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:n}=e;return a.createElement(p.A,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:a.createElement("b",null,a.createElement("time",{dateTime:new Date(1e3*t).toISOString()},n))}}," on {date}")}function B(e){let{lastUpdatedBy:t}=e;return a.createElement(p.A,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:a.createElement("b",null,t)}}," by {user}")}function O(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:n,lastUpdatedBy:o}=e;return a.createElement("span",{className:y.G.common.lastUpdated},a.createElement(p.A,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t&&n?a.createElement(x,{lastUpdatedAt:t,formattedLastUpdatedAt:n}):"",byUser:o?a.createElement(B,{lastUpdatedBy:o}):""}},"Last updated{atDate}{byUser}"),!1)}const j={iconEdit:"iconEdit_Z9Sw"};function H(e){let{className:t,...n}=e;return a.createElement("svg",(0,m.A)({fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,d.A)(j.iconEdit,t),"aria-hidden":"true"},n),a.createElement("g",null,a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))}function M(e){let{editUrl:t}=e;return a.createElement("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:y.G.common.editThisPage},a.createElement(H,null),a.createElement(p.A,{id:"theme.common.editThisPage",description:"The link label to edit the current page"},"Edit this page"))}const S={tag:"tag_zVej",tagRegular:"tagRegular_sFm0",tagWithCount:"tagWithCount_h2kH"};function P(e){let{permalink:t,label:n,count:o}=e;return a.createElement(f.A,{href:t,className:(0,d.A)(S.tag,o?S.tagWithCount:S.tagRegular)},n,o&&a.createElement("span",null,o))}const I={tags:"tags_jXut",tag:"tag_QGVx"};function U(e){let{tags:t}=e;return a.createElement(a.Fragment,null,a.createElement("b",null,a.createElement(p.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list"},"Tags:")),a.createElement("ul",{className:(0,d.A)(I.tags,"padding--none","margin-left--sm")},t.map((e=>{let{label:t,permalink:n}=e;return a.createElement("li",{key:n,className:I.tag},a.createElement(P,{label:t,permalink:n}))}))))}const D={lastUpdated:"lastUpdated_vwxv"};function R(e){return a.createElement("div",{className:(0,d.A)(y.G.docs.docFooterTagsRow,"row margin-bottom--sm")},a.createElement("div",{className:"col"},a.createElement(U,e)))}function V(e){let{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:o,formattedLastUpdatedAt:r}=e;return a.createElement("div",{className:(0,d.A)(y.G.docs.docFooterEditMetaRow,"row")},a.createElement("div",{className:"col"},t&&a.createElement(M,{editUrl:t})),a.createElement("div",{className:(0,d.A)("col",D.lastUpdated)},(n||o)&&a.createElement(O,{lastUpdatedAt:n,formattedLastUpdatedAt:r,lastUpdatedBy:o})))}function z(){const{metadata:e}=i(),{editUrl:t,lastUpdatedAt:n,formattedLastUpdatedAt:o,lastUpdatedBy:r,tags:l}=e,c=l.length>0,s=!!(t||n||r);return c||s?a.createElement("footer",{className:(0,d.A)(y.G.docs.docFooter,"docusaurus-mt-lg")},c&&a.createElement(R,{tags:l}),s&&a.createElement(V,{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:r,formattedLastUpdatedAt:o})):null}var W=n(1422),$=n(6342);function G(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const a=n.slice(2,e.level);e.parentIndex=Math.max(...a),n[e.level]=t}));const a=[];return t.forEach((e=>{const{parentIndex:n,...o}=e;n>=0?t[n].children.push(o):a.push(o)})),a}function F(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return t.flatMap((e=>{const t=F({toc:e.children,minHeadingLevel:n,maxHeadingLevel:a});return function(e){return e.level>=n&&e.level<=a}(e)?[{...e,children:t}]:t}))}function q(e){const t=e.getBoundingClientRect();return t.top===t.bottom?q(e.parentNode):t}function Y(e,t){let{anchorTopOffset:n}=t;const a=e.find((e=>q(e).top>=n));if(a){return function(e){return e.top>0&&e.bottom
{e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function Q(e){const t=(0,a.useRef)(void 0),n=Z();(0,a.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:a,linkActiveClassName:o,minHeadingLevel:r,maxHeadingLevel:l}=e;function c(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(a),c=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const a=[];for(let o=t;o<=n;o+=1)a.push(`h${o}.anchor`);return Array.from(document.querySelectorAll(a.join()))}({minHeadingLevel:r,maxHeadingLevel:l}),i=Y(c,{anchorTopOffset:n.current}),s=e.find((e=>i&&i.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(o),e.classList.add(o),t.current=e):e.classList.remove(o)}(e,e===s)}))}return document.addEventListener("scroll",c),document.addEventListener("resize",c),c(),()=>{document.removeEventListener("scroll",c),document.removeEventListener("resize",c)}}),[e,n])}function X(e){let{toc:t,className:n,linkClassName:o,isChild:r}=e;return t.length?a.createElement("ul",{className:r?void 0:n},t.map((e=>a.createElement("li",{key:e.id},a.createElement("a",{href:`#${e.id}`,className:o??void 0,dangerouslySetInnerHTML:{__html:e.value}}),a.createElement(X,{isChild:!0,toc:e.children,className:n,linkClassName:o}))))):null}const J=a.memo(X);function K(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:o="table-of-contents__link",linkActiveClassName:r,minHeadingLevel:l,maxHeadingLevel:c,...i}=e;const s=(0,$.p)(),d=l??s.tableOfContents.minHeadingLevel,u=c??s.tableOfContents.maxHeadingLevel,p=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:o}=e;return(0,a.useMemo)((()=>F({toc:G(t),minHeadingLevel:n,maxHeadingLevel:o})),[t,n,o])}({toc:t,minHeadingLevel:d,maxHeadingLevel:u});return Q((0,a.useMemo)((()=>{if(o&&r)return{linkClassName:o,linkActiveClassName:r,minHeadingLevel:d,maxHeadingLevel:u}}),[o,r,d,u])),a.createElement(J,(0,m.A)({toc:p,className:n,linkClassName:o},i))}const ee={tocCollapsibleButton:"tocCollapsibleButton_TO0P",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_MG3E"};function te(e){let{collapsed:t,...n}=e;return a.createElement("button",(0,m.A)({type:"button"},n,{className:(0,d.A)("clean-btn",ee.tocCollapsibleButton,!t&&ee.tocCollapsibleButtonExpanded,n.className)}),a.createElement(p.A,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component"},"On this page"))}const ne={tocCollapsible:"tocCollapsible_ETCw",tocCollapsibleContent:"tocCollapsibleContent_vkbj",tocCollapsibleExpanded:"tocCollapsibleExpanded_sAul"};function ae(e){let{toc:t,className:n,minHeadingLevel:o,maxHeadingLevel:r}=e;const{collapsed:l,toggleCollapsed:c}=(0,W.u)({initialState:!0});return a.createElement("div",{className:(0,d.A)(ne.tocCollapsible,!l&&ne.tocCollapsibleExpanded,n)},a.createElement(te,{collapsed:l,onClick:c}),a.createElement(W.N,{lazy:!0,className:ne.tocCollapsibleContent,collapsed:l},a.createElement(K,{toc:t,minHeadingLevel:o,maxHeadingLevel:r})))}const oe={tocMobile:"tocMobile_ITEo"};function re(){const{toc:e,frontMatter:t}=i();return a.createElement(ae,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,d.A)(y.G.docs.docTocMobile,oe.tocMobile)})}const le={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"},ce="table-of-contents__link toc-highlight",ie="table-of-contents__link--active";function se(e){let{className:t,...n}=e;return a.createElement("div",{className:(0,d.A)(le.tableOfContents,"thin-scrollbar",t)},a.createElement(K,(0,m.A)({},n,{linkClassName:ce,linkActiveClassName:ie})))}function de(){const{toc:e,frontMatter:t}=i();return a.createElement(se,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:y.G.docs.docTocDesktop})}const ue={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};function me(e){let{as:t,id:n,...o}=e;const{navbar:{hideOnScroll:r}}=(0,$.p)();if("h1"===t||!n)return a.createElement(t,(0,m.A)({},o,{id:void 0}));const l=(0,p.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof o.children?o.children:n});return a.createElement(t,(0,m.A)({},o,{className:(0,d.A)("anchor",r?ue.anchorWithHideOnScrollNavbar:ue.anchorWithStickyNavbar,o.className),id:n}),o.children,a.createElement(f.A,{className:"hash-link",to:`#${n}`,"aria-label":l,title:l},"\u200b"))}var pe=n(5680),fe=n(5260);var he=n(8059),ge=n.n(he);var be=n(2303);const ve={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};function Ee(e){return!!e&&("SUMMARY"===e.tagName||Ee(e.parentElement))}function ye(e,t){return!!e&&(e===t||ye(e.parentElement,t))}function ke(e){let{summary:t,children:n,...o}=e;const r=(0,be.A)(),l=(0,a.useRef)(null),{collapsed:c,setCollapsed:i}=(0,W.u)({initialState:!o.open}),[s,u]=(0,a.useState)(o.open),p=a.isValidElement(t)?t:a.createElement("summary",null,t??"Details");return a.createElement("details",(0,m.A)({},o,{ref:l,open:s,"data-collapsed":c,className:(0,d.A)(ve.details,r&&ve.isBrowser,o.className),onMouseDown:e=>{Ee(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;Ee(t)&&ye(t,l.current)&&(e.preventDefault(),c?(i(!1),u(!0)):i(!0))}}),p,a.createElement(W.N,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{i(e),u(!e)}},a.createElement("div",{className:ve.collapsibleContent},n)))}const Ne={details:"details_b_Ee"},Ae="alert alert--info";function Ce(e){let{...t}=e;return a.createElement(ke,(0,m.A)({},t,{className:(0,d.A)(Ae,Ne.details,t.className)}))}function Le(e){return a.createElement(me,e)}const _e={containsTaskList:"containsTaskList_mC6p"};function Te(e){if(void 0!==e)return(0,d.A)(e,e?.includes("contains-task-list")&&_e.containsTaskList)}const we={img:"img_ev3q"};const xe="admonition_LlT9",Be="admonitionHeading_tbUL",Oe="admonitionIcon_kALy",je="admonitionContent_S0QG";const He={note:{infimaClassName:"secondary",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:a.createElement(p.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:a.createElement(p.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:a.createElement(p.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:a.createElement(p.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 16 16"},a.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:a.createElement(p.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},Me={secondary:"note",important:"info",success:"tip",warning:"danger"};function Se(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=a.Children.toArray(e),n=t.find((e=>a.isValidElement(e)&&"mdxAdmonitionTitle"===e.props?.mdxType)),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:o}}(e.children);return{...e,title:e.title??t,children:n}}const Pe={head:function(e){const t=a.Children.map(e.children,(e=>a.isValidElement(e)?function(e){if(e.props?.mdxType&&e.props.originalType){const{mdxType:t,originalType:n,...o}=e.props;return a.createElement(e.props.originalType,o)}return e}(e):e));return a.createElement(fe.A,e,t)},code:function(e){const t=["a","abbr","b","br","button","cite","code","del","dfn","em","i","img","input","ins","kbd","label","object","output","q","ruby","s","small","span","strong","sub","sup","time","u","var","wbr"];return a.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")||(0,a.isValidElement)(e)&&t.includes(e.props?.mdxType)))?a.createElement("code",e):a.createElement(ge(),e)},a:function(e){return a.createElement(f.A,e)},pre:function(e){return a.createElement(ge(),(0,a.isValidElement)(e.children)&&"code"===e.children.props?.originalType?e.children.props:{...e})},details:function(e){const t=a.Children.toArray(e.children),n=t.find((e=>a.isValidElement(e)&&"summary"===e.props?.mdxType)),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return a.createElement(Ce,(0,m.A)({},e,{summary:n}),o)},ul:function(e){return a.createElement("ul",(0,m.A)({},e,{className:Te(e.className)}))},img:function(e){return a.createElement("img",(0,m.A)({loading:"lazy"},e,{className:(t=e.className,(0,d.A)(t,we.img))}));var t},h1:e=>a.createElement(Le,(0,m.A)({as:"h1"},e)),h2:e=>a.createElement(Le,(0,m.A)({as:"h2"},e)),h3:e=>a.createElement(Le,(0,m.A)({as:"h3"},e)),h4:e=>a.createElement(Le,(0,m.A)({as:"h4"},e)),h5:e=>a.createElement(Le,(0,m.A)({as:"h5"},e)),h6:e=>a.createElement(Le,(0,m.A)({as:"h6"},e)),admonition:function(e){const{children:t,type:n,title:o,icon:r}=Se(e),l=function(e){const t=Me[e]??e,n=He[t];return n||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),He.info)}(n),c=o??l.label,{iconComponent:i}=l,s=r??a.createElement(i,null);return a.createElement("div",{className:(0,d.A)(y.G.common.admonition,y.G.common.admonitionType(e.type),"alert",`alert--${l.infimaClassName}`,xe)},a.createElement("div",{className:Be},a.createElement("span",{className:Oe},s),c),a.createElement("div",{className:je},t))},mermaid:()=>null};function Ie(e){let{children:t}=e;return a.createElement(pe.xA,{components:Pe},t)}function Ue(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=i();return t.hide_title||void 0!==n?null:e.title}();return a.createElement("div",{className:(0,d.A)(y.G.docs.docMarkdown,"markdown")},n&&a.createElement("header",null,a.createElement(me,{as:"h1"},n)),a.createElement(Ie,null,t))}var De=n(1754),Re=n(9169),Ve=n(6025);function ze(e){return a.createElement("svg",(0,m.A)({viewBox:"0 0 24 24"},e),a.createElement("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"}))}const We={breadcrumbHomeIcon:"breadcrumbHomeIcon_YNFT"};function $e(){const e=(0,Ve.A)("/");return a.createElement("li",{className:"breadcrumbs__item"},a.createElement(f.A,{"aria-label":(0,p.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e},a.createElement(ze,{className:We.breadcrumbHomeIcon})))}const Ge={breadcrumbsContainer:"breadcrumbsContainer_Z_bl"};function Fe(e){let{children:t,href:n,isLast:o}=e;const r="breadcrumbs__link";return o?a.createElement("span",{className:r,itemProp:"name"},t):n?a.createElement(f.A,{className:r,href:n,itemProp:"item"},a.createElement("span",{itemProp:"name"},t)):a.createElement("span",{className:r},t)}function qe(e){let{children:t,active:n,index:o,addMicrodata:r}=e;return a.createElement("li",(0,m.A)({},r&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},{className:(0,d.A)("breadcrumbs__item",{"breadcrumbs__item--active":n})}),t,a.createElement("meta",{itemProp:"position",content:String(o+1)}))}function Ye(){const e=(0,De.OF)(),t=(0,Re.Dt)();return e?a.createElement("nav",{className:(0,d.A)(y.G.docs.docBreadcrumbs,Ge.breadcrumbsContainer),"aria-label":(0,p.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"})},a.createElement("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList"},t&&a.createElement($e,null),e.map(((t,n)=>{const o=n===e.length-1;return a.createElement(qe,{key:n,active:o,index:n,addMicrodata:!!t.href},a.createElement(Fe,{href:t.href,isLast:o},t.label))})))):null}const Ze={docItemContainer:"docItemContainer_Djhp",docItemCol:"docItemCol_VOVn"};function Qe(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=i(),n=(0,u.l)(),o=e.hide_table_of_contents,r=!o&&t.length>0;return{hidden:o,mobile:r?a.createElement(re,null):void 0,desktop:!r||"desktop"!==n&&"ssr"!==n?void 0:a.createElement(de,null)}}();return a.createElement("div",{className:"row"},a.createElement("div",{className:(0,d.A)("col",!n.hidden&&Ze.docItemCol)},a.createElement(T,null),a.createElement("div",{className:Ze.docItemContainer},a.createElement("article",null,a.createElement(Ye,null),a.createElement(w,null),n.mobile,a.createElement(Ue,null,t),a.createElement(z,null)),a.createElement(b,null))),n.desktop&&a.createElement("div",{className:"col col--3"},n.desktop))}function Xe(e){const t=`docs-doc-id-${e.content.metadata.unversionedId}`,n=e.content;return a.createElement(c,{content:e.content},a.createElement(o.e3,{className:t},a.createElement(s,null),a.createElement(Qe,null,a.createElement(n,null))))}},2252:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>c});var a=n(6540),o=n(9532);const r=a.createContext(null);function l(e){let{children:t,version:n}=e;return a.createElement(r.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(r);if(null===e)throw new o.dV("DocsVersionProvider");return e}},8426:(e,t)=>{function n(e){let t,n=[];for(let a of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(a))n.push(parseInt(a,10));else if(t=a.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,a,o,r]=t;if(a&&r){a=parseInt(a),r=parseInt(r);const e=a {function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,a,s,c,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var h=new Error('Uncaught, unspecified "error" event. ('+t+")");throw h.context=t,h}if(i(a=this._events[e]))return!1;if(r(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),a.apply(this,c)}else if(n(a))for(c=Array.prototype.slice.call(arguments,1),s=(o=a.slice()).length,u=0;u 0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,a,s,c;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,a=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(i)){for(c=s;c-- >0;)if(i[c]===t||i[c].listener&&i[c].listener===t){a=c;break}if(a<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},4103:(e,t,r)=>{"use strict";var n=r(6571),i=r(3371),a=r(7691);function s(e,t,r,i){return new n(e,t,r,i)}s.version=r(6938),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},6732:(e,t,r)=>{"use strict";var n=r(2733);function i(e,t){this.main=e,this.fn=t,this.lastResults=null}r(3014)(i,n),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},e.exports=i},1673:(e,t,r)=>{"use strict";var n=r(9110),i=r(317),a=r(1383),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return i(e)?{}:e;if("string"==typeof t)return a(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=Boolean(e[t])&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},3371:(e,t,r)=>{"use strict";var n=r(9110),i=r(849),a=r(4843),s=r(4728),c=r(317),u=r(1383),o=r(7507),h=r(2208),f=r(1673);function l(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return l(t[r],e)})):e===t}function m(e){var t=e?m._parseNumbers(e):{};void 0===t.userToken||h(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==m.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}m.PARAMETERS=Object.keys(new m),m._parseNumbers=function(e){if(e instanceof m)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return s(e,t)},m.make=function(e){var t=new m(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},m.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&c(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):c(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},m.prototype={constructor:m,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var n=o(r);if(this.isNumericRefined(e,t,n))return this;var i=s({},this.numericRefinements);return i[e]=s({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(n)):i[e][t]=[n],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){var n=r;return void 0!==n?this.isNumericRefined(e,t,n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,i){return i===e&&r.op===t&&l(r.val,o(n))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return c(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return u(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(r))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:n({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return Boolean(this.numericRefinements[e]);var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var a,s,c=o(r),u=void 0!==(a=this.numericRefinements[e][t],s=c,i(a,(function(e){return l(e,s)})));return n&&u},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0}))).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=m.validate(this,e);if(t)throw t;var r=this,n=m._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return i(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=m},6673:(e,t,r)=>{"use strict";e.exports=function(e){return function(t,r){var n=e.hierarchicalFacets[r],o=e.hierarchicalFacetsRefinements[n.name]&&e.hierarchicalFacetsRefinements[n.name][0]||"",h=e._getHierarchicalFacetSeparator(n),f=e._getHierarchicalRootPath(n),l=e._getHierarchicalShowParentLevel(n),m=a(e._getHierarchicalFacetSortBy(n)),d=t.every((function(e){return e.exhaustive})),p=function(e,t,r,n,a){return function(o,h,f){var l=o;if(f>0){var m=0;for(l=o;m{"use strict";var n=r(8965),i=r(9110),a=r(2909),s=r(849),c=r(3917),u=r(7577),o=r(4728),h=r(8601),f=a.escapeFacetValue,l=a.unescapeFacetValue,m=r(6673);function d(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function p(e,t,r){t&&t[r]&&(e.stats=t[r])}function v(e,t,r){var a=t[0];this._rawResults=t;var u=this;Object.keys(a).forEach((function(e){u[e]=a[e]}));var h=o({persistHierarchicalRootCount:!1},r);Object.keys(h).forEach((function(e){u[e]=h[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var f=e.getRefinedDisjunctiveFacets(),v=d(e.facets),g=d(e.disjunctiveFacets),y=1,R=a.facets||{};Object.keys(R).forEach((function(t){var r,n,i=R[t],o=(r=e.hierarchicalFacets,n=t,s(r,(function(e){return(e.attributes||[]).indexOf(n)>-1})));if(o){var h=o.attributes.indexOf(t),f=c(e.hierarchicalFacets,(function(e){return e.name===o.name}));u.hierarchicalFacets[f][h]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var l,m=-1!==e.disjunctiveFacets.indexOf(t),d=-1!==e.facets.indexOf(t);m&&(l=g[t],u.disjunctiveFacets[l]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(u.disjunctiveFacets[l],a.facets_stats,t)),d&&(l=v[t],u.facets[l]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(u.facets[l],a.facets_stats,t))}})),this.hierarchicalFacets=n(this.hierarchicalFacets),f.forEach((function(r){var n=t[y],s=n&&n.facets?n.facets:{},h=e.getHierarchicalFacetByName(r);Object.keys(s).forEach((function(t){var r,f=s[t];if(h){r=c(e.hierarchicalFacets,(function(e){return e.name===h.name}));var m=c(u.hierarchicalFacets[r],(function(e){return e.attribute===t}));if(-1===m)return;u.hierarchicalFacets[r][m].data=o({},u.hierarchicalFacets[r][m].data,f)}else{r=g[t];var d=a.facets&&a.facets[t]||{};u.disjunctiveFacets[r]={name:t,data:i({},f,d),exhaustive:n.exhaustiveFacetsCount},p(u.disjunctiveFacets[r],n.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(n){!u.disjunctiveFacets[r].data[n]&&e.disjunctiveFacetsRefinements[t].indexOf(l(n))>-1&&(u.disjunctiveFacets[r].data[n]=0)}))}})),y++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),a=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(r);0===s.length||s[0].split(a).length<2||t.slice(y).forEach((function(t){var r=t&&t.facets?t.facets:{};Object.keys(r).forEach((function(t){var o=r[t],h=c(e.hierarchicalFacets,(function(e){return e.name===n.name})),f=c(u.hierarchicalFacets[h],(function(e){return e.attribute===t}));if(-1!==f){var l={};if(s.length>0&&!u.persistHierarchicalRootCount){var m=s[0].split(a)[0];l[m]=u.hierarchicalFacets[h][f].data[m]}u.hierarchicalFacets[h][f].data=i(l,o,u.hierarchicalFacets[h][f].data)}})),y++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var r=e.facetsExcludes[t],n=v[t];u.facets[n]={name:t,data:R[t],exhaustive:a.exhaustiveFacetsCount},r.forEach((function(e){u.facets[n]=u.facets[n]||{name:t},u.facets[n].data=u.facets[n].data||{},u.facets[n].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(m(e)),this.facets=n(this.facets),this.disjunctiveFacets=n(this.disjunctiveFacets),this._state=e}function g(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=s(e.facets,r);return n?Object.keys(n.data).map((function(r){var i=f(r);return{name:r,escapedValue:i,count:n.data[r],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=s(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){var n=f(r);return{name:r,escapedValue:n,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,n)}})):[]}if(e._state.isHierarchicalFacet(t)){var a=s(e.hierarchicalFacets,r);if(!a)return a;var c=e._state.getHierarchicalFacetByName(t),u=e._state._getHierarchicalFacetSeparator(c),o=l(e._state.getHierarchicalRefinement(t)[0]||"");0===o.indexOf(c.rootPath)&&(o=o.replace(c.rootPath+u,""));var h=o.split(u);return h.unshift(t),y(a,h,0),a}}function y(e,t,r){e.isRefined=e.name===(t[r]&&t[r].trim()),e.data&&e.data.forEach((function(e){y(e,t,r+1)}))}function R(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||0===t.data.length)return t;var a=t.data.map((function(t){return R(e,t,r,n+1)})),s=e(a,r[n]);return i({data:s},t)}function F(e,t){var r=s(e,(function(e){return e.name===t}));return r&&r.stats}function b(e,t,r,n,i){var a=s(i,(function(e){return e.name===r})),c=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:c,exhaustive:u}}v.prototype.getFacetByName=function(e){function t(t){return t.name===e}return s(this.facets,t)||s(this.disjunctiveFacets,t)||s(this.hierarchicalFacets,t)},v.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],v.prototype.getFacetValues=function(e,t){var r=g(this,e);if(r){var n,a=i({},t,{sortBy:v.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),s=this;if(Array.isArray(r))n=[e];else n=s._state.getHierarchicalFacetByName(r.name).attributes;return R((function(e,t){if(a.facetOrdering){var r=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(s,t);if(r)return function(e,t){var r=[],n=[],i=(t.order||[]).reduce((function(e,t,r){return e[t]=r,e}),{});e.forEach((function(e){var t=e.path||e.name;void 0!==i[t]?r[i[t]]=e:n.push(e)})),r=r.filter((function(e){return e}));var a,s=t.sortRemainingBy;return"hidden"===s?r:(a="alpha"===s?[["path","name"],["asc","asc"]]:[["count"],["desc"]],r.concat(h(n,a[0],a[1])))}(e,r)}if(Array.isArray(a.sortBy)){var n=u(a.sortBy,v.DEFAULT_SORT);return h(e,n[0],n[1])}if("function"==typeof a.sortBy)return function(e,t){return t.sort(e)}(a.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),r,n)}},v.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?F(this.facets,e):this._state.isDisjunctiveFacet(e)?F(this.disjunctiveFacets,e):void 0},v.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(b(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(b(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(b(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),c=r.split(a),u=s(n,(function(e){return e.name===t})),o=c.reduce((function(e,t){var r=e&&s(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),h=o&&o.count||0,f=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:h,exhaustive:f}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=v},6571:(e,t,r)=>{"use strict";var n=r(2733),i=r(6732),a=r(2909).escapeFacetValue,s=r(3014),c=r(4728),u=r(317),o=r(1383),h=r(9228),f=r(3371),l=r(7691),m=r(6938);function d(e,t,r,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.setClient(e);var i=r||{};i.index=t,this.state=f.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._searchResultsOptions=n}function p(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function v(){return this.state.page}s(d,n),d.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},d.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},d.prototype.getQuery=function(){var e=this.state;return h._getHitsSearchParams(e)},d.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=h._getQueries(r.index,r),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new l(r,e.results),state:r,_originalResponse:e}}),(function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new l(r,e.results),r)})).catch((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,r)}))},d.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=c({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:o(h._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(n.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(n.query,e.queryLanguages,i)},d.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues,s="function"==typeof this.client.initIndex;if(!i&&!s&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var c=this.state.setQueryParameters(n||{}),u=c.isDisjunctiveFacet(e),o=h.getSearchForFacetQuery(e,t,r,c);this._currentNbQueries++;var f,l=this;return i?f=this.client.searchForFacetValues([{indexName:c.index,params:o}]):s?f=this.client.initIndex(c.index).searchForFacetValues(o):(delete o.facetName,f=this.client.search([{type:"facet",facet:e,indexName:c.index,params:o}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:c,facet:e,query:t}),f.then((function(t){return l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=a(t.value),t.isRefined=u?c.isDisjunctiveFacetRefined(e,t.escapedValue):c.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),e}))},d.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},d.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},d.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},d.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},d.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},d.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},d.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},d.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},d.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},d.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},d.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},d.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},d.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},d.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},d.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},d.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},d.prototype.setCurrentPage=p,d.prototype.setPage=p,d.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},d.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},d.prototype.setState=function(e){return this._change({state:f.make(e),isPageReset:!1}),this},d.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new f(e),this},d.prototype.hasRefinements=function(e){return!!u(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},d.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},d.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},d.prototype.hasTag=function(e){return this.state.isTagRefined(e)},d.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},d.prototype.getIndex=function(){return this.state.index},d.prototype.getCurrentPage=v,d.prototype.getPage=v,d.prototype.getTags=function(){return this.state.tagRefinements},d.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},d.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},d.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},d.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=h._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=n.index?h._getQueries(n.index,n):[];return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),s=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,r,s));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(c){this.emit("error",{error:c})}},d.prototype._dispatchAlgoliaResponse=function(e,t,r){var n=this;if(!(t 0},d.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},d.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},d.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.client=e),this},d.prototype.getClient=function(){return this.client},d.prototype.derive=function(e){var t=new i(this,e);return this.derivedHelpers.push(t),t},d.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},d.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=d},8965:e=>{"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},9110:e=>{"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(r){void 0!==t[r]&&(void 0!==e[r]&&delete e[r],e[r]=t[r])})),e}),{})}},2909:e=>{"use strict";e.exports={escapeFacetValue:function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},unescapeFacetValue:function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")}}},849:e=>{"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var r=0;r {"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r {"use strict";var n=r(849);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},3014:e=>{"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},4843:e=>{"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},4728:e=>{"use strict";function t(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function r(e,n){if(e===n)return e;for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&"__proto__"!==i&&"constructor"!==i){var a=n[i],s=e[i];void 0!==s&&void 0===a||(t(s)&&t(a)?e[i]=r(s,a):e[i]="object"==typeof(c=a)&&null!==c?r(Array.isArray(c)?[]:{},c):c)}var c;return e}e.exports=function(e){t(e)||(e={});for(var n=1,i=arguments.length;n{"use strict";e.exports=function(e){return e&&Object.keys(e).length>0}},1383:e=>{"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n =0||(i[r]=e[r]);return i}},8601:e=>{"use strict";function t(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e =n.length?a:"desc"===n[i]?-a:a}return e.index-r.index})),i.map((function(e){return e.value}))}},7507:e=>{"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},9228:(e,t,r)=>{"use strict";var n=r(4728);function i(e){return Object.keys(e).sort().reduce((function(t,r){return t[r]=e[r],t}),{})}var a={_getQueries:function(e,t){var r=[];return r.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(n){r.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,n)})})),t.getRefinedHierarchicalFacets().forEach((function(n){var i=t.getHierarchicalFacetByName(n),s=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(i);if(s.length>0&&s[0].split(c).length>1){var u=s[0].split(c).slice(0,-1).reduce((function(e,t,r){return e.concat({attribute:i.attributes[r],value:0===r?t:[e[e.length-1].value,t].join(c)})}),[]);u.forEach((function(n,s){var c=a._getDisjunctiveFacetSearchParams(t,n.attribute,0===s);function o(e){return i.attributes.some((function(t){return t===e.split(":")[0]}))}var h=(c.facetFilters||[]).reduce((function(e,t){if(Array.isArray(t)){var r=t.filter((function(e){return!o(e)}));r.length>0&&e.push(r)}return"string"!=typeof t||o(t)||e.push(t),e}),[]),f=u[s-1];c.facetFilters=s>0?h.concat(f.attribute+":"+f.value):h.length>0?h:void 0,r.push({indexName:e,params:c})}))}})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),r=a._getFacetFilters(e),s=a._getNumericFilters(e),c=a._getTagFilters(e),u={facets:t.indexOf("*")>-1?["*"]:t,tagFilters:c};return r.length>0&&(u.facetFilters=r),s.length>0&&(u.numericFilters=s),i(n({},e.getQueryParams(),u))},_getDisjunctiveFacetSearchParams:function(e,t,r){var s=a._getFacetFilters(e,t,r),c=a._getNumericFilters(e,t),u=a._getTagFilters(e),o={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};u.length>0&&(o.tagFilters=u);var h=e.getHierarchicalFacetByName(t);return o.facets=h?a._getDisjunctiveHierarchicalFacetAttribute(e,h,r):t,c.length>0&&(o.numericFilters=c),s.length>0&&(o.facetFilters=s),i(n({},e.getQueryParams(),o))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach((function(e){(i[e]||[]).slice().sort().forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).sort().forEach((function(e){(a[e]||[]).sort().forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).sort().forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.slice().sort().forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).sort().forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),h=e._getHierarchicalFacetSeparator(o),f=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(h)||!f&&!0===r||f&&f.split(h).length===a.split(h).length)return;f?(u=f.split(h).length-1,a=f):(u=a.split(h).length-2,a=a.slice(0,a.lastIndexOf(h))),s=o.attributes[u]}else u=a.split(h).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,s){var c=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,u={facetQuery:t,facetName:e};return"number"==typeof r&&(u.maxFacetHits=r),i(n({},a._getHitsSearchParams(c),u))}};e.exports=a},2208:e=>{"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},6938:e=>{"use strict";e.exports="3.16.3"},3643:function(e){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n =0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t 2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){c();var t=JSON.stringify(e);return a()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n 0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},p=1,v=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function R(e){return"string"==typeof e?{protocol:"https",url:e,accept:d.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function P(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===p||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function _(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r(r({},e.headers),t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,h=n.method!==F?{}:r(r({},n.data),i.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),h),i.queryParameters),l=0,m=function t(r,a){var h=r.pop();if(void 0===h)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:O(s)};var m={data:c,headers:u,method:o,url:E(h,n.path,f),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:h,triesLeft:r.length};return s.push(t),t},p={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(h,y(h,n.isTimedOut?g:v))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,O(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&!~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,p)}))};return P(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function j(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function E(e,t,r){var n=x(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function x(e){return Object.keys(e).map((function(t){return f("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function O(e){return e.map((function(e){return w(e)}))}function w(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var A=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,h=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:h,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,f.timeouts.read),n=function(){return _(f,f.hosts.filter((function(e){return!!(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return _(f,f.hosts.filter((function(e){return!!(e.accept&d.Write)})),e,m(t,f.timeouts.write))}};return f}(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},N=function(e){return function(t,r){return t.method===F?e.transporter.read(t,r):e.transporter.write(t,r)}},H=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r(r({},e),{},{params:x(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},T=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return H(e)(t.indexName,{methods:{searchForFacetValues:k}}).searchForFacetValues(s,c,r(r({},i),u))})))}},Q=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},C=function(e){return function(t,r){return e.transporter.read({method:b,path:f("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},k=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},D=1,I=2,q=3;function V(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=q,{debug:function(e,t){return D>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return I>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.22.1","-").concat(e)}),u()]}),userAgent:j("4.22.1").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return A(r(r(r({},a),n),{},{methods:{search:S,searchForFacetValues:T,multipleQueries:S,multipleSearchForFacetValues:T,customRequest:N,initIndex:function(e){return function(t){return H(e)(t,{methods:{search:C,searchForFacetValues:k,findAnswers:Q}})}}}}))}return V.version="4.22.1",V}()},9057:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>N});var n=r(6540),i=r(53),a=r(4103),s=r.n(a),c=r(3643),u=r.n(c),o=r(8193),h=r(5260),f=r(5489),l=r(4070),m=r(4586);const d=["zero","one","two","few","many","other"];function p(e){return d.filter((t=>e.includes(t)))}const v={locale:"en",pluralForms:p(["one","other"]),select:e=>1===e?"one":"other"};function g(){const{i18n:{currentLocale:e}}=(0,m.A)();return(0,n.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:p(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),v}}),[e])}function y(){const e=g();return{selectMessage:(t,r)=>function(e,t,r){const n=e.split("|");if(1===n.length)return n[0];n.length>r.pluralForms.length&&console.error(`For locale=${r.locale}, a maximum of ${r.pluralForms.length} plural forms are expected (${r.pluralForms.join(",")}), but the message contains ${n.length}: ${e}`);const i=r.select(t),a=r.pluralForms.indexOf(i);return n[Math.min(a,n.length-1)]}(r,t,e)}}var R=r(4255),F=r(9532),b=r(9024),P=r(481),_=r(1312),j=r(8126),E=r(1062),x=r(8511);const O={searchQueryInput:"searchQueryInput_u2C7",searchVersionInput:"searchVersionInput_m0Ui",searchResultsColumn:"searchResultsColumn_JPFH",algoliaLogo:"algoliaLogo_rT1R",algoliaLogoPathFill:"algoliaLogoPathFill_WdUC",searchResultItem:"searchResultItem_Tv2o",searchResultItemHeading:"searchResultItemHeading_KbCB",searchResultItemPath:"searchResultItemPath_lhe1",searchResultItemSummary:"searchResultItemSummary_AEaO",searchQueryColumn:"searchQueryColumn_RTkw",searchVersionColumn:"searchVersionColumn_ypXd",searchLogoColumn:"searchLogoColumn_rJIA",loadingSpinner:"loadingSpinner_XVxU","loading-spin":"loading-spin_vzvp",loader:"loader_vvXV"};function w(e){let{docsSearchVersionsHelpers:t}=e;const r=Object.entries(t.allDocsData).filter((e=>{let[,t]=e;return t.versions.length>1}));return n.createElement("div",{className:(0,i.A)("col","col--3","padding-left--none",O.searchVersionColumn)},r.map((e=>{let[i,a]=e;const s=r.length>1?`${i}: `:"";return n.createElement("select",{key:i,onChange:e=>t.setSearchVersion(i,e.target.value),defaultValue:t.searchVersions[i],className:O.searchVersionInput},a.versions.map(((e,t)=>n.createElement("option",{key:t,label:`${s}${e.label}`,value:e.name}))))})))}function A(){const{i18n:{currentLocale:e}}=(0,m.A)(),{algolia:{appId:t,apiKey:r,indexName:a}}=(0,j.c)(),c=(0,E.C)(),d=function(){const{selectMessage:e}=y();return t=>e(t,(0,_.T)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}(),p=function(){const e=(0,l.Gy)(),[t,r]=(0,n.useState)((()=>Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return{...e,[r]:n.versions[0].name}}),{}))),i=Object.values(e).some((e=>e.versions.length>1));return{allDocsData:e,versioningEnabled:i,searchVersions:t,setSearchVersion:(e,t)=>r((r=>({...r,[e]:t})))}}(),[v,g]=(0,R.b)(),b={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[A,N]=(0,n.useReducer)(((e,t)=>{switch(t.type){case"reset":return b;case"loading":return{...e,loading:!0};case"update":return v!==t.value.query?e:{...t.value,items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)};case"advance":{const t=e.totalPages>e.lastPage+1;return{...e,lastPage:t?e.lastPage+1:e.lastPage,hasMore:t}}default:return e}}),b),H=u()(t,r),S=s()(H,a,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","docusaurus_tag"]});S.on("result",(e=>{let{results:{query:t,hits:r,page:n,nbHits:i,nbPages:a}}=e;if(""===t||!Array.isArray(r))return void N({type:"reset"});const s=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),u=r.map((e=>{let{url:t,_highlightResult:{hierarchy:r},_snippetResult:n={}}=e;const i=Object.keys(r).map((e=>s(r[e].value)));return{title:i.pop(),url:c(t),summary:n.content?`${s(n.content.value)}...`:"",breadcrumbs:i}}));N({type:"update",value:{items:u,query:t,totalResults:i,totalPages:a,lastPage:n,hasMore:a>n+1,loading:!1}})}));const[T,Q]=(0,n.useState)(null),C=(0,n.useRef)(0),k=(0,n.useRef)(o.A.canUseIntersectionObserver&&new IntersectionObserver((e=>{const{isIntersecting:t,boundingClientRect:{y:r}}=e[0];t&&C.current>r&&N({type:"advance"}),C.current=r}),{threshold:1})),D=()=>v?(0,_.T)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:v}):(0,_.T)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"}),I=(0,F._q)((function(t){void 0===t&&(t=0),S.addDisjunctiveFacetRefinement("docusaurus_tag","default"),S.addDisjunctiveFacetRefinement("language",e),Object.entries(p.searchVersions).forEach((e=>{let[t,r]=e;S.addDisjunctiveFacetRefinement("docusaurus_tag",`docs-${t}-${r}`)})),S.setQuery(v).setPage(t).search()}));return(0,n.useEffect)((()=>{if(!T)return;const e=k.current;return e?(e.observe(T),()=>e.unobserve(T)):()=>!0}),[T]),(0,n.useEffect)((()=>{N({type:"reset"}),v&&(N({type:"loading"}),setTimeout((()=>{I()}),300))}),[v,p.searchVersions,I]),(0,n.useEffect)((()=>{A.lastPage&&0!==A.lastPage&&I(A.lastPage)}),[I,A.lastPage]),n.createElement(x.A,null,n.createElement(h.A,null,n.createElement("title",null,(0,P.s)(D())),n.createElement("meta",{property:"robots",content:"noindex, follow"})),n.createElement("div",{className:"container margin-vert--lg"},n.createElement("h1",null,D()),n.createElement("form",{className:"row",onSubmit:e=>e.preventDefault()},n.createElement("div",{className:(0,i.A)("col",O.searchQueryColumn,{"col--9":p.versioningEnabled,"col--12":!p.versioningEnabled})},n.createElement("input",{type:"search",name:"q",className:O.searchQueryInput,placeholder:(0,_.T)({id:"theme.SearchPage.inputPlaceholder",message:"Type your search here",description:"The placeholder for search page input"}),"aria-label":(0,_.T)({id:"theme.SearchPage.inputLabel",message:"Search",description:"The ARIA label for search page input"}),onChange:e=>g(e.target.value),value:v,autoComplete:"off",autoFocus:!0})),p.versioningEnabled&&n.createElement(w,{docsSearchVersionsHelpers:p})),n.createElement("div",{className:"row"},n.createElement("div",{className:(0,i.A)("col","col--8",O.searchResultsColumn)},!!A.totalResults&&d(A.totalResults)),n.createElement("div",{className:(0,i.A)("col","col--4","text--right",O.searchLogoColumn)},n.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.algolia.com/","aria-label":(0,_.T)({id:"theme.SearchPage.algoliaLabel",message:"Search by Algolia",description:"The ARIA label for Algolia mention"})},n.createElement("svg",{viewBox:"0 0 168 24",className:O.algoliaLogo},n.createElement("g",{fill:"none"},n.createElement("path",{className:O.algoliaLogoPathFill,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),n.createElement("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),n.createElement("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})))))),A.items.length>0?n.createElement("main",null,A.items.map(((e,t)=>{let{title:r,url:a,summary:s,breadcrumbs:c}=e;return n.createElement("article",{key:t,className:O.searchResultItem},n.createElement("h2",{className:O.searchResultItemHeading},n.createElement(f.A,{to:a,dangerouslySetInnerHTML:{__html:r}})),c.length>0&&n.createElement("nav",{"aria-label":"breadcrumbs"},n.createElement("ul",{className:(0,i.A)("breadcrumbs",O.searchResultItemPath)},c.map(((e,t)=>n.createElement("li",{key:t,className:"breadcrumbs__item",dangerouslySetInnerHTML:{__html:e}}))))),s&&n.createElement("p",{className:O.searchResultItemSummary,dangerouslySetInnerHTML:{__html:s}}))}))):[v&&!A.loading&&n.createElement("p",{key:"no-results"},n.createElement(_.A,{id:"theme.SearchPage.noResultsText",description:"The paragraph for empty search result"},"No results were found")),!!A.loading&&n.createElement("div",{key:"spinner",className:O.loadingSpinner})],A.hasMore&&n.createElement("div",{className:O.loader,ref:Q},n.createElement(_.A,{id:"theme.SearchPage.fetchingNewResults",description:"The paragraph for fetching new search results"},"Fetching new results..."))))}function N(){return n.createElement(b.e3,{className:"search-page-wrapper"},n.createElement(A,null))}}}]); \ No newline at end of file diff --git a/assets/js/1a4e3797.08548001.js.LICENSE.txt b/assets/js/1a4e3797.08548001.js.LICENSE.txt new file mode 100644 index 00000000000..9caab8b19c2 --- /dev/null +++ b/assets/js/1a4e3797.08548001.js.LICENSE.txt @@ -0,0 +1 @@ +/*! algoliasearch-lite.umd.js | 4.22.1 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */ diff --git a/assets/js/1be78505.78a5a7fc.js b/assets/js/1be78505.78a5a7fc.js new file mode 100644 index 00000000000..85c9090a780 --- /dev/null +++ b/assets/js/1be78505.78a5a7fc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[8714,1774],{10:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ge});var a=n(6540),o=n(53),l=n(9024),r=n(7559),c=n(2967),i=n(1754),s=n(2252),d=n(6588),m=n(8511),u=n(1312),b=n(3104),p=n(5062);const h={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};function E(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),l=(0,a.useRef)(!1),{startScroll:r,cancelScroll:c}=(0,b.gk)();return(0,b.Mq)(((e,n)=>{let{scrollY:a}=e;const r=n?.scrollY;r&&(l.current?l.current=!1:a>=r?(c(),o(!1)):a {e.location.hash&&(l.current=!0,o(!1))})),{shown:n,scrollToTop:()=>r(0)}}({threshold:300});return a.createElement("button",{"aria-label":(0,u.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.A)("clean-btn",r.G.common.backToTopButton,h.backToTopButton,e&&h.backToTopButtonShow),type:"button",onClick:t})}var f=n(3109),g=n(6347),v=n(4581),_=n(6342),A=n(3465),C=n(8168);function k(e){return a.createElement("svg",(0,C.A)({width:"20",height:"20","aria-hidden":"true"},e),a.createElement("g",{fill:"#7a7a7a"},a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))}const S={collapseSidebarButton:"collapseSidebarButton_PEFL",collapseSidebarButtonIcon:"collapseSidebarButtonIcon_kv0_"};function N(e){let{onClick:t}=e;return a.createElement("button",{type:"button",title:(0,u.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,u.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.A)("button button--secondary button--outline",S.collapseSidebarButton),onClick:t},a.createElement(k,{className:S.collapseSidebarButtonIcon}))}var T=n(5041),I=n(9532);const x=Symbol("EmptyContext"),B=a.createContext(x);function w(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),l=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return a.createElement(B.Provider,{value:l},t)}var y=n(1422),L=n(9169),M=n(5489),H=n(2303);function P(e){let{categoryLabel:t,onClick:n}=e;return a.createElement("button",{"aria-label":(0,u.T)({id:"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel",message:"Toggle the collapsible sidebar category '{label}'",description:"The ARIA label to toggle the collapsible sidebar category"},{label:t}),type:"button",className:"clean-btn menu__caret",onClick:n})}function G(e){let{item:t,onItemClick:n,activePath:l,level:c,index:s,...d}=e;const{items:m,label:u,collapsible:b,className:p,href:h}=t,{docs:{sidebar:{autoCollapseCategories:E}}}=(0,_.p)(),f=function(e){const t=(0,H.A)();return(0,a.useMemo)((()=>e.href?e.href:!t&&e.collapsible?(0,i._o)(e):void 0),[e,t])}(t),g=(0,i.w8)(t,l),v=(0,L.ys)(h,l),{collapsed:A,setCollapsed:k}=(0,y.u)({initialState:()=>!!b&&(!g&&t.collapsed)}),{expandedItem:S,setExpandedItem:N}=function(){const e=(0,a.useContext)(B);if(e===x)throw new I.dV("DocSidebarItemsExpandedStateProvider");return e}(),T=function(e){void 0===e&&(e=!A),N(e?null:s),k(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const l=(0,I.ZC)(t);(0,a.useEffect)((()=>{t&&!l&&n&&o(!1)}),[t,l,n,o])}({isActive:g,collapsed:A,updateCollapsed:T}),(0,a.useEffect)((()=>{b&&null!=S&&S!==s&&E&&k(!0)}),[b,S,s,k,E]),a.createElement("li",{className:(0,o.A)(r.G.docs.docSidebarItemCategory,r.G.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":A},p)},a.createElement("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":v})},a.createElement(M.A,(0,C.A)({className:(0,o.A)("menu__link",{"menu__link--sublist":b,"menu__link--sublist-caret":!h&&b,"menu__link--active":g}),onClick:b?e=>{n?.(t),h?T(!1):(e.preventDefault(),T())}:()=>{n?.(t)},"aria-current":v?"page":void 0,"aria-expanded":b?!A:void 0,href:b?f??"#":f},d),u),h&&b&&a.createElement(P,{categoryLabel:u,onClick:e=>{e.preventDefault(),T()}})),a.createElement(y.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:A},a.createElement(K,{items:m,tabIndex:A?-1:0,onItemClick:n,activePath:l,level:c+1})))}var F=n(6654),W=n(3186);const D={menuExternalLink:"menuExternalLink_NmtK"};function V(e){let{item:t,onItemClick:n,activePath:l,level:c,index:s,...d}=e;const{href:m,label:u,className:b,autoAddBaseUrl:p}=t,h=(0,i.w8)(t,l),E=(0,F.A)(m);return a.createElement("li",{className:(0,o.A)(r.G.docs.docSidebarItemLink,r.G.docs.docSidebarItemLinkLevel(c),"menu__list-item",b),key:u},a.createElement(M.A,(0,C.A)({className:(0,o.A)("menu__link",!E&&D.menuExternalLink,{"menu__link--active":h}),autoAddBaseUrl:p,"aria-current":h?"page":void 0,to:m},E&&{onClick:n?()=>n(t):void 0},d),u,!E&&a.createElement(W.A,null)))}const U={menuHtmlItem:"menuHtmlItem_M9Kj"};function z(e){let{item:t,level:n,index:l}=e;const{value:c,defaultStyle:i,className:s}=t;return a.createElement("li",{className:(0,o.A)(r.G.docs.docSidebarItemLink,r.G.docs.docSidebarItemLinkLevel(n),i&&[U.menuHtmlItem,"menu__list-item"],s),key:l,dangerouslySetInnerHTML:{__html:c}})}function R(e){let{item:t,...n}=e;switch(t.type){case"category":return a.createElement(G,(0,C.A)({item:t},n));case"html":return a.createElement(z,(0,C.A)({item:t},n));default:return a.createElement(V,(0,C.A)({item:t},n))}}function j(e){let{items:t,...n}=e;return a.createElement(w,null,t.map(((e,t)=>a.createElement(R,(0,C.A)({key:t,item:e,index:t},n)))))}const K=(0,a.memo)(j),q={menu:"menu_SIkG",menuWithAnnouncementBar:"menuWithAnnouncementBar_GW3s"};function O(e){let{path:t,sidebar:n,className:l}=e;const c=function(){const{isActive:e}=(0,T.Mj)(),[t,n]=(0,a.useState)(e);return(0,b.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return a.createElement("nav",{"aria-label":(0,u.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.A)("menu thin-scrollbar",q.menu,c&&q.menuWithAnnouncementBar,l)},a.createElement("ul",{className:(0,o.A)(r.G.docs.docSidebarMenu,"menu__list")},a.createElement(K,{items:n,activePath:t,level:1})))}const X="sidebar_njMd",Y="sidebarWithHideableNavbar_wUlq",Z="sidebarHidden_VK0M",$="sidebarLogo_isFc";function J(e){let{path:t,sidebar:n,onCollapse:l,isHidden:r}=e;const{navbar:{hideOnScroll:c},docs:{sidebar:{hideable:i}}}=(0,_.p)();return a.createElement("div",{className:(0,o.A)(X,c&&Y,r&&Z)},c&&a.createElement(A.A,{tabIndex:-1,className:$}),a.createElement(O,{path:t,sidebar:n}),i&&a.createElement(N,{onClick:l}))}const Q=a.memo(J);var ee=n(5600),te=n(2069);const ne=e=>{let{sidebar:t,path:n}=e;const l=(0,te.M)();return a.createElement("ul",{className:(0,o.A)(r.G.docs.docSidebarMenu,"menu__list")},a.createElement(K,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&l.toggle(),"link"===e.type&&l.toggle()},level:1}))};function ae(e){return a.createElement(ee.GX,{component:ne,props:e})}const oe=a.memo(ae);function le(e){const t=(0,v.l)(),n="desktop"===t||"ssr"===t,o="mobile"===t;return a.createElement(a.Fragment,null,n&&a.createElement(Q,e),o&&a.createElement(oe,e))}const re={expandButton:"expandButton_m80_",expandButtonIcon:"expandButtonIcon_BlDH"};function ce(e){let{toggleSidebar:t}=e;return a.createElement("div",{className:re.expandButton,title:(0,u.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,u.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t},a.createElement(k,{className:re.expandButtonIcon}))}const ie={docSidebarContainer:"docSidebarContainer_b6E3",docSidebarContainerHidden:"docSidebarContainerHidden_b3ry",sidebarViewport:"sidebarViewport_Xe31"};function se(e){let{children:t}=e;const n=(0,d.t)();return a.createElement(a.Fragment,{key:n?.name??"noSidebar"},t)}function de(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:l}=e;const{pathname:c}=(0,g.zy)(),[i,s]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{i&&s(!1),!i&&(0,f.O)()&&s(!0),l((e=>!e))}),[l,i]);return a.createElement("aside",{className:(0,o.A)(r.G.docs.docSidebarContainer,ie.docSidebarContainer,n&&ie.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(ie.docSidebarContainer)&&n&&s(!0)}},a.createElement(se,null,a.createElement("div",{className:(0,o.A)(ie.sidebarViewport,i&&ie.sidebarViewportHidden)},a.createElement(le,{sidebar:t,path:c,onCollapse:d,isHidden:i}),i&&a.createElement(ce,{toggleSidebar:d}))))}const me={docMainContainer:"docMainContainer_gTbr",docMainContainerEnhanced:"docMainContainerEnhanced_Uz_u",docItemWrapperEnhanced:"docItemWrapperEnhanced_czyv"};function ue(e){let{hiddenSidebarContainer:t,children:n}=e;const l=(0,d.t)();return a.createElement("main",{className:(0,o.A)(me.docMainContainer,(t||!l)&&me.docMainContainerEnhanced)},a.createElement("div",{className:(0,o.A)("container padding-top--md padding-bottom--lg",me.docItemWrapper,t&&me.docItemWrapperEnhanced)},n))}const be={docPage:"docPage__5DB",docsWrapper:"docsWrapper_BCFX","themedComponent--light":"themedComponent--light_NU7w"};function pe(e){let{children:t}=e;const n=(0,d.t)(),[o,l]=(0,a.useState)(!1);return a.createElement(m.A,{wrapperClassName:be.docsWrapper},a.createElement(E,null),a.createElement("div",{className:be.docPage},n&&a.createElement(de,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:l}),a.createElement(ue,{hiddenSidebarContainer:o},t)))}var he=n(1774),Ee=n(1463);function fe(e){const{versionMetadata:t}=e;return a.createElement(a.Fragment,null,a.createElement(Ee.A,{version:t.version,tag:(0,c.tU)(t.pluginId,t.version)}),a.createElement(l.be,null,t.noIndex&&a.createElement("meta",{name:"robots",content:"noindex, nofollow"})))}function ge(e){const{versionMetadata:t}=e,n=(0,i.mz)(e);if(!n)return a.createElement(he.default,null);const{docElement:c,sidebarName:m,sidebarItems:u}=n;return a.createElement(a.Fragment,null,a.createElement(fe,e),a.createElement(l.e3,{className:(0,o.A)(r.G.wrapper.docsPages,r.G.page.docsDocPage,e.versionMetadata.className)},a.createElement(s.n,{version:t},a.createElement(d.V,{name:m,items:u},a.createElement(pe,null,c)))))}},1774:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(6540),o=n(1312),l=n(9024),r=n(8511);function c(){return a.createElement(a.Fragment,null,a.createElement(l.be,{title:(0,o.T)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.A,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}},2252:(e,t,n)=>{n.d(t,{n:()=>r,r:()=>c});var a=n(6540),o=n(9532);const l=a.createContext(null);function r(e){let{children:t,version:n}=e;return a.createElement(l.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(l);if(null===e)throw new o.dV("DocsVersionProvider");return e}}}]); \ No newline at end of file diff --git a/assets/js/1ca1b9c8.c508c078.js b/assets/js/1ca1b9c8.c508c078.js new file mode 100644 index 00000000000..a1b6a217bf5 --- /dev/null +++ b/assets/js/1ca1b9c8.c508c078.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[3819],{1966:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]); \ No newline at end of file diff --git a/assets/js/2222b3a9.4211f90b.js b/assets/js/2222b3a9.4211f90b.js new file mode 100644 index 00000000000..f20c17988e1 --- /dev/null +++ b/assets/js/2222b3a9.4211f90b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[1424],{5680:(e,t,r)=>{r.d(t,{xA:()=>d,yg:()=>b});var a=r(6540);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t =0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),c=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},d=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),u=c(r),m=n,b=u["".concat(s,".").concat(m)]||u[m]||p[m]||i;return r?a.createElement(b,l(l({ref:t},d),{},{components:r})):a.createElement(b,l({ref:t},d))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,l=new Array(i);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[u]="string"==typeof e?e:n,l[1]=o;for(var c=2;c{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var a=r(8168),n=(r(6540),r(5680));const i={title:"Building Gaia Deterministically",order:5},l=void 0,o={unversionedId:"resources/reproducible-builds",id:"resources/reproducible-builds",title:"Building Gaia Deterministically",description:"The Tendermint rbuilder Docker image provides a deterministic build environment that is used to build Cosmos SDK applications. It provides a way to be reasonably sure that the executables are really built from the git source. It also makes sure that the same, tested dependencies are used and statically built into the executable.",source:"@site/docs/resources/reproducible-builds.md",sourceDirName:"resources",slug:"/resources/reproducible-builds",permalink:"/main/resources/reproducible-builds",draft:!1,tags:[],version:"current",frontMatter:{title:"Building Gaia Deterministically",order:5},sidebar:"tutorialSidebar",previous:{title:"Ledger Nano Support",permalink:"/main/resources/ledger"},next:{title:"Service Providers",permalink:"/main/resources/service-providers"}},s={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Build",id:"build",level:2}],d={toc:c},u="wrapper";function p(e){let{components:t,...r}=e;return(0,n.yg)(u,(0,a.A)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("p",null,"The ",(0,n.yg)("a",{parentName:"p",href:"https://github.com/tendermint/images/tree/master/rbuilder"},"Tendermint rbuilder Docker image")," provides a deterministic build environment that is used to build Cosmos SDK applications. It provides a way to be reasonably sure that the executables are really built from the git source. It also makes sure that the same, tested dependencies are used and statically built into the executable."),(0,n.yg)("h2",{id:"prerequisites"},"Prerequisites"),(0,n.yg)("p",null,"Make sure you have ",(0,n.yg)("a",{parentName:"p",href:"https://docs.docker.com/get-docker/"},"Docker installed on your system"),"."),(0,n.yg)("p",null,"All the following instructions have been tested on ",(0,n.yg)("em",{parentName:"p"},"Ubuntu 18.04.2 LTS")," with ",(0,n.yg)("em",{parentName:"p"},"docker 20.10.2"),"."),(0,n.yg)("h2",{id:"build"},"Build"),(0,n.yg)("p",null,"Clone ",(0,n.yg)("inlineCode",{parentName:"p"},"gaia"),":"),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-sh"},"git clone https://github.com/cosmos/gaia.git\n")),(0,n.yg)("p",null,"Checkout the commit, branch, or release tag you want to build:"),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-sh"},"cd gaia/\ngit checkout v4.2.1\n")),(0,n.yg)("p",null,"The buildsystem supports and produces binaries for the following architectures:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"darwin/amd64")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"linux/amd64")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"linux/arm64")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"windows/amd64"))),(0,n.yg)("p",null,"Run the following command to launch a build for all supported architectures:"),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-sh"},"make distclean build-reproducible\n")),(0,n.yg)("p",null,"The build system generates both the binaries and deterministic build report in the ",(0,n.yg)("inlineCode",{parentName:"p"},"artifacts")," directory.\nThe ",(0,n.yg)("inlineCode",{parentName:"p"},"artifacts/build_report")," file contains the list of the build artifacts and their respective checksums, and can be used to verify\nbuild sanity. An example of its contents follows:"),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-sh"},"App: gaiad\nVersion: v4.2.1\nCommit: dbd8a6fb522c571debf958837f9113c56d418f6b\nFiles:\n 29d219b0b120b3188bd7cd7249fc96b9 gaiad-v4.2.1-darwin-amd64\n 80338d9f0e55ea8f6c93f2ec7d4e18d6 gaiad-v4.2.1-linux-amd64\n 9bc77a512acca673ca1769ae67b4d6c7 gaiad-v4.2.1-linux-arm64\n c84387860f52178e2bffee08897564bb gaiad-v4.2.1-windows-amd64.exe\n c25cca8ccceec06a6fabae90f671fab1 gaiad-v4.2.1.tar.gz\nChecksums-Sha256:\n 05e5b9064bac4e71f0162c4c3c3bff55def22ca016d34205a5520fef89fd2776 gaiad-v4.2.1-darwin-amd64\n ccda422cbda29c723aaf27653bcf0f6412e138eec33fba2b49de131f9ffbe2d2 gaiad-v4.2.1-linux-amd64\n 95f89e8213cb758d12e1b0b631285938de822d04d2e25f399e99c0b798173cfd gaiad-v4.2.1-linux-arm64\n 7ef98f0041f1573f0a8601abad4a14b1c163f47481c7ba1954fd81ed423a6408 gaiad-v4.2.1-windows-amd64.exe\n 422883ba43c96a6ea5ef9512d39321dd1356633c6a9505517b9c651788df4a7f gaiad-v4.2.1.tar.gz\n")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/25a82047.7d108c6b.js b/assets/js/25a82047.7d108c6b.js new file mode 100644 index 00000000000..6814be6b5f9 --- /dev/null +++ b/assets/js/25a82047.7d108c6b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[5098],{5680:(e,t,n)=>{n.d(t,{xA:()=>u,yg:()=>h});var r=n(6540);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t =0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=c(n),g=a,h=p["".concat(s,".").concat(g)]||p[g]||d[g]||o;return n?r.createElement(h,l(l({ref:t},u),{},{components:n})):r.createElement(h,l({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=g;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:a,l[1]=i;for(var c=2;c {n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>c});var r=n(8168),a=(n(6540),n(5680));const o={},l=void 0,i={unversionedId:"architecture/templates/adr-template",id:"architecture/templates/adr-template",title:"adr-template",description:"\x3c!--",source:"@site/docs/architecture/templates/adr-template.md",sourceDirName:"architecture/templates",slug:"/architecture/templates/adr-template",permalink:"/main/architecture/templates/adr-template",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"ADR 003: Interchain Accounts Controller Module",permalink:"/main/architecture/adr/adr-003-ica-controller"},next:{title:"ADR Creation Process",permalink:"/main/architecture/PROCESS"}},s={},c=[{value:"Changelog",id:"changelog",level:2},{value:"Status",id:"status",level:2},{value:"Abstract",id:"abstract",level:2},{value:"Context",id:"context",level:2},{value:"Decision",id:"decision",level:2},{value:"Consequences",id:"consequences",level:2},{value:"Positive",id:"positive",level:3},{value:"Negative",id:"negative",level:3},{value:"Neutral",id:"neutral",level:3},{value:"References",id:"references",level:2}],u={toc:c},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.yg)(p,(0,r.A)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"adr-adr-number-title"},"ADR {ADR-NUMBER}: {TITLE}"),(0,a.yg)("h2",{id:"changelog"},"Changelog"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"{date}: {changelog}")),(0,a.yg)("h2",{id:"status"},"Status"),(0,a.yg)("p",null,"{DRAFT | PROPOSED} Not Implemented"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Please have a look at the ",(0,a.yg)("a",{parentName:"p",href:"../adr/PROCESS#adr-status"},"PROCESS")," page.\nUse DRAFT if the ADR is in a draft stage (draft PR) or PROPOSED if it's in review.")),(0,a.yg)("h2",{id:"abstract"},"Abstract"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"\"If you can't explain it simply, you don't understand it well enough.\" Provide\na simplified and layman-accessible explanation of the ADR.\nA short (~200 word) description of the issue being addressed.")),(0,a.yg)("h2",{id:"context"},"Context"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"This section contains all the context one needs to understand the current state, and why there is a problem.\nIt should be as succinct as possible and introduce the high level idea behind the solution.\nThe language in this section is value-neutral. It is simply describing facts.")),(0,a.yg)("h2",{id:"decision"},"Decision"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"This section explains all of the details of the proposed solution, including implementation details.\nIt should also describe affects / corollary items that may need to be changed as a part of this.\nIf the proposed change will be large, please also indicate a way to do the change to maximize ease of review.\n(e.g. the optimal split of things to do between separate PR's)")),(0,a.yg)("h2",{id:"consequences"},"Consequences"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},'This section describes the consequences, after applying the decision.\nAll consequences should be summarized here, not just the "positive" ones.')),(0,a.yg)("h3",{id:"positive"},"Positive"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"{positive consequences}")),(0,a.yg)("h3",{id:"negative"},"Negative"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"{negative consequences}")),(0,a.yg)("h3",{id:"neutral"},"Neutral"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"{neutral consequences}")),(0,a.yg)("h2",{id:"references"},"References"),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Are there any relevant PR comments, issues that led up to this, or articles referenced for why we made the given design choice? If so link them here!")),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"{reference link}")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2d8dbdf9.a6290c53.js b/assets/js/2d8dbdf9.a6290c53.js new file mode 100644 index 00000000000..1ae286d5fac --- /dev/null +++ b/assets/js/2d8dbdf9.a6290c53.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[1236],{5680:(e,t,n)=>{n.d(t,{xA:()=>m,yg:()=>c});var r=n(6540);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t =0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},m=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),d=u(n),g=a,c=d["".concat(s,".").concat(g)]||d[g]||p[g]||i;return n?r.createElement(c,o(o({ref:t},m),{},{components:n})):r.createElement(c,o({ref:t},m))}));function c(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=g;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>u});var r=n(8168),a=(n(6540),n(5680));const i={title:"KMS - Key Management System",order:5},o=void 0,l={unversionedId:"validators/kms/kms",id:"validators/kms/kms",title:"KMS - Key Management System",description:"Tendermint KMS is a key management service that allows separating key management from Tendermint nodes. In addition it provides other advantages such as:",source:"@site/docs/validators/kms/kms.md",sourceDirName:"validators/kms",slug:"/validators/kms/",permalink:"/main/validators/kms/",draft:!1,tags:[],version:"current",frontMatter:{title:"KMS - Key Management System",order:5},sidebar:"tutorialSidebar",previous:{title:"Validators",permalink:"/main/validators/"},next:{title:"Setting up Tendermint KMS + Ledger",permalink:"/main/validators/kms/kms_ledger"}},s={},u=[{value:"Building",id:"building",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Using a YubiHSM",id:"using-a-yubihsm",level:3},{value:"Using a Ledger device running the Tendermint app",id:"using-a-ledger-device-running-the-tendermint-app",level:3}],m={toc:u},d="wrapper";function p(e){let{components:t,...n}=e;return(0,a.yg)(d,(0,r.A)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://github.com/iqlusioninc/tmkms"},"Tendermint KMS")," is a key management service that allows separating key management from Tendermint nodes. In addition it provides other advantages such as:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Improved security and risk management policies"),(0,a.yg)("li",{parentName:"ul"},"Unified API and support for various HSM (hardware security modules)"),(0,a.yg)("li",{parentName:"ul"},"Double signing protection (software or hardware based)")),(0,a.yg)("p",null,"It is recommended that the KMS service runs in a separate physical hosts."),(0,a.yg)("h2",{id:"building"},"Building"),(0,a.yg)("p",null,"Detailed build instructions can be found ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/iqlusioninc/tmkms#installation"},"here"),"."),(0,a.yg)("admonition",{type:"tip"},(0,a.yg)("p",{parentName:"admonition"},"When compiling the KMS, ensure you have enabled the applicable features:")),(0,a.yg)("table",null,(0,a.yg)("thead",{parentName:"table"},(0,a.yg)("tr",{parentName:"thead"},(0,a.yg)("th",{parentName:"tr",align:null},"Backend"),(0,a.yg)("th",{parentName:"tr",align:null},"Recommended Command line"))),(0,a.yg)("tbody",{parentName:"table"},(0,a.yg)("tr",{parentName:"tbody"},(0,a.yg)("td",{parentName:"tr",align:null},"YubiHSM"),(0,a.yg)("td",{parentName:"tr",align:null},(0,a.yg)("inlineCode",{parentName:"td"},"cargo build --features yubihsm"))),(0,a.yg)("tr",{parentName:"tbody"},(0,a.yg)("td",{parentName:"tr",align:null},"Ledger+Tendermint App"),(0,a.yg)("td",{parentName:"tr",align:null},(0,a.yg)("inlineCode",{parentName:"td"},"cargo build --features ledgertm"))))),(0,a.yg)("h2",{id:"configuration"},"Configuration"),(0,a.yg)("p",null,"A KMS can be configured in various ways:"),(0,a.yg)("h3",{id:"using-a-yubihsm"},"Using a YubiHSM"),(0,a.yg)("p",null," Detailed information on how to setup a KMS with YubiHSM2 can be found ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/iqlusioninc/tmkms/blob/master/README.yubihsm.md"},"here")),(0,a.yg)("h3",{id:"using-a-ledger-device-running-the-tendermint-app"},"Using a Ledger device running the Tendermint app"),(0,a.yg)("p",null," Detailed information on how to setup a KMS with Ledger Tendermint App can be found ",(0,a.yg)("a",{parentName:"p",href:"/main/validators/kms/kms_ledger"},"here")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2dd09b7f.cbaaf380.js b/assets/js/2dd09b7f.cbaaf380.js new file mode 100644 index 00000000000..708d9024aba --- /dev/null +++ b/assets/js/2dd09b7f.cbaaf380.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[4731],{5680:(e,a,n)=>{n.d(a,{xA:()=>d,yg:()=>c});var t=n(6540);function o(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var a=1;a =0||(o[n]=e[n]);return o}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=t.createContext({}),g=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):r(r({},a),e)),n},d=function(e){var a=g(e.components);return t.createElement(s.Provider,{value:a},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},y=t.forwardRef((function(e,a){var n=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),u=g(n),y=o,c=u["".concat(s,".").concat(y)]||u[y]||p[y]||i;return n?t.createElement(c,r(r({ref:a},d),{},{components:n})):t.createElement(c,r({ref:a},d))}));function c(e,a){var n=arguments,o=a&&a.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=y;var l={};for(var s in a)hasOwnProperty.call(a,s)&&(l[s]=a[s]);l.originalType=e,l[u]="string"==typeof e?e:o,r[1]=l;for(var g=2;g{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>g});var t=n(8168),o=(n(6540),n(5680));const i={title:"Interacting with Gaiad (CLI)",order:5},r=void 0,l={unversionedId:"hub-tutorials/gaiad",id:"hub-tutorials/gaiad",title:"Interacting with Gaiad (CLI)",description:"Gaia Daemon",source:"@site/docs/hub-tutorials/gaiad.md",sourceDirName:"hub-tutorials",slug:"/hub-tutorials/gaiad",permalink:"/main/hub-tutorials/gaiad",draft:!1,tags:[],version:"current",frontMatter:{title:"Interacting with Gaiad (CLI)",order:5},sidebar:"tutorialSidebar",previous:{title:"Gaia Tutorials",permalink:"/main/hub-tutorials/"},next:{title:"Joining Mainnet",permalink:"/main/hub-tutorials/join-mainnet"}},s={},g=[{value:"Gaia Daemon",id:"gaia-daemon",level:2},{value:"Setting up gaiad",id:"setting-up-gaiad",level:3},{value:"Keys",id:"keys",level:3},{value:"Keyring",id:"keyring",level:4},{value:"Key Types",id:"key-types",level:4},{value:"Migrate Keys From Legacy On-Disk Keybase To OS Built-in Secret Store",id:"migrate-keys-from-legacy-on-disk-keybase-to-os-built-in-secret-store",level:4},{value:"Generate Keys",id:"generate-keys",level:4},{value:"Generate Multisig Public Keys",id:"generate-multisig-public-keys",level:4},{value:"Tx Broadcasting",id:"tx-broadcasting",level:3},{value:"Fees & Gas",id:"fees--gas",level:3},{value:"Account",id:"account",level:3},{value:"Get Tokens",id:"get-tokens",level:4},{value:"Query Account Balance",id:"query-account-balance",level:4},{value:"Send Tokens",id:"send-tokens",level:3},{value:"Query Transactions",id:"query-transactions",level:3},{value:"Matching a Set of Events",id:"matching-a-set-of-events",level:4},{value:"Matching a Transaction's Hash",id:"matching-a-transactions-hash",level:4},{value:"Slashing",id:"slashing",level:3},{value:"Unjailing",id:"unjailing",level:4},{value:"Signing Info",id:"signing-info",level:4},{value:"Query Parameters",id:"query-parameters",level:4},{value:"Minting",id:"minting",level:3},{value:"Staking",id:"staking",level:3},{value:"Set up a Validator",id:"set-up-a-validator",level:4},{value:"Delegate to a Validator",id:"delegate-to-a-validator",level:4},{value:"Query Validators",id:"query-validators",level:5},{value:"Bond Tokens",id:"bond-tokens",level:4},{value:"Query Delegations",id:"query-delegations",level:5},{value:"Unbond Tokens",id:"unbond-tokens",level:4},{value:"Query Unbonding-Delegations",id:"query-unbonding-delegations",level:5},{value:"Redelegate Tokens",id:"redelegate-tokens",level:4},{value:"Query Redelegations",id:"query-redelegations",level:5},{value:"Query Parameters",id:"query-parameters-1",level:4},{value:"Query Pool",id:"query-pool",level:4},{value:"Query Delegations To Validator",id:"query-delegations-to-validator",level:5},{value:"Governance",id:"governance",level:3},{value:"Create a Governance Proposal",id:"create-a-governance-proposal",level:4},{value:"Query Proposals",id:"query-proposals",level:5},{value:"Increase Deposit",id:"increase-deposit",level:4},{value:"Query Deposits",id:"query-deposits",level:5},{value:"Vote on a Proposal",id:"vote-on-a-proposal",level:4},{value:"Query Votes",id:"query-votes",level:5},{value:"Query proposal tally results",id:"query-proposal-tally-results",level:4},{value:"Query Governance Parameters",id:"query-governance-parameters",level:4},{value:"Fee Distribution",id:"fee-distribution",level:3},{value:"Query Distribution Parameters",id:"query-distribution-parameters",level:4},{value:"Query distribution Community Pool",id:"query-distribution-community-pool",level:4},{value:"Query outstanding rewards",id:"query-outstanding-rewards",level:4},{value:"Query Validator Commission",id:"query-validator-commission",level:4},{value:"Query Validator Slashes",id:"query-validator-slashes",level:4},{value:"Query Delegator Rewards",id:"query-delegator-rewards",level:4},{value:"Query All Delegator Rewards",id:"query-all-delegator-rewards",level:4},{value:"Multisig Transactions",id:"multisig-transactions",level:3},{value:"Shells Completion Scripts",id:"shells-completion-scripts",level:2}],d={toc:g},u="wrapper";function p(e){let{components:a,...n}=e;return(0,o.yg)(u,(0,t.A)({},d,n,{components:a,mdxType:"MDXLayout"}),(0,o.yg)("h2",{id:"gaia-daemon"},"Gaia Daemon"),(0,o.yg)("p",null,(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," is the tool that enables you to interact with the node that runs on the Cosmos Hub network, whether you run it yourself or not. Let us set it up properly. In order to install it, follow the ",(0,o.yg)("a",{parentName:"p",href:"../getting-started/installation"},"installation procedure"),"."),(0,o.yg)("h3",{id:"setting-up-gaiad"},"Setting up gaiad"),(0,o.yg)("p",null,"The main command used to set up ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," is the following:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad config \n")),(0,o.yg)("p",null,"It allows you to set a default value for each given flag."),(0,o.yg)("p",null,"First, set up the address of the full-node you want to connect to:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad config node : \n\n# example: gaiad config node https://77.87.106.33:26657\n")),(0,o.yg)("p",null,"If you run your own full-node, just use ",(0,o.yg)("inlineCode",{parentName:"p"},"tcp://localhost:26657")," as the address."),(0,o.yg)("p",null,"Finally, let us set the ",(0,o.yg)("inlineCode",{parentName:"p"},"chain-id")," of the blockchain we want to interact with:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad config chain-id cosmoshub-2\n")),(0,o.yg)("h3",{id:"keys"},"Keys"),(0,o.yg)("h4",{id:"keyring"},"Keyring"),(0,o.yg)("p",null,'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.'),(0,o.yg)("p",null,"Headless environments are recommended to use either the ",(0,o.yg)("inlineCode",{parentName:"p"},"file")," or ",(0,o.yg)("inlineCode",{parentName:"p"},"pass")," backends. More information is available at the ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/v0.47/user/run-node/keyring"},"SDK documentation page"),"."),(0,o.yg)("h4",{id:"key-types"},"Key Types"),(0,o.yg)("p",null,"There are three types of key representations that are used:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("p",{parentName:"li"},(0,o.yg)("inlineCode",{parentName:"p"},"cosmos")),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},"Derived from account keys generated by ",(0,o.yg)("inlineCode",{parentName:"li"},"gaiad keys add")),(0,o.yg)("li",{parentName:"ul"},"Used to receive funds"),(0,o.yg)("li",{parentName:"ul"},"e.g. ",(0,o.yg)("inlineCode",{parentName:"li"},"cosmos15h6vd5f0wqps26zjlwrc6chah08ryu4hzzdwhc")))),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("p",{parentName:"li"},(0,o.yg)("inlineCode",{parentName:"p"},"cosmosvaloper")),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},"Used to associate a validator to its operator"),(0,o.yg)("li",{parentName:"ul"},"Used to invoke staking commands"),(0,o.yg)("li",{parentName:"ul"},"e.g. ",(0,o.yg)("inlineCode",{parentName:"li"},"cosmosvaloper1carzvgq3e6y3z5kz5y6gxp3wpy3qdrv928vyah")))),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("p",{parentName:"li"},(0,o.yg)("inlineCode",{parentName:"p"},"cosmospub")),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},"Derived from account keys generated by ",(0,o.yg)("inlineCode",{parentName:"li"},"gaiad keys add")),(0,o.yg)("li",{parentName:"ul"},"e.g. ",(0,o.yg)("inlineCode",{parentName:"li"},"cosmospub1zcjduc3q7fu03jnlu2xpl75s2nkt7krm6grh4cc5aqth73v0zwmea25wj2hsqhlqzm")))),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("p",{parentName:"li"},(0,o.yg)("inlineCode",{parentName:"p"},"cosmosvalconspub")),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},"Generated when the node is created with ",(0,o.yg)("inlineCode",{parentName:"li"},"gaiad init"),"."),(0,o.yg)("li",{parentName:"ul"},"Get this value with ",(0,o.yg)("inlineCode",{parentName:"li"},"gaiad tendermint show-validator")),(0,o.yg)("li",{parentName:"ul"},"e.g. ",(0,o.yg)("inlineCode",{parentName:"li"},"cosmosvalconspub1zcjduepq0ms2738680y72v44tfyqm3c9ppduku8fs6sr73fx7m666sjztznqzp2emf"))))),(0,o.yg)("h4",{id:"migrate-keys-from-legacy-on-disk-keybase-to-os-built-in-secret-store"},"Migrate Keys From Legacy On-Disk Keybase To OS Built-in Secret Store"),(0,o.yg)("p",null,"Older versions of ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," used store keys in the user's home directory. If you are migrating\nfrom an old version of ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," you will need to migrate your old keys into your operating system's\ncredentials storage by running the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys migrate\n")),(0,o.yg)("p",null,"The command will prompt for every passphrase. If a passphrase is incorrect, it will skip the\nrespective key."),(0,o.yg)("h4",{id:"generate-keys"},"Generate Keys"),(0,o.yg)("p",null,"You'll need an account private and public key pair ","(","a.k.a. ",(0,o.yg)("inlineCode",{parentName:"p"},"sk, pk")," respectively",")"," to be able to receive funds, send txs, bond tx, etc."),(0,o.yg)("p",null,"To generate a new ",(0,o.yg)("em",{parentName:"p"},"secp256k1")," key:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add \n")),(0,o.yg)("p",null,"The output of the above command will contain a ",(0,o.yg)("em",{parentName:"p"},"seed phrase"),". It is recommended to save the ",(0,o.yg)("em",{parentName:"p"},"seed\nphrase")," in a safe place so that in case you forget the password of the operating system's\ncredentials store, you could eventually regenerate the key from the seed phrase with the\nfollowing command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add --recover\n")),(0,o.yg)("p",null,"If you check your private keys, you'll now see ",(0,o.yg)("inlineCode",{parentName:"p"}," "),":"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show \n")),(0,o.yg)("p",null,"View the validator operator's address via:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show --bech=val\n")),(0,o.yg)("p",null,"You can see all your available keys by typing:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys list\n")),(0,o.yg)("p",null,"View the validator pubkey for your node by typing:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tendermint show-validator\n")),(0,o.yg)("p",null,"Note that this is the Tendermint signing key, ",(0,o.yg)("em",{parentName:"p"},"not")," the operator key you will use in delegation transactions."),(0,o.yg)("div",{class:"theme-doc-version-banner alert alert--warning margin-bottom--md",role:"alert"},"We strongly recommend _NOT_ using the same passphrase for multiple keys. The CometBFT team and the Interchain Foundation will not be responsible for the loss of funds."),(0,o.yg)("h4",{id:"generate-multisig-public-keys"},"Generate Multisig Public Keys"),(0,o.yg)("p",null,"You can generate and print a multisig public key by typing:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add --multisig=name1,name2,name3[...] --multisig-threshold=K new_key_name\n")),(0,o.yg)("p",null,(0,o.yg)("inlineCode",{parentName:"p"},"K")," is the minimum number of private keys that must have signed the\ntransactions that carry the public key's address as signer."),(0,o.yg)("p",null,"The ",(0,o.yg)("inlineCode",{parentName:"p"},"--multisig")," flag must contain the name of public keys that will be combined into a\npublic key that will be generated and stored as ",(0,o.yg)("inlineCode",{parentName:"p"},"new_key_name")," in the local database.\nAll names supplied through ",(0,o.yg)("inlineCode",{parentName:"p"},"--multisig")," must already exist in the local database. Unless\nthe flag ",(0,o.yg)("inlineCode",{parentName:"p"},"--nosort")," is set, the order in which the keys are supplied on the command line\ndoes not matter, i.e. the following commands generate two identical keys:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add --multisig=foo,bar,baz --multisig-threshold=2 multisig_address\ngaiad keys add --multisig=baz,foo,bar --multisig-threshold=2 multisig_address\n")),(0,o.yg)("p",null,"Multisig addresses can also be generated on-the-fly and printed through the which command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show --multisig-threshold K name1 name2 name3 [...]\n")),(0,o.yg)("p",null,"For more information regarding how to generate, sign and broadcast transactions with a\nmulti signature account see ",(0,o.yg)("a",{parentName:"p",href:"#multisig-transactions"},"Multisig Transactions"),"."),(0,o.yg)("h3",{id:"tx-broadcasting"},"Tx Broadcasting"),(0,o.yg)("p",null,"When broadcasting transactions, ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," accepts a ",(0,o.yg)("inlineCode",{parentName:"p"},"--broadcast-mode")," flag. This\nflag can have a value of ",(0,o.yg)("inlineCode",{parentName:"p"},"sync")," (default), ",(0,o.yg)("inlineCode",{parentName:"p"},"async"),", or ",(0,o.yg)("inlineCode",{parentName:"p"},"block"),", where ",(0,o.yg)("inlineCode",{parentName:"p"},"sync")," makes\nthe client return a CheckTx response, ",(0,o.yg)("inlineCode",{parentName:"p"},"async")," makes the client return immediately,\nand ",(0,o.yg)("inlineCode",{parentName:"p"},"block")," makes the client wait for the tx to be committed (or timing out)."),(0,o.yg)("p",null,"It is important to note that the ",(0,o.yg)("inlineCode",{parentName:"p"},"block")," mode should ",(0,o.yg)("strong",{parentName:"p"},"not")," be used in most\ncircumstances. This is because broadcasting can timeout but the tx may still be\nincluded in a block. This can result in many undesirable situations. Therefore, it\nis best to use ",(0,o.yg)("inlineCode",{parentName:"p"},"sync")," or ",(0,o.yg)("inlineCode",{parentName:"p"},"async")," and query by tx hash to determine when the tx\nis included in a block."),(0,o.yg)("h3",{id:"fees--gas"},"Fees & Gas"),(0,o.yg)("p",null,"The Cosmos Hub uses the ",(0,o.yg)("inlineCode",{parentName:"p"},"x/feemarket")," module to\ndynamically vary the gas price based on demand."),(0,o.yg)("p",null,"You need to specify a sufficient gas price or total fees\nto ensure that your transaction is included in a block,\ne.g."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send ... --fees=50000uatom\n")),(0,o.yg)("p",null,"or"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send ... --gas-prices=0.0025uatom\n")),(0,o.yg)("p",null,"To find out more about the current minimal gas price, you can query the feemarket module:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad q feemarket gas-prices\n")),(0,o.yg)("p",null,"or"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad q feemarket gas-prices uatom\n")),(0,o.yg)("p",null,"which will output the current gas price similar to this:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'price: \n amount: "0.005" \n denom: uatom \n')),(0,o.yg)("p",null,"For more information, check out how to query the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/skip-mev/feemarket/blob/main/docs/SPEC.md#gas-price"},"feemarket"),",\nor check out the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/skip-mev/feemarket/blob/main/docs/INTEGRATIONS.md"},"feemarket integration guide"),"."),(0,o.yg)("h3",{id:"account"},"Account"),(0,o.yg)("h4",{id:"get-tokens"},"Get Tokens"),(0,o.yg)("p",null,"On a testnet, getting tokens is usually done via a faucet."),(0,o.yg)("h4",{id:"query-account-balance"},"Query Account Balance"),(0,o.yg)("p",null,"After receiving tokens to your address, you can view your account's balance by typing:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query account account_cosmos\n")),(0,o.yg)("admonition",{title:"Note",type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"When you query an account balance with zero tokens, you will get this error: ",(0,o.yg)("inlineCode",{parentName:"p"},"No account with address was found in the state.")," This can also happen if you fund the account before your node has fully synced with the chain. These are both normal.")),(0,o.yg)("h3",{id:"send-tokens"},"Send Tokens"),(0,o.yg)("p",null,"The following command could be used to send coins from one account to another:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send sender_key_name_or_address recipient_address 10faucetToken \\\n --chain-id=chain_id\n")),(0,o.yg)("div",{class:"theme-doc-version-banner alert alert--warning margin-bottom--md",role:"alert"},"The `amount` argument accepts the format `value|coin_name`."),(0,o.yg)("div",{class:"theme-doc-version-banner info alert--warning margin-bottom--md",role:"info"},"You may want to cap the maximum gas that can be consumed by the transaction via the `--gas` flag. If you pass `--gas=auto`, the gas supply will be automatically estimated before executing the transaction. Gas estimate might be inaccurate as state changes could occur in between the end of the simulation and the actual execution of a transaction, thus an adjustment is applied on top of the original estimate in order to ensure the transaction is broadcasted successfully. The adjustment can be controlled via the `--gas-adjustment` flag, whose default value is 1.0."),(0,o.yg)("p",null,"Now, view the updated balances of the origin and destination accounts:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query account account_cosmos\ngaiad query account destination_cosmos\n")),(0,o.yg)("p",null,"You can also check your balance at a given block by using the ",(0,o.yg)("inlineCode",{parentName:"p"},"--block")," flag:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query account account_cosmos --block= \n")),(0,o.yg)("p",null,"You can simulate a transaction without actually broadcasting it by appending the\n",(0,o.yg)("inlineCode",{parentName:"p"},"--dry-run")," flag to the command line:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send 10faucetToken \\\n --chain-id= \\\n --dry-run\n")),(0,o.yg)("p",null,"Furthermore, you can build a transaction and print its JSON format to STDOUT by\nappending ",(0,o.yg)("inlineCode",{parentName:"p"},"--generate-only")," to the list of the command line arguments:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send 10faucetToken \\\n --chain-id= \\\n --generate-only > unsignedSendTx.json\n")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx sign \\\n --chain-id= \\\n --from= \\\n unsignedSendTx.json > signedSendTx.json\n")),(0,o.yg)("div",{class:"theme-doc-version-banner info alert--warning margin-bottom--md",role:"info"},"The `--generate-only` flag prevents `gaiad` from accessing the local keybase. Thus when such flag is supplied `sender_key_name_or_address` must be an address."),(0,o.yg)("p",null,"You can validate the transaction's signatures by typing the following:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx sign --validate-signatures signedSendTx.json\n")),(0,o.yg)("p",null,"You can broadcast the signed transaction to a node by providing the JSON file to the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx broadcast --node= signedSendTx.json\n")),(0,o.yg)("h3",{id:"query-transactions"},"Query Transactions"),(0,o.yg)("h4",{id:"matching-a-set-of-events"},"Matching a Set of Events"),(0,o.yg)("p",null,"You can use the transaction search command to query for transactions that match a\nspecific set of ",(0,o.yg)("inlineCode",{parentName:"p"},"events"),", which are added on every transaction."),(0,o.yg)("p",null,"Each event is composed by a key-value pair in the form of ",(0,o.yg)("inlineCode",{parentName:"p"},"{eventType}.{eventAttribute}={value}"),".\nEvents can also be combined to query for a more specific result using the ",(0,o.yg)("inlineCode",{parentName:"p"},"&")," symbol."),(0,o.yg)("p",null,"You can query transactions by ",(0,o.yg)("inlineCode",{parentName:"p"},"events")," as follows:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query txs --events='message.sender=cosmos1...'\n")),(0,o.yg)("p",null,"And for using multiple ",(0,o.yg)("inlineCode",{parentName:"p"},"events"),":"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query txs --events='message.sender=cosmos1...&message.action=withdraw_delegator_reward'\n")),(0,o.yg)("p",null,"The pagination is supported as well via ",(0,o.yg)("inlineCode",{parentName:"p"},"page")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"limit"),":"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query txs --events='message.sender=cosmos1...' --page=1 --limit=20\n")),(0,o.yg)("div",{class:"theme-doc-version-banner info alert--warning margin-bottom--md",role:"info"},"The action tag always equals the message type returned by the `Type()` function of the relevant message."),(0,o.yg)("p",null,"You can find a list of available ",(0,o.yg)("inlineCode",{parentName:"p"},"events")," on each of the SDK modules:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/cosmos-sdk/tree/main/x/staking#events"},"Staking events")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/cosmos-sdk/tree/main/x/gov#events"},"Governance events")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/cosmos-sdk/tree/main/x/slashing#events"},"Slashing events")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/cosmos-sdk/tree/main/x/distribution#events"},"Distribution events")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/cosmos-sdk/tree/main/x/bank#events"},"Bank events"))),(0,o.yg)("h4",{id:"matching-a-transactions-hash"},"Matching a Transaction's Hash"),(0,o.yg)("p",null,"You can also query a single transaction by its hash using the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query tx [hash]\n")),(0,o.yg)("h3",{id:"slashing"},"Slashing"),(0,o.yg)("h4",{id:"unjailing"},"Unjailing"),(0,o.yg)("p",null,"To unjail your jailed validator"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx slashing unjail --from \n")),(0,o.yg)("h4",{id:"signing-info"},"Signing Info"),(0,o.yg)("p",null,"To retrieve a validator's signing info:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query slashing signing-info \n")),(0,o.yg)("h4",{id:"query-parameters"},"Query Parameters"),(0,o.yg)("p",null,"You can get the current slashing parameters via:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query slashing params\n")),(0,o.yg)("h3",{id:"minting"},"Minting"),(0,o.yg)("p",null,"You can query for the minting/inflation parameters via:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query mint params\n")),(0,o.yg)("p",null,"To query for the current inflation value:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query mint inflation\n")),(0,o.yg)("p",null,"To query for the current annual provisions value:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query mint annual-provisions\n")),(0,o.yg)("h3",{id:"staking"},"Staking"),(0,o.yg)("h4",{id:"set-up-a-validator"},"Set up a Validator"),(0,o.yg)("p",null,"Please refer to the ",(0,o.yg)("a",{parentName:"p",href:"/main/validators/validator-setup"},"Validator Setup")," section for a more complete guide on how to set up a validator-candidate."),(0,o.yg)("h4",{id:"delegate-to-a-validator"},"Delegate to a Validator"),(0,o.yg)("p",null,"On the upcoming mainnet, you can delegate ",(0,o.yg)("inlineCode",{parentName:"p"},"atom")," to a validator. These ",(0,o.yg)("a",{parentName:"p",href:"/main/delegators/delegator-faq"},"delegators")," can receive part of the validator's fee revenue. Read more about the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/cosmos/raw/master/Cosmos_Token_Model.pdf"},"Cosmos Token Model"),"."),(0,o.yg)("h5",{id:"query-validators"},"Query Validators"),(0,o.yg)("p",null,"You can query the list of all validators of a specific chain:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking validators\n")),(0,o.yg)("p",null,"If you want to get the information of a single validator you can check it with:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking validator \n")),(0,o.yg)("h4",{id:"bond-tokens"},"Bond Tokens"),(0,o.yg)("p",null,"On the Cosmos Hub mainnet, we delegate ",(0,o.yg)("inlineCode",{parentName:"p"},"uatom"),", where ",(0,o.yg)("inlineCode",{parentName:"p"},"1atom = 1000000uatom"),". Here's how you can bond tokens to a testnet validator (",(0,o.yg)("em",{parentName:"p"},"i.e.")," delegate):"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx staking delegate \\\n --amount=10000000uatom \\\n --validator= \\\n --from= \\\n --chain-id= \n")),(0,o.yg)("p",null,(0,o.yg)("inlineCode",{parentName:"p"}," ")," is the operator address of the validator to which you intend to delegate. If you are running a local testnet, you can find this with:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show [name] --bech val\n")),(0,o.yg)("p",null,"where ",(0,o.yg)("inlineCode",{parentName:"p"},"[name]")," is the name of the key you specified when you initialized ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad"),"."),(0,o.yg)("p",null,"While tokens are bonded, they are pooled with all the other bonded tokens in the network. Validators and delegators obtain a percentage of shares that equal their stake in this pool."),(0,o.yg)("h5",{id:"query-delegations"},"Query Delegations"),(0,o.yg)("p",null,"Once submitted a delegation to a validator, you can see its information by using the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking delegation \n")),(0,o.yg)("p",null,"Or if you want to check all your current delegations with distinct validators:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking delegations \n")),(0,o.yg)("h4",{id:"unbond-tokens"},"Unbond Tokens"),(0,o.yg)("p",null,"If for any reason the validator misbehaves, or you just want to unbond a certain\namount of tokens, use the following command."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx staking unbond \\\n \\\n 10atom \\\n --from= \\\n --chain-id= \n")),(0,o.yg)("p",null,"The unbonding will be automatically completed when the unbonding period has passed."),(0,o.yg)("h5",{id:"query-unbonding-delegations"},"Query Unbonding-Delegations"),(0,o.yg)("p",null,"Once you begin an unbonding-delegation, you can see it's information by using the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking unbonding-delegation \n")),(0,o.yg)("p",null,"Or if you want to check all your current unbonding-delegations with distinct validators:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking unbonding-delegations \n")),(0,o.yg)("p",null,"Additionally, as you can get all the unbonding-delegations from a particular validator:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking unbonding-delegations-from \n")),(0,o.yg)("h4",{id:"redelegate-tokens"},"Redelegate Tokens"),(0,o.yg)("p",null,"A redelegation is a type delegation that allows you to bond illiquid tokens from one validator to another:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx staking redelegate \\\n \\\n \\\n 10atom \\\n --from= \\\n --chain-id= \n")),(0,o.yg)("p",null,"Here you can also redelegate a specific ",(0,o.yg)("inlineCode",{parentName:"p"},"shares-amount")," or a ",(0,o.yg)("inlineCode",{parentName:"p"},"shares-fraction")," with the corresponding flags."),(0,o.yg)("p",null,"The redelegation will be automatically completed when the unbonding period has passed."),(0,o.yg)("h5",{id:"query-redelegations"},"Query Redelegations"),(0,o.yg)("p",null,"Once you begin a redelegation, you can see its information by using the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking redelegation \n")),(0,o.yg)("p",null,"Or if you want to check all your current unbonding-delegations with distinct validators:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking redelegations \n")),(0,o.yg)("p",null,"Additionally, as you can get all the outgoing redelegations from a particular validator:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"}," gaiad query staking redelegations-from \n")),(0,o.yg)("h4",{id:"query-parameters-1"},"Query Parameters"),(0,o.yg)("p",null,"Parameters define high level settings for staking. You can get the current values by using:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking params\n")),(0,o.yg)("p",null,"With the above command you will get the values for:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Unbonding time"),(0,o.yg)("li",{parentName:"ul"},"Maximum numbers of validators"),(0,o.yg)("li",{parentName:"ul"},"Coin denomination for staking")),(0,o.yg)("p",null,"All these values will be subject to updates through a ",(0,o.yg)("inlineCode",{parentName:"p"},"governance")," process by ",(0,o.yg)("inlineCode",{parentName:"p"},"ParameterChange")," proposals."),(0,o.yg)("h4",{id:"query-pool"},"Query Pool"),(0,o.yg)("p",null,"A staking ",(0,o.yg)("inlineCode",{parentName:"p"},"Pool")," defines the dynamic parameters of the current state. You can query them with the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking pool\n")),(0,o.yg)("p",null,"With the ",(0,o.yg)("inlineCode",{parentName:"p"},"pool")," command you will get the values for:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Not-bonded and bonded tokens"),(0,o.yg)("li",{parentName:"ul"},"Token supply"),(0,o.yg)("li",{parentName:"ul"},"Current annual inflation and the block in which the last inflation was processed"),(0,o.yg)("li",{parentName:"ul"},"Last recorded bonded shares")),(0,o.yg)("h5",{id:"query-delegations-to-validator"},"Query Delegations To Validator"),(0,o.yg)("p",null,"You can also query all of the delegations to a particular validator:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"}," gaiad query delegations-to \n")),(0,o.yg)("h3",{id:"governance"},"Governance"),(0,o.yg)("p",null,"Governance is the process from which users in the Cosmos Hub can come to consensus\non software upgrades, parameters of the mainnet or signaling mechanisms through\ntext proposals. This is done through voting on proposals, which will be submitted\nby ",(0,o.yg)("inlineCode",{parentName:"p"},"ATOM")," holders on the mainnet."),(0,o.yg)("p",null,"Some considerations about the voting process:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Voting is done by bonded ",(0,o.yg)("inlineCode",{parentName:"li"},"ATOM")," holders on a 1 bonded ",(0,o.yg)("inlineCode",{parentName:"li"},"ATOM")," 1 vote basis"),(0,o.yg)("li",{parentName:"ul"},"Delegators inherit the vote of their validator if they don't vote"),(0,o.yg)("li",{parentName:"ul"},"Votes are tallied at the end of the voting period (2 weeks on mainnet) where\neach address can vote multiple times to update its ",(0,o.yg)("inlineCode",{parentName:"li"},"Option")," value (paying the transaction fee each time),\nonly the most recently cast vote will count as valid"),(0,o.yg)("li",{parentName:"ul"},"Voters can choose between options ",(0,o.yg)("inlineCode",{parentName:"li"},"Yes"),", ",(0,o.yg)("inlineCode",{parentName:"li"},"No"),", ",(0,o.yg)("inlineCode",{parentName:"li"},"NoWithVeto")," and ",(0,o.yg)("inlineCode",{parentName:"li"},"Abstain")),(0,o.yg)("li",{parentName:"ul"},"At the end of the voting period, a proposal is accepted iff:",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"(YesVotes / (YesVotes+NoVotes+NoWithVetoVotes)) > 1/2")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"(NoWithVetoVotes / (YesVotes+NoVotes+NoWithVetoVotes)) < 1/3")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"((YesVotes+NoVotes+NoWithVetoVotes) / totalBondedStake) >= quorum"))))),(0,o.yg)("p",null,"For more information about the governance process and how it works, please check\nout the Governance module ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/cosmos-sdk/tree/main/x/gov#xgov"},"specification"),"."),(0,o.yg)("h4",{id:"create-a-governance-proposal"},"Create a Governance Proposal"),(0,o.yg)("p",null,"In order to create a governance proposal, you must submit an initial deposit\nalong with a title and description. Various modules outside of governance may\nimplement their own proposal types and handlers (eg. parameter changes), where\nthe governance module itself supports ",(0,o.yg)("inlineCode",{parentName:"p"},"Text")," proposals. Any module\noutside of governance has its command mounted on top of ",(0,o.yg)("inlineCode",{parentName:"p"},"submit-proposal"),"."),(0,o.yg)("p",null,"To submit a ",(0,o.yg)("inlineCode",{parentName:"p"},"Text")," proposal:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'gaiad tx gov submit-proposal \\\n --title= \\\n --description= \\\n --type="Text" \\\n --deposit="1000000uatom" \\\n --from= \\\n --chain-id= \n')),(0,o.yg)("p",null,"You may also provide the proposal directly through the ",(0,o.yg)("inlineCode",{parentName:"p"},"--proposal")," flag which\npoints to a JSON file containing the proposal."),(0,o.yg)("p",null,"To submit a parameter change proposal, you must provide a proposal file as its\ncontents are less friendly to CLI input:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx gov submit-proposal param-change \\\n --from= \\\n --chain-id= \n")),(0,o.yg)("p",null,"Where ",(0,o.yg)("inlineCode",{parentName:"p"},"proposal.json")," contains the following:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-json"},'{\n "title": "Param Change",\n "description": "Update max validators",\n "changes": [\n {\n "subspace": "staking",\n "key": "MaxValidators",\n "value": 105\n }\n ],\n "deposit": [\n {\n "denom": "stake",\n "amount": "10000000"\n }\n ]\n}\n')),(0,o.yg)("div",{class:"theme-doc-version-banner info alert--warning margin-bottom--md",role:"info"},"Currently parameter changes are _evaluated_ but not _validated_, so it is very important that any `value` change is valid (ie. correct type and within bounds) for its respective parameter, eg. `MaxValidators` should be an integer and not a decimal.",(0,o.yg)("p",null,"Proper vetting of a parameter change proposal should prevent this from happening\n(no deposits should occur during the governance process), but it should be noted\nregardless.")),(0,o.yg)("div",{class:"theme-doc-version-banner info alert--warning margin-bottom--md",role:"info"},"The `SoftwareUpgrade` is currently not supported as it's not implemented and currently does not differ from the semantics of a `Text` proposal."),(0,o.yg)("h5",{id:"query-proposals"},"Query Proposals"),(0,o.yg)("p",null,"Once created, you can now query information of the proposal:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov proposal \n")),(0,o.yg)("p",null,"Or query all available proposals:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov proposals\n")),(0,o.yg)("p",null,"You can also query proposals filtered by ",(0,o.yg)("inlineCode",{parentName:"p"},"voter")," or ",(0,o.yg)("inlineCode",{parentName:"p"},"depositor")," by using the corresponding flags."),(0,o.yg)("p",null,"To query for the proposer of a given governance proposal:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov proposer \n")),(0,o.yg)("h4",{id:"increase-deposit"},"Increase Deposit"),(0,o.yg)("p",null,"In order for a proposal to be broadcasted to the network, the amount deposited must be above a ",(0,o.yg)("inlineCode",{parentName:"p"},"minDeposit")," value (initial value: ",(0,o.yg)("inlineCode",{parentName:"p"},"512000000uatom"),"). If the proposal you previously created didn't meet this requirement, you can still increase the total amount deposited to activate it. Once the minimum deposit is reached, the proposal enters voting period:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'gaiad tx gov deposit "10000000uatom" \\\n --from= \\\n --chain-id= \n')),(0,o.yg)("p",null,(0,o.yg)("em",{parentName:"p"},"NOTE"),": Proposals that don't meet this requirement will be deleted after ",(0,o.yg)("inlineCode",{parentName:"p"},"MaxDepositPeriod")," is reached."),(0,o.yg)("h5",{id:"query-deposits"},"Query Deposits"),(0,o.yg)("p",null,"Once a new proposal is created, you can query all the deposits submitted to it:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov deposits \n")),(0,o.yg)("p",null,"You can also query a deposit submitted by a specific address:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov deposit \n")),(0,o.yg)("h4",{id:"vote-on-a-proposal"},"Vote on a Proposal"),(0,o.yg)("p",null,"After a proposal's deposit reaches the ",(0,o.yg)("inlineCode",{parentName:"p"},"MinDeposit")," value, the voting period opens. Bonded ",(0,o.yg)("inlineCode",{parentName:"p"},"Atom")," holders can then cast vote on it:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx gov vote \\\n --from= \\\n --chain-id= \n")),(0,o.yg)("h5",{id:"query-votes"},"Query Votes"),(0,o.yg)("p",null,"Check the vote with the option you just submitted:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov vote \n")),(0,o.yg)("p",null,"You can also get all the previous votes submitted to the proposal with:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov votes \n")),(0,o.yg)("h4",{id:"query-proposal-tally-results"},"Query proposal tally results"),(0,o.yg)("p",null,"To check the current tally of a given proposal you can use the ",(0,o.yg)("inlineCode",{parentName:"p"},"tally")," command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov tally \n")),(0,o.yg)("h4",{id:"query-governance-parameters"},"Query Governance Parameters"),(0,o.yg)("p",null,"To check the current governance parameters run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov params\n")),(0,o.yg)("p",null,"To query subsets of the governance parameters run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query gov param voting\ngaiad query gov param tallying\ngaiad query gov param deposit\n")),(0,o.yg)("h3",{id:"fee-distribution"},"Fee Distribution"),(0,o.yg)("h4",{id:"query-distribution-parameters"},"Query Distribution Parameters"),(0,o.yg)("p",null,"To check the current distribution parameters, run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution params\n")),(0,o.yg)("h4",{id:"query-distribution-community-pool"},"Query distribution Community Pool"),(0,o.yg)("p",null,"To query all coins in the community pool which is under Governance control:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution community-pool\n")),(0,o.yg)("h4",{id:"query-outstanding-rewards"},"Query outstanding rewards"),(0,o.yg)("p",null,"To check the current outstanding (un-withdrawn) rewards, run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution outstanding-rewards\n")),(0,o.yg)("h4",{id:"query-validator-commission"},"Query Validator Commission"),(0,o.yg)("p",null,"To check the current outstanding commission for a validator, run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution commission \n")),(0,o.yg)("h4",{id:"query-validator-slashes"},"Query Validator Slashes"),(0,o.yg)("p",null,"To check historical slashes for a validator, run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution slashes \n")),(0,o.yg)("h4",{id:"query-delegator-rewards"},"Query Delegator Rewards"),(0,o.yg)("p",null,"To check current rewards for a delegation (were they to be withdrawn), run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution rewards \n")),(0,o.yg)("h4",{id:"query-all-delegator-rewards"},"Query All Delegator Rewards"),(0,o.yg)("p",null,"To check all current rewards for a delegation (were they to be withdrawn), run:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query distribution rewards \n")),(0,o.yg)("h3",{id:"multisig-transactions"},"Multisig Transactions"),(0,o.yg)("p",null,"Multisig transactions require signatures of multiple private keys. Thus, generating and signing\na transaction from a multisig account involve cooperation among the parties involved. A multisig\ntransaction can be initiated by any of the key holders, and at least one of them would need to\nimport other parties' public keys into their Keybase and generate a multisig public key\nin order to finalize and broadcast the transaction."),(0,o.yg)("p",null,"For example, given a multisig key comprising the keys ",(0,o.yg)("inlineCode",{parentName:"p"},"p1"),", ",(0,o.yg)("inlineCode",{parentName:"p"},"p2"),", and ",(0,o.yg)("inlineCode",{parentName:"p"},"p3"),", each of which is held\nby a distinct party, the user holding ",(0,o.yg)("inlineCode",{parentName:"p"},"p1")," would require to import both ",(0,o.yg)("inlineCode",{parentName:"p"},"p2")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"p3")," in order to\ngenerate the multisig account public key:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add \\\n p2 \\\n --pubkey=cosmospub1addwnpepqtd28uwa0yxtwal5223qqr5aqf5y57tc7kk7z8qd4zplrdlk5ez5kdnlrj4\n\ngaiad keys add \\\n p3 \\\n --pubkey=cosmospub1addwnpepqgj04jpm9wrdml5qnss9kjxkmxzywuklnkj0g3a3f8l5wx9z4ennz84ym5t\n\ngaiad keys add \\\n p1p2p3 \\\n --multisig-threshold=2 \\\n --multisig=p1,p2,p3\n")),(0,o.yg)("p",null,"A new multisig public key ",(0,o.yg)("inlineCode",{parentName:"p"},"p1p2p3")," has been stored, and its address will be\nused as signer of multisig transactions:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show --address p1p2p3\n")),(0,o.yg)("p",null,"You may also view multisig threshold, pubkey constituents and respective weights\nby viewing the JSON output of the key or passing the ",(0,o.yg)("inlineCode",{parentName:"p"},"--show-multisig")," flag:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show p1p2p3 -o json\n\ngaiad keys show p1p2p3 --show-multisig\n")),(0,o.yg)("p",null,"The first step to create a multisig transaction is to initiate it on behalf\nof the multisig address created above:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send cosmos1570v2fq3twt0f0x02vhxpuzc9jc4yl30q2qned 1000000uatom \\\n --from= \\\n --generate-only > unsignedTx.json\n")),(0,o.yg)("p",null,"The file ",(0,o.yg)("inlineCode",{parentName:"p"},"unsignedTx.json")," contains the unsigned transaction encoded in JSON.\n",(0,o.yg)("inlineCode",{parentName:"p"},"p1")," can now sign the transaction with its own private key:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx sign \\\n unsignedTx.json \\\n --multisig= \\\n --from=p1 \\\n --output-document=p1signature.json\n")),(0,o.yg)("p",null,"Once the signature is generated, ",(0,o.yg)("inlineCode",{parentName:"p"},"p1")," transmits both ",(0,o.yg)("inlineCode",{parentName:"p"},"unsignedTx.json")," and\n",(0,o.yg)("inlineCode",{parentName:"p"},"p1signature.json")," to ",(0,o.yg)("inlineCode",{parentName:"p"},"p2")," or ",(0,o.yg)("inlineCode",{parentName:"p"},"p3"),", which in turn will generate their\nrespective signature:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx sign \\\n unsignedTx.json \\\n --multisig= \\\n --from=p2 \\\n --output-document=p2signature.json\n")),(0,o.yg)("p",null,(0,o.yg)("inlineCode",{parentName:"p"},"p1p2p3")," is a 2-of-3 multisig key, therefore one additional signature\nis sufficient. Any the key holders can now generate the multisig\ntransaction by combining the required signature files:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx multisign \\\n unsignedTx.json \\\n p1p2p3 \\\n p1signature.json p2signature.json > signedTx.json\n")),(0,o.yg)("p",null,"The transaction can now be sent to the node:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx broadcast signedTx.json\n")),(0,o.yg)("h2",{id:"shells-completion-scripts"},"Shells Completion Scripts"),(0,o.yg)("p",null,"Completion scripts for popular UNIX shell interpreters such as ",(0,o.yg)("inlineCode",{parentName:"p"},"Bash")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"Zsh"),"\ncan be generated through the ",(0,o.yg)("inlineCode",{parentName:"p"},"completion")," command, which is available for both\n",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad"),"."),(0,o.yg)("p",null,"If you want to generate ",(0,o.yg)("inlineCode",{parentName:"p"},"Bash")," completion scripts run the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad completion > gaiad_completion\ngaiad completion > gaiacli_completion\n")),(0,o.yg)("p",null,"If you want to generate ",(0,o.yg)("inlineCode",{parentName:"p"},"Zsh")," completion scripts run the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad completion --zsh > gaiad_completion\ngaiad completion --zsh > gaiacli_completion\n")),(0,o.yg)("div",{class:"theme-doc-version-banner info alert--warning margin-bottom--md",role:"info"},"On most UNIX systems, such scripts may be loaded in `.bashrc` or `.bash_profile` to enable Bash autocompletion:",(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"echo '. gaiad_completion' >> ~/.bashrc\necho '. gaiacli_completion' >> ~/.bashrc\n")),(0,o.yg)("p",null,"Refer to the user's manual of your interpreter provided by your\noperating system for information on how to enable shell autocompletion.")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3a859fe7.099eea37.js b/assets/js/3a859fe7.099eea37.js new file mode 100644 index 00000000000..95e047c0f24 --- /dev/null +++ b/assets/js/3a859fe7.099eea37.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[3295],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>y});var a=r(6540);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t =0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),c=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(r),d=n,y=u["".concat(s,".").concat(d)]||u[d]||m[d]||o;return r?a.createElement(y,i(i({ref:t},p),{},{components:r})):a.createElement(y,i({ref:t},p))}));function y(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:n,i[1]=l;for(var c=2;c {r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>c});var a=r(8168),n=(r(6540),r(5680));const o={title:"Validators",order:1},i=void 0,l={unversionedId:"validators/README",id:"validators/README",title:"Validators",description:"This folder contains documentation relevant to validators of the Cosmos Hub and other gaia blockchains.",source:"@site/docs/validators/README.md",sourceDirName:"validators",slug:"/validators/",permalink:"/main/validators/",draft:!1,tags:[],version:"current",frontMatter:{title:"Validators",order:1},sidebar:"tutorialSidebar",previous:{title:"Delegator Security",permalink:"/main/delegators/delegator-security"},next:{title:"KMS - Key Management System",permalink:"/main/validators/kms/"}},s={},c=[],p={toc:c},u="wrapper";function m(e){let{components:t,...r}=e;return(0,n.yg)(u,(0,a.A)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("p",null,"This folder contains documentation relevant to validators of the Cosmos Hub and other ",(0,n.yg)("inlineCode",{parentName:"p"},"gaia")," blockchains."),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"/main/validators/overview"},"Validator Overview")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"/main/validators/validator-setup"},"Setting Up a Validator for Cosmos Hub Mainnet")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"/main/validators/validator-faq"},"Validator FAQ")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"/main/validators/security"},"Validator Security Notice")),(0,n.yg)("li",{parentName:"ul"},"Key Management Systems",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"/main/validators/kms/"},"Intro to KMS")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"/main/validators/kms/kms_ledger"},"KMS + Ledger"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3de875ef.6f15223f.js b/assets/js/3de875ef.6f15223f.js new file mode 100644 index 00000000000..c3599c391c3 --- /dev/null +++ b/assets/js/3de875ef.6f15223f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[3032],{5680:(e,t,n)=>{n.d(t,{xA:()=>u,yg:()=>g});var r=n(6540);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t =0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=s(n),h=o,g=p["".concat(c,".").concat(h)]||p[h]||d[h]||a;return n?r.createElement(g,l(l({ref:t},u),{},{components:n})):r.createElement(g,l({ref:t},u))}));function g(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,l=new Array(a);l[0]=h;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i[p]="string"==typeof e?e:o,l[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>s});var r=n(8168),o=(n(6540),n(5680));const a={},l="ADR 003: Interchain Accounts Controller Module",i={unversionedId:"architecture/adr/adr-003-ica-controller",id:"architecture/adr/adr-003-ica-controller",title:"ADR 003: Interchain Accounts Controller Module",description:"Changelog",source:"@site/docs/architecture/adr/adr-003-ica-controller.md",sourceDirName:"architecture/adr",slug:"/architecture/adr/adr-003-ica-controller",permalink:"/main/architecture/adr/adr-003-ica-controller",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"ADR 002: Globalfee Module",permalink:"/main/architecture/adr/adr-002-globalfee"},next:{title:"adr-template",permalink:"/main/architecture/templates/adr-template"}},c={},s=[{value:"Changelog",id:"changelog",level:2},{value:"Status",id:"status",level:2},{value:"Abstract",id:"abstract",level:2},{value:"Context",id:"context",level:2},{value:"Decision",id:"decision",level:2},{value:"Consequences",id:"consequences",level:2},{value:"Positive",id:"positive",level:3},{value:"Negative",id:"negative",level:3},{value:"Neutral",id:"neutral",level:3},{value:"References",id:"references",level:2}],u={toc:s},p="wrapper";function d(e){let{components:t,...n}=e;return(0,o.yg)(p,(0,r.A)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"adr-003-interchain-accounts-controller-module"},"ADR 003: Interchain Accounts Controller Module"),(0,o.yg)("h2",{id:"changelog"},"Changelog"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"2024-03-08: Initial Draft")),(0,o.yg)("h2",{id:"status"},"Status"),(0,o.yg)("p",null,"Proposed"),(0,o.yg)("h2",{id:"abstract"},"Abstract"),(0,o.yg)("p",null,"The Interchain Accounts Controller IBC module allows users of one chain to create and control accounts on other chains. The Hub currently doesn't have ICA Controller module enabled, so it is not possible to create accounts on other chains from the Hub chain."),(0,o.yg)("h2",{id:"context"},"Context"),(0,o.yg)("p",null,"Enabling the ICA Controller module on the Hub would support various use cases. One such case could be the provider-based governance that would allow the ATOM stakers to participate in a governance on consumer chains."),(0,o.yg)("h2",{id:"decision"},"Decision"),(0,o.yg)("p",null,"The ICA Controller module will be included in the application, so the Hub will have both ICA Host and Controller modules. The implementation will use the Controller module's built-in authentication mechanism, since we don't have a need for custom authentication logic. According to this, users will directly use ",(0,o.yg)("inlineCode",{parentName:"p"},"MsgRegisterInterchainAccount")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"MsgSendTx")," messages defined by the Controller module. The possibility provided by the Controller module to define underlying application to have custom processing of IBC messages exchanged by the Controller module (e.g. ",(0,o.yg)("inlineCode",{parentName:"p"},"OnChanOpenInit"),", ",(0,o.yg)("inlineCode",{parentName:"p"},"OnAcknowledgementPacket"),", etc.) will not be used, since there is currently no need for this."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-go"},"// ICA Controller keeper\nappKeepers.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(\n appCodec,\n appKeepers.keys[icacontrollertypes.StoreKey],\n appKeepers.GetSubspace(icacontrollertypes.SubModuleName),\n appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper\n appKeepers.IBCKeeper.ChannelKeeper,\n &appKeepers.IBCKeeper.PortKeeper,\n appKeepers.ScopedICAControllerKeeper,\n bApp.MsgServiceRouter(),\n)\n\n// Create ICA module\nappKeepers.ICAModule = ica.NewAppModule(&appKeepers.ICAControllerKeeper, &appKeepers.ICAHostKeeper)\n\n// Create Interchain Accounts Controller Stack\nvar icaControllerStack porttypes.IBCModule = icacontroller.NewIBCMiddleware(nil, appKeepers.ICAControllerKeeper)\n\n// Add Interchain Accounts Controller IBC route\nibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack)\n")),(0,o.yg)("h2",{id:"consequences"},"Consequences"),(0,o.yg)("h3",{id:"positive"},"Positive"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Users of the Hub will have a possibility to create and utilize Interchain Accounts on other IBC connected chains.")),(0,o.yg)("h3",{id:"negative"},"Negative"),(0,o.yg)("h3",{id:"neutral"},"Neutral"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Since we don't need to implement a custom authentication mechanism, we can rely on the one defined by the Controller module itself, implemented through the ",(0,o.yg)("inlineCode",{parentName:"li"},"MsgRegisterInterchainAccount")," and ",(0,o.yg)("inlineCode",{parentName:"li"},"MsgSendTx")," messages.")),(0,o.yg)("h2",{id:"references"},"References"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/gaia/issues/2869"},"https://github.com/cosmos/gaia/issues/2869")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/416.e12d54c2.js b/assets/js/416.e12d54c2.js new file mode 100644 index 00000000000..2b31257812e --- /dev/null +++ b/assets/js/416.e12d54c2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[416],{416:(s,c,e)=>{e.r(c)}}]); \ No newline at end of file diff --git a/assets/js/41f2894c.8e130019.js b/assets/js/41f2894c.8e130019.js new file mode 100644 index 00000000000..84e425908ce --- /dev/null +++ b/assets/js/41f2894c.8e130019.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[3684],{5680:(e,a,t)=>{t.d(a,{xA:()=>u,yg:()=>h});var n=t(6540);function o(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function i(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var a=1;a =0||(o[t]=e[t]);return o}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=n.createContext({}),p=function(e){var a=n.useContext(l),t=a;return e&&(t="function"==typeof e?e(a):s(s({},a),e)),t},u=function(e){var a=p(e.components);return n.createElement(l.Provider,{value:a},e.children)},m="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},d=n.forwardRef((function(e,a){var t=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=r(e,["components","mdxType","originalType","parentName"]),m=p(t),d=o,h=m["".concat(l,".").concat(d)]||m[d]||g[d]||i;return t?n.createElement(h,s(s({ref:a},u),{},{components:t})):n.createElement(h,s({ref:a},u))}));function h(e,a){var t=arguments,o=a&&a.mdxType;if("string"==typeof e||o){var i=t.length,s=new Array(i);s[0]=d;var r={};for(var l in a)hasOwnProperty.call(a,l)&&(r[l]=a[l]);r.originalType=e,r[m]="string"==typeof e?e:o,s[1]=r;for(var p=2;p{t.r(a),t.d(a,{assets:()=>l,contentTitle:()=>s,default:()=>g,frontMatter:()=>i,metadata:()=>r,toc:()=>p});var n=t(8168),o=(t(6540),t(5680));const i={title:"Submitting a Proposal",order:5},s=void 0,r={unversionedId:"governance/submitting",id:"governance/submitting",title:"Submitting a Proposal",description:"If you have a final draft of your proposal ready to submit, you may want to push your proposal live on the testnet first. These are the three primary steps to getting your proposal live on-chain.",source:"@site/docs/governance/submitting.md",sourceDirName:"governance",slug:"/governance/submitting",permalink:"/main/governance/submitting",draft:!1,tags:[],version:"current",frontMatter:{title:"Submitting a Proposal",order:5},sidebar:"tutorialSidebar",previous:{title:"On-Chain Proposal Process",permalink:"/main/governance/process"},next:{title:"Interchain Security",permalink:"/main/interchain-security/"}},l={},p=[{value:"Hosting supplementary materials",id:"hosting-supplementary-materials",level:2},{value:"Formatting the JSON file for the governance proposal",id:"formatting-the-json-file-for-the-governance-proposal",level:2},{value:"Sending the transaction that submits your governance proposal",id:"sending-the-transaction-that-submits-your-governance-proposal",level:2},{value:"Proposal types",id:"proposal-types",level:3},{value:"Legacy proposals (cosmos-sdk < v0.47)",id:"legacy-proposals-cosmos-sdk--v047",level:4},{value:"Proposals (cosmos-sdk >= v0.47)",id:"proposals-cosmos-sdk--v047",level:4},{value:"Minimal Deposit amount",id:"minimal-deposit-amount",level:4},{value:"Walkthrough example (changing x/staking params)",id:"walkthrough-example-changing-xstaking-params",level:3},{value:"Verifying your transaction",id:"verifying-your-transaction",level:3},{value:"Troubleshooting a failed transaction",id:"troubleshooting-a-failed-transaction",level:3},{value:"Depositing funds after a proposal has been submitted",id:"depositing-funds-after-a-proposal-has-been-submitted",level:3},{value:"Submitting your proposal to the testnet",id:"submitting-your-proposal-to-the-testnet",level:3}],u={toc:p},m="wrapper";function g(e){let{components:a,...t}=e;return(0,o.yg)(m,(0,n.A)({},u,t,{components:a,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"If you have a final draft of your proposal ready to submit, you may want to push your proposal live on the testnet first. These are the three primary steps to getting your proposal live on-chain."),(0,o.yg)("p",null,"Interacting with the Cosmos Hub via the command line in order to run queries or submit proposals has several prerequisites:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"You will need to compile ",(0,o.yg)("a",{parentName:"li",href:"../getting-started/installation"},(0,o.yg)("inlineCode",{parentName:"a"},"gaiad"))," from source into a binary file executable by your operating system eg. MacOS, Windows, Linux"),(0,o.yg)("li",{parentName:"ul"},"You will need to indicate which chain you are querying, and currently this is ",(0,o.yg)("inlineCode",{parentName:"li"},"--chain-id cosmoshub-4")),(0,o.yg)("li",{parentName:"ul"},"You will need to connect to a full node. You can find a list of available Cosmos Hub endpoints under the ",(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/chain-registry/blob/master/cosmoshub/chain.json"},"API section")," in the ",(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/chain-registry"},"Chain Registry"),"."),(0,o.yg)("li",{parentName:"ul"},"More info is in the Walkthrough Example section.")),(0,o.yg)("p",null,"Running a full node can be difficult for those not technically-inclined, so you may choose to use a third-party's full node. In this case, the primary security risk is that of censorship: it's the single place where you have a single gateway to the network, and any messages submitted through an untrusted node could be censored."),(0,o.yg)("h2",{id:"hosting-supplementary-materials"},"Hosting supplementary materials"),(0,o.yg)("p",null,"In general we try to minimize the amount of data pushed to the blockchain. Hence, detailed documentation about a proposal is usually hosted on a separate censorship resistant data-hosting platform, like IPFS."),(0,o.yg)("p",null,"Once you have drafted your proposal, ideally as a Markdown file, you\ncan upload it to the IPFS network:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"By ",(0,o.yg)("a",{parentName:"li",href:"https://ipfs.io"},"running an IPFS node and the IPFS software"),", or"),(0,o.yg)("li",{parentName:"ol"},"By using a service such as ",(0,o.yg)("a",{parentName:"li",href:"https://pinata.cloud"},"https://pinata.cloud"))),(0,o.yg)("p",null,'Ensure that you "pin" the file so that it continues to be available on the network. You should get a URL like this: ',(0,o.yg)("a",{parentName:"p",href:"https://ipfs.io/ipfs/QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD"},"https://ipfs.io/ipfs/QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD")),(0,o.yg)("p",null,"The value ",(0,o.yg)("inlineCode",{parentName:"p"},"QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD")," is called the ",(0,o.yg)("inlineCode",{parentName:"p"},"CID")," of your file - it is effectively the file's hash."),(0,o.yg)("p",null,"If you uploaded a markdown file, you can use the IPFS markdown viewer to render the document for better viewing. Links for the markdown viewer look like ",(0,o.yg)("inlineCode",{parentName:"p"},"https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/ "),", where ",(0,o.yg)("inlineCode",{parentName:"p"}," ")," is your CID. For instance the link above would be: ",(0,o.yg)("a",{parentName:"p",href:"https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD"},"https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD")),(0,o.yg)("p",null,"Share the URL with others and verify that your file is publicly accessible."),(0,o.yg)("p",null,"The reason we use IPFS is that it is a decentralized means of storage, making it resistant to censorship or single points of failure. This increases the likelihood that the file will remain available in the future."),(0,o.yg)("h2",{id:"formatting-the-json-file-for-the-governance-proposal"},"Formatting the JSON file for the governance proposal"),(0,o.yg)("p",null,"Prior to sending the transaction that submits your proposal on-chain, you must create a JSON file. This file will contain the information that will be stored on-chain as the governance proposal. Begin by creating a new text (.txt) file to enter this information. Use ",(0,o.yg)("a",{parentName:"p",href:"/main/governance/best-practices"},"these best practices")," as a guide for the contents of your proposal. When you're done, save the file as a .json file. "),(0,o.yg)("p",null,"Each proposal type is unique in how the JSON should be formatted.\nSee the relevant section for the type of proposal you are drafting:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/governance/formatting#text"},"Text Proposals")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/governance/formatting#community-pool-spend"},"Community Pool Spend Proposals")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/governance/formatting#parameter-change"},"Parameter Change Proposals"))),(0,o.yg)("p",null,"Once on-chain, most people will rely upon block explorers to interpret this information with a graphical user interface (GUI)."),(0,o.yg)("h2",{id:"sending-the-transaction-that-submits-your-governance-proposal"},"Sending the transaction that submits your governance proposal"),(0,o.yg)("p",null,"For information on how to use gaiad (the command line interface) to submit an on-chain proposal through the governance module, please refer to the ",(0,o.yg)("a",{parentName:"p",href:"../hub-tutorials/gaiad"},"gaiad CLI tutorials")," for the Cosmos Hub documentation."),(0,o.yg)("h3",{id:"proposal-types"},"Proposal types"),(0,o.yg)("p",null,"There are 2 proposal types that can be submitted to the CosmosHub governance module."),(0,o.yg)("h4",{id:"legacy-proposals-cosmos-sdk--v047"},"Legacy proposals (cosmos-sdk < v0.47)"),(0,o.yg)("p",null,"These proposals can be submitted using ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad tx gov submit-legacy-proposal"),"."),(0,o.yg)("p",null,"Available proposals that can be submitted using this Tx are:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"cancel-software-upgrade"),(0,o.yg)("li",{parentName:"ul"},"change-reward-denoms"),(0,o.yg)("li",{parentName:"ul"},"consumer-addition"),(0,o.yg)("li",{parentName:"ul"},"consumer-removal"),(0,o.yg)("li",{parentName:"ul"},"ibc-upgrade"),(0,o.yg)("li",{parentName:"ul"},"param-change (does not work for standard cosmos-sdk modules, works on IBC and ICS modules)"),(0,o.yg)("li",{parentName:"ul"},"software-upgrade"),(0,o.yg)("li",{parentName:"ul"},"update-client")),(0,o.yg)("p",null,"You can read more about submitting a legacy proposal in the ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/v0.47/build/modules/gov#submit-legacy-proposal"},"cosmos-sdk docs")),(0,o.yg)("h4",{id:"proposals-cosmos-sdk--v047"},"Proposals (cosmos-sdk >= v0.47)"),(0,o.yg)("p",null,"These proposals can be submitted using ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad tx gov submit-proposal"),"."),(0,o.yg)("p",null,"Using ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad tx gov draft-proposal")," can help prepare a proposal. The tool will create a file containing the specified proposal message and it also helps with populating all the required proposal fields.\nYou can always edit the file after you create it using ",(0,o.yg)("inlineCode",{parentName:"p"},"draft-proposal")),(0,o.yg)("p",null,"Most cosmos-sdk modules allow changing their governance gated parameters using a ",(0,o.yg)("inlineCode",{parentName:"p"},"MsgUpdateParams")," which is a new way of updating governance parameters. It is important to note that ",(0,o.yg)("inlineCode",{parentName:"p"},"MsgUpdateParams")," requires ",(0,o.yg)("strong",{parentName:"p"},"all parameters to be specified")," in the proposal message."),(0,o.yg)("p",null,"You can read more about submitting a proposal in the ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/v0.47/build/modules/gov#submit-proposal"},"cosmos-sdk docs")),(0,o.yg)("h4",{id:"minimal-deposit-amount"},"Minimal Deposit amount"),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"Please note that cosmoshub-4 uses a minimum initial deposit amount.")),(0,o.yg)("p",null,"Proposals cannot be submitted successfully without providing a minimum initial deposit. In practice, this means that the ",(0,o.yg)("inlineCode",{parentName:"p"},"deposit")," field in your proposal has to meet the ",(0,o.yg)("inlineCode",{parentName:"p"},"min_initial_deposit")," governance parameter.\nThe minimum deposit is equal to ",(0,o.yg)("inlineCode",{parentName:"p"},"min_deposit * min_initial_deposit_ratio"),". Only ",(0,o.yg)("inlineCode",{parentName:"p"},"uatom")," is supported as deposit denom."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-shell"},'// checking the min_initial_deposit\ngaiad q gov params -o json\n{\n ...\n "params": {\n ...\n "min_deposit": [\n {\n "denom": "stake",\n "amount": "10000000"\n }\n ],\n "min_initial_deposit_ratio": "0.000000000000000000"\n}\n')),(0,o.yg)("h3",{id:"walkthrough-example-changing-xstaking-params"},"Walkthrough example (changing x/staking params)"),(0,o.yg)("p",null,"Let's illustrate how to change the ",(0,o.yg)("inlineCode",{parentName:"p"},"x/staking")," parameters."),(0,o.yg)("p",null,"The module has the following parameters (values don't reflect actual on-chain values):"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-shell"},'gaiad q staking params -o json\n{\n "unbonding_time": "86400s",\n "max_validators": 100,\n "max_entries": 7,\n "historical_entries": 10000,\n "bond_denom": "stake",\n "min_commission_rate": "0.000000000000000000",\n "validator_bond_factor": "-1.000000000000000000",\n "global_liquid_staking_cap": "1.000000000000000000",\n "validator_liquid_staking_cap": "1.000000000000000000"\n}\n')),(0,o.yg)("p",null,"We will use ",(0,o.yg)("inlineCode",{parentName:"p"},"draft-proposal")," to help us create a proposal file that we will later submit."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-shell"},"gaiad tx gov draft-proposal\n// running the command will start a terminal applet allowing you to choose the proposal type\n\n// 1st screen\nUse the arrow keys to navigate: \u2193 \u2191 \u2192 \u2190\n? Select proposal type:\n text\n community-pool-spend\n software-upgrade\n cancel-software-upgrade\n \u25b8 other // choose this\n\n// 2nd screen\n\u2714 other\nUse the arrow keys to navigate: \u2193 \u2191 \u2192 \u2190\n? Select proposal message type::\n\u2191 /cosmos.staking.v1beta1.MsgUndelegate\n \u25b8 /cosmos.staking.v1beta1.MsgUpdateParams // choose this option\n /cosmos.staking.v1beta1.MsgValidatorBond\n /cosmos.upgrade.v1beta1.MsgCancelUpgrade\n\u2193 /cosmos.upgrade.v1beta1.MsgSoftwareUpgrade\n")),(0,o.yg)("p",null,"After choosing the ",(0,o.yg)("inlineCode",{parentName:"p"},"/cosmos.staking.v1beta1.MsgUpdateParams")," message, the applet will allow you to set the message fields and some other proposal details.\nUpon completion, the proposal will be available in the directory where you called the ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," command inside the ",(0,o.yg)("inlineCode",{parentName:"p"},"draft_proposal.json")," file."),(0,o.yg)("p",null,"Here is an example of the ",(0,o.yg)("inlineCode",{parentName:"p"},"draft_proposal.json")," file:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-JSON"},'{\n "messages": [\n {\n "@type": "/cosmos.staking.v1beta1.MsgUpdateParams",\n "authority": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",\n "params": {\n "unbonding_time": "86400s",\n "max_validators": 100,\n "max_entries": 7,\n "historical_entries": 10000,\n "bond_denom": "uatom",\n "min_commission_rate": "0.050000000000000000", // we are changing this from 0.000000000000000000\n "validator_bond_factor": "-1.000000000000000000",\n "global_liquid_staking_cap": "1.000000000000000000",\n "validator_liquid_staking_cap": "1.000000000000000000"\n }\n }\n ],\n "metadata": "ipfs://CID",\n "deposit": "1000000uatom",\n "title": "Updating the staking params (min_comission_rate)",\n "summary": "This proposal will attempt to update the min_commission_rate staking parameter. During proposal creation and submission **all** proposal fields must be specified. Pay attention that you don\'t unintentionally specify different values for fields that you did not intend to change."\n}\n')),(0,o.yg)("p",null,"Finally, we submit the proposal:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-sh"},"gaiad tx gov submit-proposal \n --from \\\n --chain-id cosmoshub-4 \\\n --gas \\\n --fees \\\n --node \\\n")),(0,o.yg)("p",null,"Use ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad tx gov --help")," to get more info about the CLI options, we will explain some options below:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},(0,o.yg)("inlineCode",{parentName:"li"},"--from")," is the account key that pays the transaction fee and deposit amount. This account key must be already saved in the keyring on your device and it must be an address you control (e.g. ",(0,o.yg)("inlineCode",{parentName:"li"},"--from hypha-dev-wallet"),")."),(0,o.yg)("li",{parentName:"ol"},(0,o.yg)("inlineCode",{parentName:"li"},"--gas")," is the maximum amount of gas permitted to be used to process the transaction (e.g. ",(0,o.yg)("inlineCode",{parentName:"li"},"--gas 500000"),").",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},"The more content there is in the description of your proposal, the more gas your transaction will consume"),(0,o.yg)("li",{parentName:"ul"},"If this number isn't high enough and there isn't enough gas to process your transaction, the transaction will fail."),(0,o.yg)("li",{parentName:"ul"},"The transaction will only use the amount of gas needed to process the transaction."))),(0,o.yg)("li",{parentName:"ol"},(0,o.yg)("inlineCode",{parentName:"li"},"--fees")," is a flat-rate incentive for a validator to process your transaction.",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},"Many nodes use a minimum fee to disincentivize transaction spamming."),(0,o.yg)("li",{parentName:"ul"},"7500uatom is equal to 0.0075 ATOM."))),(0,o.yg)("li",{parentName:"ol"},(0,o.yg)("inlineCode",{parentName:"li"},"--node")," is using an established node to send the transaction to the Cosmos Hub 4 network. For available nodes, please look at the ",(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/chain-registry/blob/master/cosmoshub/chain.json"},"Chain Registry"),".")),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Note"),": be careful what you use for ",(0,o.yg)("inlineCode",{parentName:"p"},"--fees"),". A mistake here could result in spending hundreds or thousands of ATOMs accidentally, which cannot be recovered."),(0,o.yg)("h3",{id:"verifying-your-transaction"},"Verifying your transaction"),(0,o.yg)("p",null,"After posting your transaction, your command line interface (gaiad) will provide you with the transaction's hash, which you can either query using gaiad or by searching the transaction hash using ",(0,o.yg)("a",{parentName:"p",href:"https://www.mintscan.io/cosmos/txs/0506447AE8C7495DE970736474451CF23536DF8EA837FAF1CF6286565589AB57"},"Mintscan"),". The hash should look something like this: ",(0,o.yg)("inlineCode",{parentName:"p"},"0506447AE8C7495DE970736474451CF23536DF8EA837FAF1CF6286565589AB57"),"."),(0,o.yg)("p",null,"Alternatively, you can check your Tx status and information using:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-shell"},"gaiad q tx \n")),(0,o.yg)("h3",{id:"troubleshooting-a-failed-transaction"},"Troubleshooting a failed transaction"),(0,o.yg)("p",null,"There are a number of reasons why a transaction may fail. Here are two examples:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},(0,o.yg)("p",{parentName:"li"},(0,o.yg)("strong",{parentName:"p"},"Running out of gas")," - The more data there is in a transaction, the more gas it will need to be processed. If you don't specify enough gas, the transaction will fail.")),(0,o.yg)("li",{parentName:"ol"},(0,o.yg)("p",{parentName:"li"},(0,o.yg)("strong",{parentName:"p"},"Incorrect denomination")," - You may have specified an amount in 'utom' or 'atom' instead of 'uatom', causing the transaction to fail."))),(0,o.yg)("p",null,"If you encounter a problem, try to troubleshoot it first, and then ask for help on the Cosmos Hub forum: ",(0,o.yg)("a",{parentName:"p",href:"https://forum.cosmos.network"},"https://forum.cosmos.network"),". We can learn from failed attempts and use them to improve upon this guide."),(0,o.yg)("h3",{id:"depositing-funds-after-a-proposal-has-been-submitted"},"Depositing funds after a proposal has been submitted"),(0,o.yg)("p",null,"Sometimes a proposal is submitted without having the minimum token amount deposited yet. In these cases you would want to be able to deposit more tokens to get the proposal into the voting stage. In order to deposit tokens, you'll need to know what your proposal ID is after you've submitted your proposal. You can query all proposals by the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-sh"},"gaiad q gov proposals\n")),(0,o.yg)("p",null,"If there are a lot of proposals on the chain already, you can also filter by your own address. For the proposal above, that would be:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-sh"},"gaiad q gov proposals --depositor cosmos1hxv7mpztvln45eghez6evw2ypcw4vjmsmr8cdx\n")),(0,o.yg)("p",null,"Once you have the proposal ID, this is the command to deposit extra tokens:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-sh"},"gaiad tx gov deposit --from \n")),(0,o.yg)("p",null,"The amount per deposit is equal to ",(0,o.yg)("inlineCode",{parentName:"p"},"min_deposit * min_deposit_ratio"),". Only ",(0,o.yg)("inlineCode",{parentName:"p"},"uatom")," is supported as deposit denom. Transactions where ",(0,o.yg)("inlineCode",{parentName:"p"},"deposit_amount < (min_deposit * min_deposit_ratio)")," will be rejected."),(0,o.yg)("h3",{id:"submitting-your-proposal-to-the-testnet"},"Submitting your proposal to the testnet"),(0,o.yg)("p",null,"Submitting to the testnet is identical to mainnet submissions aside from a few changes:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"The chain-id is ",(0,o.yg)("inlineCode",{parentName:"li"},"theta-testnet-001"),"."),(0,o.yg)("li",{parentName:"ol"},"The list of usable endpoints can be found ",(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/testnets/tree/master/public#readme"},"here"),"."),(0,o.yg)("li",{parentName:"ol"},"You will need testnet tokens, not ATOM. There is a faucet available in the Developer ",(0,o.yg)("a",{parentName:"li",href:"https://discord.com/invite/cosmosnetwork"},"Discord"),".")),(0,o.yg)("p",null,"You may want to submit your proposal to the testnet chain before the mainnet for a number of reasons:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"To see what the proposal description will look like."),(0,o.yg)("li",{parentName:"ol"},"To signal that your proposal is about to go live on the mainnet."),(0,o.yg)("li",{parentName:"ol"},"To share what the proposal will look like in advance with stakeholders."),(0,o.yg)("li",{parentName:"ol"},"To test the functionality of the governance features.")))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/43353076.6fe88653.js b/assets/js/43353076.6fe88653.js new file mode 100644 index 00000000000..f95142bd9b9 --- /dev/null +++ b/assets/js/43353076.6fe88653.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[8606],{5680:(e,t,o)=>{o.d(t,{xA:()=>d,yg:()=>c});var r=o(6540);function i(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function a(e){for(var t=1;t =0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var p=r.createContext({}),l=function(e){var t=r.useContext(p),o=t;return e&&(o="function"==typeof e?e(t):a(a({},t),e)),o},d=function(e){var t=l(e.components);return r.createElement(p.Provider,{value:t},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var o=e.components,i=e.mdxType,n=e.originalType,p=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),u=l(o),h=i,c=u["".concat(p,".").concat(h)]||u[h]||g[h]||n;return o?r.createElement(c,a(a({ref:t},d),{},{components:o})):r.createElement(c,a({ref:t},d))}));function c(e,t){var o=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var n=o.length,a=new Array(n);a[0]=h;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s[u]="string"==typeof e?e:i,a[1]=s;for(var l=2;l {o.r(t),o.d(t,{assets:()=>p,contentTitle:()=>a,default:()=>g,frontMatter:()=>n,metadata:()=>s,toc:()=>l});var r=o(8168),i=(o(6540),o(5680));const n={title:"On-Chain Proposal Process",order:2},a=void 0,s={unversionedId:"governance/process",id:"governance/process",title:"On-Chain Proposal Process",description:"Governance Parameters",source:"@site/docs/governance/process.md",sourceDirName:"governance",slug:"/governance/process",permalink:"/main/governance/process",draft:!1,tags:[],version:"current",frontMatter:{title:"On-Chain Proposal Process",order:2},sidebar:"tutorialSidebar",previous:{title:"Formatting a Proposal",permalink:"/main/governance/formatting"},next:{title:"Submitting a Proposal",permalink:"/main/governance/submitting"}},p={},l=[{value:"Governance Parameters",id:"governance-parameters",level:2},{value:"1. Deposit Period",id:"1-deposit-period",level:2},{value:"Deposits",id:"deposits",level:3},{value:"Burned deposits",id:"burned-deposits",level:3},{value:"2. Voting Period",id:"2-voting-period",level:2},{value:"What do the voting options mean?",id:"what-do-the-voting-options-mean",level:3},{value:"What determines whether or not a governance proposal passes?",id:"what-determines-whether-or-not-a-governance-proposal-passes",level:3},{value:"How is quorum determined?",id:"how-is-quorum-determined",level:3},{value:"How is voting tallied?",id:"how-is-voting-tallied",level:3}],d={toc:l},u="wrapper";function g(e){let{components:t,...o}=e;return(0,i.yg)(u,(0,r.A)({},d,o,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("h2",{id:"governance-parameters"},"Governance Parameters"),(0,i.yg)("p",null,"Several of the numbers involved in governance are parameters and can thus be changed by passing a parameter change proposal. "),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},"Minimum deposit: 250 ATOM"),(0,i.yg)("li",{parentName:"ul"},"Maximum deposit period: 14 days"),(0,i.yg)("li",{parentName:"ul"},"Voting period: 14 days"),(0,i.yg)("li",{parentName:"ul"},"Quorum: 40% of participating voting power"),(0,i.yg)("li",{parentName:"ul"},"Pass threshold: 50% of participating voting power"),(0,i.yg)("li",{parentName:"ul"},"Veto threshold: 33.40% of participating voting power")),(0,i.yg)("h2",{id:"1-deposit-period"},"1. Deposit Period"),(0,i.yg)("p",null,"The deposit period lasts either 14 days or until the proposal deposit totals 250 ATOMs, whichever happens first. "),(0,i.yg)("h3",{id:"deposits"},"Deposits"),(0,i.yg)("p",null,"Prior to a governance proposal entering the voting period (i.e., for the proposal to be voted upon), there must be at least a minimum number of ATOMs deposited (250). Anyone may contribute to this deposit, though it is usually filled by the proposal maker. Deposits of passed and failed proposals are returned to the contributors."),(0,i.yg)("p",null,"In the past, different people have considered contributions amounts differently. There is some consensus that this should be a personal choice. There is also some consensus that this can be an opportunity for supporters to signal their support by adding to the deposit amount, so a proposer may choose to leave contribution room (i.e., a deposit below 250 ATOMs) so that others may participate. It is important to remember that any contributed ATOMs are at risk of being burned."),(0,i.yg)("h3",{id:"burned-deposits"},"Burned deposits"),(0,i.yg)("p",null,"Deposits are burned only when proposals are vetoed as documented in the ",(0,i.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/main/modules/gov#deposit-refund-and-burn"},"Cosmos SDK gov module spec"),". Deposits are not burned for failing to meet quorum or for being rejected. "),(0,i.yg)("h2",{id:"2-voting-period"},"2. Voting Period"),(0,i.yg)("p",null,"The voting period is currently a fixed 14-day period. During the voting period, participants may select a vote of either 'Yes', 'No', 'Abstain', or 'NoWithVeto'. Voters may change their vote at any time before the voting period ends. "),(0,i.yg)("h3",{id:"what-do-the-voting-options-mean"},"What do the voting options mean?"),(0,i.yg)("ol",null,(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("strong",{parentName:"li"},"Abstain:")," The voter wishes to contribute to quorum without voting for or against a proposal."),(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("strong",{parentName:"li"},"Yes:")," Approval of the proposal in its current form."),(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("strong",{parentName:"li"},"No:")," Disapproval of the proposal in its current form."),(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("strong",{parentName:"li"},"NoWithVeto:")," A \u2018NoWithVeto\u2019 vote indicates a proposal either (1) is deemed to be spam, i.e., irrelevant to Cosmos Hub, (2) disproportionately infringes on minority interests, or (3) violates or encourages violation of the rules of engagement as currently set out by Cosmos Hub governance.")),(0,i.yg)("p",null,"As accepted by the community in ",(0,i.yg)("a",{parentName:"p",href:"https://ipfs.io/ipfs/QmVHVH9WeGy9tTNN9dViqvDn7N79XJJUseKXD1rpyLVckK"},"Proposal 75"),", voters are expected to vote 'NoWithVeto' for proposals that are spam, infringe on minority interests, or violate the rules of engagement (i.e., Social protocols which have passed governance and thus been accepted as rules on the Hub). This proposal was an extension of the ideas put forward in ",(0,i.yg)("a",{parentName:"p",href:"https://ipfs.io/ipfs/QmRtR7qkeaZCpCzHDwHgJeJAZdTrbmHLxFDYXhw7RoF1pp"},"Proposal 6"),"."),(0,i.yg)("p",null,"Voting 'NoWithVeto' has no immediate additional financial cost to the voter - you do not directly risk your ATOM by using this option."),(0,i.yg)("h3",{id:"what-determines-whether-or-not-a-governance-proposal-passes"},"What determines whether or not a governance proposal passes?"),(0,i.yg)("p",null,"There are four criteria:"),(0,i.yg)("ol",null,(0,i.yg)("li",{parentName:"ol"},"Deposit is filled: A minimum deposit of 250 ATOM is required for the proposal to enter the voting period",(0,i.yg)("ul",{parentName:"li"},(0,i.yg)("li",{parentName:"ul"},"anyone may contribute to this deposit"),(0,i.yg)("li",{parentName:"ul"},"the deposit must be reached within 14 days (this is the deposit period)"))),(0,i.yg)("li",{parentName:"ol"},"Quorum is reached: A minimum of 40% of the network's total voting power (staked ATOM) is required to participate "),(0,i.yg)("li",{parentName:"ol"},"Simple majority of 'Yes' votes: Greater than 50% of the participating voting power must back the 'Yes' vote by the end of the 14-day voting period"),(0,i.yg)("li",{parentName:"ol"},"Not vetoed: Less than 33.4% of participating voting power must have backed 'NoWithVeto' by the end of the 14-day voting period")),(0,i.yg)("p",null,"Currently, the criteria for submitting and passing/failing all proposal types is the same."),(0,i.yg)("h3",{id:"how-is-quorum-determined"},"How is quorum determined?"),(0,i.yg)("p",null,"Voting power, whether backing a vote of 'Yes', 'Abstain', 'No', or 'NoWithVeto', counts toward quorum. Quorum is required for the outcome of a governance proposal vote to be considered valid and for deposit contributors to recover their deposit amounts. "),(0,i.yg)("h3",{id:"how-is-voting-tallied"},"How is voting tallied?"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Total voting power")," refers to all staked ATOM at the end of the 14-day voting period. Liquid ATOMs are not part of the total voting power and thus cannot participate in voting. "),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Participating voting power")," refers to only the ATOM which have been used to cast a vote on a particular proposal. Quorum is set to 40% of the ",(0,i.yg)("strong",{parentName:"li"},"participating")," voting power.")),(0,i.yg)("p",null,"Validators not in the active set can cast a vote, but their voting power (including the backing of their delegators) will not count toward the vote if they are not in the active set ",(0,i.yg)("strong",{parentName:"p"},"when the voting period ends"),". That means that if ATOM is delegated to a validator that is jailed, tombstoned, or outside of the active set at the time that the voting period ends, that ATOM's stake-weight will not count in the vote."),(0,i.yg)("p",null,"Though a simple majority 'Yes' vote (ie. 50% of participating voting power) is required for a governance proposal vote to pass, a 'NoWithVeto' vote of 33.4% of participating voting power or greater can override this outcome and cause the proposal to fail. This enables a minority group representing greater than 1/3 of participating voting power to fail a proposal that would otherwise pass."))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/446bc915.c89b5aa8.js b/assets/js/446bc915.c89b5aa8.js new file mode 100644 index 00000000000..d8c8ce14749 --- /dev/null +++ b/assets/js/446bc915.c89b5aa8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[6745],{5680:(e,t,r)=>{r.d(t,{xA:()=>l,yg:()=>m});var n=r(6540);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t =0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var c=n.createContext({}),u=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=u(e.components);return n.createElement(c.Provider,{value:t},e.children)},p="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,s=e.originalType,c=e.parentName,l=a(e,["components","mdxType","originalType","parentName"]),p=u(r),f=o,m=p["".concat(c,".").concat(f)]||p[f]||h[f]||s;return r?n.createElement(m,i(i({ref:t},l),{},{components:r})):n.createElement(m,i({ref:t},l))}));function m(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var s=r.length,i=new Array(s);i[0]=f;var a={};for(var c in t)hasOwnProperty.call(t,c)&&(a[c]=t[c]);a.originalType=e,a[p]="string"==typeof e?e:o,i[1]=a;for(var u=2;u {r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>a,toc:()=>u});var n=r(8168),o=(r(6540),r(5680));const s={title:"Cosmos Hub Archives",order:2},i=void 0,a={unversionedId:"resources/archives",id:"resources/archives",title:"Cosmos Hub Archives",description:"With each breaking upgrade of the Cosmos Hub, the network is restarted at height 0. During this process, an export of the last state of the previous network is made to produce the genesis state of the new one.",source:"@site/docs/resources/archives.md",sourceDirName:"resources",slug:"/resources/archives",permalink:"/main/resources/archives",draft:!1,tags:[],version:"current",frontMatter:{title:"Cosmos Hub Archives",order:2},sidebar:"tutorialSidebar",previous:{title:"Resources",permalink:"/main/resources/"},next:{title:"The Genesis File",permalink:"/main/resources/genesis"}},c={},u=[{value:"Big Dipper",id:"big-dipper",level:3}],l={toc:u},p="wrapper";function h(e){let{components:t,...r}=e;return(0,o.yg)(p,(0,n.A)({},l,r,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"With each breaking upgrade of the Cosmos Hub, the network is restarted at height 0. During this process, an export of the last state of the previous network is made to produce the genesis state of the new one."),(0,o.yg)("p",null,"As a result, the blocks of the previous networks are not downloaded by new clients (as they sync from the new genesis state), and may be deleted by existing full-nodes."),(0,o.yg)("p",null,"In an effort to maintain transparency, the interchain hosts archives of the previous versions of the Cosmos Hub network. These archives can be found ",(0,o.yg)("a",{parentName:"p",href:"https://archive.interchain.io/"},"here"),"."),(0,o.yg)("p",null,"If you would like to search explorers for previous hub data, these are some links where you can find the information:"),(0,o.yg)("h3",{id:"big-dipper"},"Big Dipper"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://cosmoshub-1.bigdipper.live/"},"Cosmos Hub 1")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://cosmoshub-2.bigdipper.live/"},"Cosmos Hub 2")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://cosmoshub-3.bigdipper.live/"},"Cosmos Hub 3"))),(0,o.yg)("p",null,"If you want to make archives available to the community, feel free to open a PR to this file and add them."))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4b7d5026.a025ab50.js b/assets/js/4b7d5026.a025ab50.js new file mode 100644 index 00000000000..cd606e3d944 --- /dev/null +++ b/assets/js/4b7d5026.a025ab50.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[7915],{5680:(e,t,r)=>{r.d(t,{xA:()=>u,yg:()=>g});var n=r(6540);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),d=s(r),h=a,g=d["".concat(l,".").concat(h)]||d[h]||p[h]||i;return r?n.createElement(g,o(o({ref:t},u),{},{components:r})):n.createElement(g,o({ref:t},u))}));function g(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=h;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[d]="string"==typeof e?e:a,o[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>c,toc:()=>s});var n=r(8168),a=(r(6540),r(5680));const i={title:"Architecture Decision Records (ADR)",order:1},o=void 0,c={unversionedId:"architecture/README",id:"architecture/README",title:"Architecture Decision Records (ADR)",description:"This is a location to record all high-level architecture decisions for new feature and module proposals in the Cosmos Hub.",source:"@site/docs/architecture/README.md",sourceDirName:"architecture",slug:"/architecture/",permalink:"/main/architecture/",draft:!1,tags:[],version:"current",frontMatter:{title:"Architecture Decision Records (ADR)",order:1},sidebar:"tutorialSidebar",previous:{title:"Service Providers",permalink:"/main/resources/service-providers"},next:{title:"ADR Creation Process",permalink:"/main/architecture/adr/PROCESS"}},l={},s=[{value:"Rationale",id:"rationale",level:2},{value:"Creating new ADR",id:"creating-new-adr",level:2},{value:"Use RFC 2119 Keywords",id:"use-rfc-2119-keywords",level:3},{value:"ADR Table of Contents",id:"adr-table-of-contents",level:2},{value:"Accepted",id:"accepted",level:3},{value:"Proposed",id:"proposed",level:3},{value:"Draft",id:"draft",level:3},{value:"Rejected",id:"rejected",level:3},{value:"Deprecated",id:"deprecated",level:3}],u={toc:s},d="wrapper";function p(e){let{components:t,...r}=e;return(0,a.yg)(d,(0,n.A)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("p",null,"This is a location to record all high-level architecture decisions for new feature and module proposals in the Cosmos Hub."),(0,a.yg)("p",null,"An Architectural Decision (",(0,a.yg)("strong",{parentName:"p"},"AD"),") is a software design choice that addresses a functional or non-functional requirement that is architecturally significant.\nAn Architecturally Significant Requirement (",(0,a.yg)("strong",{parentName:"p"},"ASR"),") is a requirement that has a measurable effect on a software system\u2019s architecture and quality.\nAn Architectural Decision Record (",(0,a.yg)("strong",{parentName:"p"},"ADR"),") captures a single AD, such as often done when writing personal notes or meeting minutes; the collection of ADRs created and maintained in a project constitute its decision log. All these are within the topic of Architectural Knowledge Management (AKM)."),(0,a.yg)("p",null,"You can read more about the ADR concept ",(0,a.yg)("a",{parentName:"p",href:"https://adr.github.io/"},"here"),"."),(0,a.yg)("h2",{id:"rationale"},"Rationale"),(0,a.yg)("p",null,"ADRs are intended to be the primary mechanism for proposing new feature designs and new processes, for collecting community input on an issue, and for documenting the design decisions.\nAn ADR should provide:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Context on the relevant goals and the current state"),(0,a.yg)("li",{parentName:"ul"},"Proposed changes to achieve the goals"),(0,a.yg)("li",{parentName:"ul"},"Summary of pros and cons"),(0,a.yg)("li",{parentName:"ul"},"Discarded solution spaces and why they were discarded"),(0,a.yg)("li",{parentName:"ul"},"References"),(0,a.yg)("li",{parentName:"ul"},"Changelog")),(0,a.yg)("p",null,"Note the distinction between an ADR and a spec. The ADR provides the context, intuition, reasoning, and\njustification for a change in architecture, or for the architecture of something\nnew. The spec is much more compressed and streamlined summary of everything as\nit stands today."),(0,a.yg)("p",null,"If recorded decisions turn out to be lacking, convene a discussion, record the new decisions here, and then modify the code to match."),(0,a.yg)("h2",{id:"creating-new-adr"},"Creating new ADR"),(0,a.yg)("p",null,"Read about the ",(0,a.yg)("a",{parentName:"p",href:"/main/architecture/PROCESS"},"PROCESS"),"."),(0,a.yg)("h3",{id:"use-rfc-2119-keywords"},"Use RFC 2119 Keywords"),(0,a.yg)("p",null,'When writing ADRs, follow the same best practices for writing RFCs.\nWhen writing RFCs, key words are used to signify the requirements in the specification.\nThese words are often capitalized: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL.\nThey are to be interpreted as described in ',(0,a.yg)("a",{parentName:"p",href:"https://datatracker.ietf.org/doc/html/rfc2119"},"RFC 2119"),"."),(0,a.yg)("h2",{id:"adr-table-of-contents"},"ADR Table of Contents"),(0,a.yg)("h3",{id:"accepted"},"Accepted"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"n/a")),(0,a.yg)("h3",{id:"proposed"},"Proposed"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"n/a")),(0,a.yg)("h3",{id:"draft"},"Draft"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"n/a")),(0,a.yg)("h3",{id:"rejected"},"Rejected"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/architecture/adr/adr-001-interchain-accounts"},"ADR 001: Interchain Accounts"))),(0,a.yg)("h3",{id:"deprecated"},"Deprecated"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/architecture/adr/adr-002-globalfee"},"ADR 002: Globalfee Module"))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4bf737c3.30a03efb.js b/assets/js/4bf737c3.30a03efb.js new file mode 100644 index 00000000000..b53c4968965 --- /dev/null +++ b/assets/js/4bf737c3.30a03efb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[4704],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>d});var n=r(6540);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t =0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var u=n.createContext({}),s=function(e){var t=n.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},p=function(e){var t=s(e.components);return n.createElement(u.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(r),f=a,d=c["".concat(u,".").concat(f)]||c[f]||m[f]||i;return r?n.createElement(d,o(o({ref:t},p),{},{components:r})):n.createElement(d,o({ref:t},p))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var l={};for(var u in t)hasOwnProperty.call(t,u)&&(l[u]=t[u]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var n=r(8168),a=(r(6540),r(5680));const i={title:"Gaia Tutorials",order:1},o=void 0,l={unversionedId:"hub-tutorials/README",id:"hub-tutorials/README",title:"Gaia Tutorials",description:"This folder contains tutorials related to the gaiad application.",source:"@site/docs/hub-tutorials/README.md",sourceDirName:"hub-tutorials",slug:"/hub-tutorials/",permalink:"/main/hub-tutorials/",draft:!1,tags:[],version:"current",frontMatter:{title:"Gaia Tutorials",order:1},sidebar:"tutorialSidebar",previous:{title:"System requirements",permalink:"/main/getting-started/system-requirements"},next:{title:"Interacting with Gaiad (CLI)",permalink:"/main/hub-tutorials/gaiad"}},u={},s=[],p={toc:s},c="wrapper";function m(e){let{components:t,...r}=e;return(0,a.yg)(c,(0,n.A)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("p",null,"This folder contains tutorials related to the ",(0,a.yg)("inlineCode",{parentName:"p"},"gaiad")," application."),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/hub-tutorials/gaiad"},"Interacting with the ",(0,a.yg)("inlineCode",{parentName:"a"},"gaiad")," binary")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/hub-tutorials/join-mainnet"},"Running a full-node for the Cosmos Hub Mainnet")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/hub-tutorials/join-testnet"},"Running a full-node for a ",(0,a.yg)("inlineCode",{parentName:"a"},"gaia")," testnet")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/hub-tutorials/upgrade-node"},"Upgrading a node from a previous version")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/main/hub-tutorials/live-upgrade-tutorial"},"Creating an upgrade governance proposal"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4e1cbcac.8af50437.js b/assets/js/4e1cbcac.8af50437.js new file mode 100644 index 00000000000..573d339e8b0 --- /dev/null +++ b/assets/js/4e1cbcac.8af50437.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[791],{5680:(e,t,a)=>{a.d(t,{xA:()=>u,yg:()=>h});var n=a(6540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t =0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var c=n.createContext({}),s=function(e){var t=n.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},u=function(e){var t=s(e.components);return n.createElement(c.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=s(a),m=r,h=p["".concat(c,".").concat(m)]||p[m]||d[m]||i;return a?n.createElement(h,o(o({ref:t},u),{},{components:a})):n.createElement(h,o({ref:t},u))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=m;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[p]="string"==typeof e?e:r,o[1]=l;for(var s=2;s{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var n=a(8168),r=(a(6540),a(5680));const i={},o=void 0,l={unversionedId:"architecture/adr/adr-001-interchain-accounts",id:"architecture/adr/adr-001-interchain-accounts",title:"adr-001-interchain-accounts",description:"\x3c!--",source:"@site/docs/architecture/adr/adr-001-interchain-accounts.md",sourceDirName:"architecture/adr",slug:"/architecture/adr/adr-001-interchain-accounts",permalink:"/main/architecture/adr/adr-001-interchain-accounts",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"README",permalink:"/main/architecture/adr/"},next:{title:"ADR 002: Globalfee Module",permalink:"/main/architecture/adr/adr-002-globalfee"}},c={},s=[{value:"Changelog",id:"changelog",level:2},{value:"Status",id:"status",level:2},{value:"Abstract",id:"abstract",level:2},{value:"Rationale",id:"rationale",level:2},{value:"Desired Outcome",id:"desired-outcome",level:2},{value:"Consequences",id:"consequences",level:2},{value:"Backwards Compatibility",id:"backwards-compatibility",level:4},{value:"Forward Compatibility",id:"forward-compatibility",level:4},{value:"Technical Specification",id:"technical-specification",level:2},{value:"Development",id:"development",level:2},{value:"Governance optional",id:"governance-optional",level:2},{value:"Project Integrations optional",id:"project-integrations-optional",level:2},{value:"Downstream User Impact Report",id:"downstream-user-impact-report",level:4},{value:"Upstream Partner Impact Report",id:"upstream-partner-impact-report",level:4},{value:"Inter-module Dependence Report",id:"inter-module-dependence-report",level:4},{value:"Support",id:"support",level:2},{value:"Additional Research & References",id:"additional-research--references",level:2}],u={toc:s},p="wrapper";function d(e){let{components:t,...a}=e;return(0,r.yg)(p,(0,n.A)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"adr-001-interchain-accounts"},"ADR 001: Interchain Accounts"),(0,r.yg)("h2",{id:"changelog"},"Changelog"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"2022-02-04: added content"),(0,r.yg)("li",{parentName:"ul"},"2022-01-19: init"),(0,r.yg)("li",{parentName:"ul"},"2023-06-28: mark as rejected")),(0,r.yg)("h2",{id:"status"},"Status"),(0,r.yg)("p",null,"REJECTED Not Implemented"),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Reason:")," The IBC team decided to integrate this functionality directly into their codebase and maintain it, because multiple users require it. "),(0,r.yg)("h2",{id:"abstract"},"Abstract"),(0,r.yg)("p",null,'This is the Core Interchain Accounts Module. It allows the Cosmos Hub to act as a host chain with interchain accounts that are controlled by external IBC connected "Controller" blockchains. Candidate chains include Umee, Quicksilver, Sommelier. It is also a necessary component for a Authentication Module that allows the Cosmos Hub to act as a Controller chain as well. This will be recorded in a separate ADR.'),(0,r.yg)("h2",{id:"rationale"},"Rationale"),(0,r.yg)("p",null,"This allows the Hub to participate in advanced cross-chain defi operations, like Liquid Staking and various protocol controlled value applications."),(0,r.yg)("h2",{id:"desired-outcome"},"Desired Outcome"),(0,r.yg)("p",null,"The hub can be used trustlessly as a host chain in the configuration of Interchain Accounts."),(0,r.yg)("h2",{id:"consequences"},"Consequences"),(0,r.yg)("p",null,'There has been preliminary work done to understand if this increases any security feature of the Cosmos Hub. One thought was that this capability is similar to contract to contract interactions which are possible on virtual machine blockchains like EVM chains. Those interactions introduced a new attack vector, called a re-entrancy bug, which was the culprit of "The DAO hack on Ethereum". We believe there is no risk of these kinds of attacks with Interchain Accounts because they require the interactions to be atomic and Interchain Accounts are asynchronous.'),(0,r.yg)("h4",{id:"backwards-compatibility"},"Backwards Compatibility"),(0,r.yg)("p",null,"This is the first of its kind."),(0,r.yg)("h4",{id:"forward-compatibility"},"Forward Compatibility"),(0,r.yg)("p",null,"There are future releases of Interchain Accounts which are expected to be backwards compatible."),(0,r.yg)("h2",{id:"technical-specification"},"Technical Specification"),(0,r.yg)("p",null,(0,r.yg)("a",{parentName:"p",href:"https://github.com/cosmos/ibc/blob/master/spec/app/ics-027-interchain-accounts/README.md"},"ICS-27 Spec")),(0,r.yg)("h2",{id:"development"},"Development"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Integration requirements",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"Development has occurred in ",(0,r.yg)("a",{parentName:"li",href:"https://github.com/cosmos/ibc-go"},"IBC-go")," and progress tracked on the project board there."))),(0,r.yg)("li",{parentName:"ul"},"Testing (Simulations, Core Team Testing, Partner Testing)",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"Simulations and Core Team tested this module"))),(0,r.yg)("li",{parentName:"ul"},"Audits (Internal Dev review, Third-party review, Bug Bounty)",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"An internal audit, an audit from Informal Systems, and an audit from Trail of Bits all took place with fixes made to all findings."))),(0,r.yg)("li",{parentName:"ul"},"Networks (Testnets, Productionnets, Mainnets)",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"Testnets")))),(0,r.yg)("h2",{id:"governance-optional"},"Governance ","[optional]"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Needs Signaling Proposal")),(0,r.yg)("li",{parentName:"ul"},"Core Community Governance",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"N/A"))),(0,r.yg)("li",{parentName:"ul"},"Steering Community",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"N/A. Possibly Aditya Srinpal, Sean King, Bez?"))),(0,r.yg)("li",{parentName:"ul"},"Timelines & Roadmap",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"Expected to be released as part of IBC 3.0 in Feb 2022 (currently in ",(0,r.yg)("a",{parentName:"li",href:"https://github.com/cosmos/ibc-go/releases/tag/v3.0.0-beta1"},"beta release"),")")))),(0,r.yg)("h2",{id:"project-integrations-optional"},"Project Integrations ","[optional]"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Gaia Integrations",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/cosmos/gaia/pull/1150"},"PR")))),(0,r.yg)("li",{parentName:"ul"},"Integration Partner",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},"IBC Team")))),(0,r.yg)("h4",{id:"downstream-user-impact-report"},"Downstream User Impact Report"),(0,r.yg)("p",null,"(Needs to be created)"),(0,r.yg)("h4",{id:"upstream-partner-impact-report"},"Upstream Partner Impact Report"),(0,r.yg)("p",null,"(Needs to be created)"),(0,r.yg)("h4",{id:"inter-module-dependence-report"},"Inter-module Dependence Report"),(0,r.yg)("p",null,"(Needs to be created)"),(0,r.yg)("h2",{id:"support"},"Support"),(0,r.yg)("p",null,(0,r.yg)("a",{parentName:"p",href:"https://ibc.cosmos.network/main/apps/interchain-accounts/overview.html"},"Documentation")),(0,r.yg)("h2",{id:"additional-research--references"},"Additional Research & References"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://medium.com/chainapsis/why-interchain-accounts-change-everything-for-cosmos-interoperability-59c19032bf11"},"Why Interchain Accounts Change Everything for Cosmos Interoperability")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/cosmos/interchain-accounts"},"Interchain Account Auth Module Demo Repo"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/54f44165.2dc69c8d.js b/assets/js/54f44165.2dc69c8d.js new file mode 100644 index 00000000000..5e130775936 --- /dev/null +++ b/assets/js/54f44165.2dc69c8d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[7924],{5680:(e,a,t)=>{t.d(a,{xA:()=>p,yg:()=>c});var n=t(6540);function i(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function l(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function r(e){for(var a=1;a =0||(i[t]=e[t]);return i}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=n.createContext({}),g=function(e){var a=n.useContext(s),t=a;return e&&(t="function"==typeof e?e(a):r(r({},a),e)),t},p=function(e){var a=g(e.components);return n.createElement(s.Provider,{value:a},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},m=n.forwardRef((function(e,a){var t=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=g(t),m=i,c=u["".concat(s,".").concat(m)]||u[m]||d[m]||l;return t?n.createElement(c,r(r({ref:a},p),{},{components:t})):n.createElement(c,r({ref:a},p))}));function c(e,a){var t=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var l=t.length,r=new Array(l);r[0]=m;var o={};for(var s in a)hasOwnProperty.call(a,s)&&(o[s]=a[s]);o.originalType=e,o[u]="string"==typeof e?e:i,r[1]=o;for(var g=2;g {t.r(a),t.d(a,{assets:()=>s,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>g});var n=t(8168),i=(t(6540),t(5680));const l={title:"Installing Gaia",sidebar_position:2},r=void 0,o={unversionedId:"getting-started/installation",id:"getting-started/installation",title:"Installing Gaia",description:"This guide will explain how to install the gaiad binary and run the cli. With this binary installed on a server, you can participate on the mainnet as either a Full Node or a Validator.",source:"@site/docs/getting-started/installation.md",sourceDirName:"getting-started",slug:"/getting-started/installation",permalink:"/main/getting-started/installation",draft:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{title:"Installing Gaia",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"What is Gaia?",permalink:"/main/getting-started/what-is-gaia"},next:{title:"Quick Start - Join Mainnet",permalink:"/main/getting-started/quickstart"}},s={},g=[{value:"Build Requirements",id:"build-requirements",level:2},{value:"Build Tools",id:"build-tools",level:2},{value:"Install Go",id:"install-go",level:2},{value:"Install the binaries",id:"install-the-binaries",level:2},{value:"Docker",id:"docker",level:2},{value:"Static linking",id:"static-linking",level:2},{value:"Build Tags",id:"build-tags",level:3},{value:"Work with a Cosmos SDK Clone",id:"work-with-a-cosmos-sdk-clone",level:2},{value:"Next",id:"next",level:2}],p={toc:g},u="wrapper";function d(e){let{components:a,...t}=e;return(0,i.yg)(u,(0,n.A)({},p,t,{components:a,mdxType:"MDXLayout"}),(0,i.yg)("p",null,"This guide will explain how to install the ",(0,i.yg)("inlineCode",{parentName:"p"},"gaiad")," binary and run the cli. With this binary installed on a server, you can participate on the mainnet as either a ",(0,i.yg)("a",{parentName:"p",href:"/main/hub-tutorials/join-mainnet"},"Full Node")," or a ",(0,i.yg)("a",{parentName:"p",href:"/main/validators/validator-setup"},"Validator"),"."),(0,i.yg)("h2",{id:"build-requirements"},"Build Requirements"),(0,i.yg)("p",null,"At present, the SDK fully supports installation on linux distributions. For the purpose of this instruction set, we'll be using ",(0,i.yg)("inlineCode",{parentName:"p"},"Ubuntu 22.04 LTS"),". It is also possible to install ",(0,i.yg)("inlineCode",{parentName:"p"},"gaiad")," on Unix, while Windows may require additional unsupported third party installation. All steps are listed below for a clean install."),(0,i.yg)("ol",null,(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("a",{parentName:"li",href:"#build-tools"},"Update & install build tools")),(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("a",{parentName:"li",href:"#install-go"},"Install Go")),(0,i.yg)("li",{parentName:"ol"},(0,i.yg)("a",{parentName:"li",href:"#install-the-binaries"},"Install ",(0,i.yg)("inlineCode",{parentName:"a"},"Gaiad")," binaries"))),(0,i.yg)("h2",{id:"build-tools"},"Build Tools"),(0,i.yg)("p",null,"Install ",(0,i.yg)("inlineCode",{parentName:"p"},"make")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"gcc"),"."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Ubuntu:")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-bash"},"sudo apt update\n\nsudo apt install -y make gcc build-essential\n")),(0,i.yg)("h2",{id:"install-go"},"Install Go"),(0,i.yg)("admonition",{type:"tip"},(0,i.yg)("p",{parentName:"admonition"},(0,i.yg)("strong",{parentName:"p"},"Go 1.22+")," is required.")),(0,i.yg)("p",null,"We suggest the following two ways to install Go. Check out the ",(0,i.yg)("a",{parentName:"p",href:"https://golang.org/doc/install"},"official docs")," and Go installer for the correct download for your operating system. Alternatively, you can install Go yourself from the command line. Detailed below are standard default installation locations, but feel free to customize."),(0,i.yg)("p",null,"Since the introduction of CosmWasm in Gaia v18 it is recommended to build the binaries with ",(0,i.yg)("inlineCode",{parentName:"p"},"CGO")," enabled - simply set ",(0,i.yg)("inlineCode",{parentName:"p"},"CGO_ENABLED=1")," in your terminal before building the binary."),(0,i.yg)("p",null,"Building the ",(0,i.yg)("inlineCode",{parentName:"p"},"gaiad")," binary on Windows is not supported due to ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/CosmWasm/wasmvm"},"dependency issues"),"."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},(0,i.yg)("a",{parentName:"strong",href:"https://go.dev/dl/"},"Go Binary Downloads"))),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Ubuntu:")),(0,i.yg)("p",null,"At the time of this writing, the latest release is ",(0,i.yg)("inlineCode",{parentName:"p"},"1.22.3"),". We're going to download the tarball, extract it to ",(0,i.yg)("inlineCode",{parentName:"p"},"/usr/local"),", and export ",(0,i.yg)("inlineCode",{parentName:"p"},"GOROOT")," to our ",(0,i.yg)("inlineCode",{parentName:"p"},"$PATH")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-bash"},"curl -OL https://go.dev/dl/go1.22.3.darwin-amd64.tar.gz\n\nsudo tar -C /usr/local -xvf https://go.dev/dl/go1.22.3.darwin-amd64.tar.gz\n\n\nexport PATH=$PATH:/usr/local/go/bin\n\n")),(0,i.yg)("p",null,"Remember to add ",(0,i.yg)("inlineCode",{parentName:"p"},"GOPATH")," to your ",(0,i.yg)("inlineCode",{parentName:"p"},"$PATH")," environment variable. If you're not sure where that is, run ",(0,i.yg)("inlineCode",{parentName:"p"},"go env GOPATH"),". This will allow us to run the ",(0,i.yg)("inlineCode",{parentName:"p"},"gaiad")," binary in the next step. If you're not sure how to set your ",(0,i.yg)("inlineCode",{parentName:"p"},"$PATH")," take a look at ",(0,i.yg)("a",{parentName:"p",href:"https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them"},"these instructions"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-bash"},"export PATH=$PATH:$(go env GOPATH)/bin\n")),(0,i.yg)("h2",{id:"install-the-binaries"},"Install the binaries"),(0,i.yg)("p",null,"Next, let's install the latest version of Gaia. Make sure you ",(0,i.yg)("inlineCode",{parentName:"p"},"git checkout")," the\ncorrect ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/cosmos/gaia/releases"},"released version"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-bash"},"git clone -b https://github.com/cosmos/gaia.git\ncd gaia && make install\n")),(0,i.yg)("p",null,"If this command fails due to the following error message, you might have already set ",(0,i.yg)("inlineCode",{parentName:"p"},"LDFLAGS")," prior to running this step."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-sh"},"# github.com/cosmos/gaia/cmd/gaiad\nflag provided but not defined: -L\nusage: link [options] main.o\n...\nmake: *** [install] Error 2\n")),(0,i.yg)("p",null,"Unset this environment variable and try again."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-sh"},'LDFLAGS="" make install\n')),(0,i.yg)("blockquote",null,(0,i.yg)("p",{parentName:"blockquote"},(0,i.yg)("em",{parentName:"p"},"NOTE"),": If you still have issues at this step, please check that you have the latest stable version of GO installed.")),(0,i.yg)("p",null,"That will install the ",(0,i.yg)("inlineCode",{parentName:"p"},"gaiad")," binary. Verify that everything installed successfully by running:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad version --long\n")),(0,i.yg)("p",null,"You should see something similar to the following:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-bash"},"name: gaia\nserver_name: gaiad\nversion: v18.0.0\ncommit: 682770f2410ab0d33ac7f0c7203519d7a99fa2b6\nbuild_tags: netgo,ledger,muslc\ngo: go version go1.22.3 linux/amd64\n")),(0,i.yg)("h2",{id:"docker"},"Docker"),(0,i.yg)("p",null,(0,i.yg)("inlineCode",{parentName:"p"},"Dockerfile")," is available in the gaia repo."),(0,i.yg)("p",null,"Building:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-shell"},"git clone -b https://github.com/cosmos/gaia.git\ncd gaia\ndocker build -t cosmos-ics:local -f Dockerfile ./\n")),(0,i.yg)("h2",{id:"static-linking"},"Static linking"),(0,i.yg)("p",null,"In case you need to build a binary with all dependencies statically linked please check our ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/cosmos/gaia/blob/main/Dockerfile"},"Dockerfile"),"."),(0,i.yg)("p",null,"You must have ",(0,i.yg)("inlineCode",{parentName:"p"},"libwasmvm")," available on your machine.\nChoose the build that matches your platform and OS:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("a",{parentName:"li",href:"https://github.com/CosmWasm/wasmvm?tab=readme-ov-file#builds-of-libwasmvm"},"https://github.com/CosmWasm/wasmvm?tab=readme-ov-file#builds-of-libwasmvm"))),(0,i.yg)("p",null,"For more information, please check ",(0,i.yg)("inlineCode",{parentName:"p"},"wasmvm")," ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/CosmWasm/wasmvm"},"documentation"),"."),(0,i.yg)("h3",{id:"build-tags"},"Build Tags"),(0,i.yg)("p",null,"Build tags indicate special features that have been enabled in the binary."),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Build Tag"),(0,i.yg)("th",{parentName:"tr",align:null},"Description"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"netgo"),(0,i.yg)("td",{parentName:"tr",align:null},"Name resolution will use pure Go code")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"ledger"),(0,i.yg)("td",{parentName:"tr",align:null},"Ledger devices are supported (hardware wallets)")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"static_wasm/muslc"),(0,i.yg)("td",{parentName:"tr",align:null},"Used for statically linked wasmd dependencies")))),(0,i.yg)("h2",{id:"work-with-a-cosmos-sdk-clone"},"Work with a Cosmos SDK Clone"),(0,i.yg)("p",null,"To work with your own modifications of the Cosmos SDK, make a fork of this repo, and add a ",(0,i.yg)("inlineCode",{parentName:"p"},"replace")," clause to the ",(0,i.yg)("inlineCode",{parentName:"p"},"go.mod")," file.\nThe ",(0,i.yg)("inlineCode",{parentName:"p"},"replace")," clause you add to ",(0,i.yg)("inlineCode",{parentName:"p"},"go.mod")," must provide the correct import path."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-shell"},"go mod edit -replace github.com/cosmos/cosmos-sdk=../cosmos-sdk\ngo mod tidy\nmake install # or make build\n")),(0,i.yg)("h2",{id:"next"},"Next"),(0,i.yg)("p",null,"Now you can ",(0,i.yg)("a",{parentName:"p",href:"../hub-tutorials/join-mainnet"},"join the mainnet"),", ",(0,i.yg)("a",{parentName:"p",href:"../hub-tutorials/join-testnet"},"the public testnet"),"."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5d489d3c.f34e6f03.js b/assets/js/5d489d3c.f34e6f03.js new file mode 100644 index 00000000000..c6fdcaf042e --- /dev/null +++ b/assets/js/5d489d3c.f34e6f03.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[8257],{7757:s=>{s.exports=JSON.parse('{"name":"docusaurus-theme-search-algolia","id":"default"}')}}]); \ No newline at end of file diff --git a/assets/js/5fd51807.8fef9132.js b/assets/js/5fd51807.8fef9132.js new file mode 100644 index 00000000000..83ba512c6d0 --- /dev/null +++ b/assets/js/5fd51807.8fef9132.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[6331],{5680:(e,n,t)=>{t.d(n,{xA:()=>s,yg:()=>h});var a=t(6540);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n =0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a =0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=a.createContext({}),u=function(e){var n=a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},s=function(e){var n=u(e.components);return a.createElement(l.Provider,{value:n},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},c=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),d=u(t),c=r,h=d["".concat(l,".").concat(c)]||d[c]||g[c]||o;return t?a.createElement(h,i(i({ref:n},s),{},{components:t})):a.createElement(h,i({ref:n},s))}));function h(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,i=new Array(o);i[0]=c;var p={};for(var l in n)hasOwnProperty.call(n,l)&&(p[l]=n[l]);p.originalType=e,p[d]="string"==typeof e?e:r,i[1]=p;for(var u=2;u {t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>g,frontMatter:()=>o,metadata:()=>p,toc:()=>u});var a=t(8168),r=(t(6540),t(5680));const o={title:"Upgrading the Chain",order:6},i=void 0,p={unversionedId:"hub-tutorials/live-upgrade-tutorial",id:"hub-tutorials/live-upgrade-tutorial",title:"Upgrading the Chain",description:"This document demonstrates how a live upgrade can be performed on-chain through a",source:"@site/docs/hub-tutorials/live-upgrade-tutorial.md",sourceDirName:"hub-tutorials",slug:"/hub-tutorials/live-upgrade-tutorial",permalink:"/main/hub-tutorials/live-upgrade-tutorial",draft:!1,tags:[],version:"current",frontMatter:{title:"Upgrading the Chain",order:6},sidebar:"tutorialSidebar",previous:{title:"Joining Testnet",permalink:"/main/hub-tutorials/join-testnet"},next:{title:"Upgrading Your Node",permalink:"/main/hub-tutorials/upgrade-node"}},l={},u=[],s={toc:u},d="wrapper";function g(e){let{components:n,...t}=e;return(0,r.yg)(d,(0,a.A)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"This document demonstrates how a live upgrade can be performed on-chain through a\ngovernance process."),(0,r.yg)("ol",null,(0,r.yg)("li",{parentName:"ol"},(0,r.yg)("p",{parentName:"li"},"Start the network and trigger upgrade"),(0,r.yg)("pre",{parentName:"li"},(0,r.yg)("code",{parentName:"pre",className:"language-bash"},'# start a gaia application full-node\n$ gaiad start\n\n# set up the cli config\n$ gaiad config chain-id testing\n\n# create an upgrade governance proposal\n$ gaiad tx gov submit-proposal --from \n\nWhere proposal json file contains MsgSoftwareUpgrade e.g.\n`{\n "messages": [\n {\n "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",\n "authority":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn" ,\n "plan": {\n "name": "plan name",\n "height": "1000" ,\n "info": "proposal info" ,\n "upgraded_client_state": null\n }\n }\n ],\n "metadata": "ipfs://CID",\n "deposit": "10000000stake",\n "title": "proposal title",\n "summary": "proposal summary"\n}`\n\n')))),(0,r.yg)("h1",{id:"once-the-proposal-passes-you-can-query-the-pending-plan"},"once the proposal passes you can query the pending plan"),(0,r.yg)("p",null," $ gaiad query upgrade plan"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre"},'\n2. Performing an upgrade\n\nAssuming the proposal passes the chain will stop at given upgrade height.\n\nYou can stop and start the original binary all you want, but **it will refuse to\nrun after the upgrade height**.\n\nWe need a new binary with the upgrade handler installed. The logs should look\nsomething like:\n\n```bash\nE[2019-11-05|12:44:18.913] UPGRADE " " NEEDED at height: : module=main\nE[2019-11-05|12:44:18.914] CONSENSUS FAILURE!!!\n...\n')),(0,r.yg)("p",null," Note that the process will hang indefinitely (doesn't exit to avoid restart loops). So, you must\nmanually kill the process and replace it with a new binary. Do so now with ",(0,r.yg)("inlineCode",{parentName:"p"},"Ctrl+C")," or ",(0,r.yg)("inlineCode",{parentName:"p"},"killall gaiad"),"."),(0,r.yg)("p",null," In ",(0,r.yg)("inlineCode",{parentName:"p"},"gaia/app/app.go"),", after ",(0,r.yg)("inlineCode",{parentName:"p"},"upgrade.Keeper")," is initialized and set in the app, set the\ncorresponding upgrade ",(0,r.yg)("inlineCode",{parentName:"p"},"Handler")," with the correct ",(0,r.yg)("inlineCode",{parentName:"p"}," "),":"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-go"},' app.upgradeKeeper.SetUpgradeHandler(" ", func(ctx sdk.Context, plan upgrade.Plan) {\n // custom logic after the network upgrade has been executed\n })\n')),(0,r.yg)("p",null," Note that we panic on any error - this would cause the upgrade to fail if the\nmigration could not be run, and no node would advance - allowing a manual recovery.\nIf we ignored the errors, then we would proceed with an incomplete upgrade and\nhave a very difficult time every recovering the proper state."),(0,r.yg)("p",null," Now, compile the new binary and run the upgraded code to complete the upgrade:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},"# create a new binary of gaia with the added upgrade handler\n$ make install\n\n# Restart the chain using the new binary. You should see the chain resume from\n# the upgrade height:\n# `I[2019-11-05|12:48:15.184] applying upgrade at height: module=main`\n$ gaiad start\n\n# verify there is no pending plan\n$ gaiad query upgrade plan\n\n# verify you can query the block header of the completed upgrade\n$ gaiad query upgrade applied \n")))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6294a1b0.1ce4e36d.js b/assets/js/6294a1b0.1ce4e36d.js new file mode 100644 index 00000000000..f8ec2c3649a --- /dev/null +++ b/assets/js/6294a1b0.1ce4e36d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[6840],{5680:(e,n,a)=>{a.d(n,{xA:()=>u,yg:()=>m});var t=a(6540);function o(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function i(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function r(e){for(var n=1;n =0||(o[a]=e[a]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t =0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}var s=t.createContext({}),c=function(e){var n=t.useContext(s),a=n;return e&&(a="function"==typeof e?e(n):r(r({},n),e)),a},u=function(e){var n=c(e.components);return t.createElement(s.Provider,{value:n},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},p=t.forwardRef((function(e,n){var a=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=c(a),p=o,m=d["".concat(s,".").concat(p)]||d[p]||g[p]||i;return a?t.createElement(m,r(r({ref:n},u),{},{components:a})):t.createElement(m,r({ref:n},u))}));function m(e,n){var a=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var i=a.length,r=new Array(i);r[0]=p;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[d]="string"==typeof e?e:o,r[1]=l;for(var c=2;c{a.r(n),a.d(n,{assets:()=>s,contentTitle:()=>r,default:()=>g,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var t=a(8168),o=(a(6540),a(5680));const i={title:"Service Providers",order:4},r=void 0,l={unversionedId:"resources/service-providers",id:"resources/service-providers",title:"Service Providers",description:"'Service Providers' are defined as entities that provide services for end-users that involve some form of interaction with the Cosmos Hub. More specifically, this document is focused on interactions with tokens.",source:"@site/docs/resources/service-providers.md",sourceDirName:"resources",slug:"/resources/service-providers",permalink:"/main/resources/service-providers",draft:!1,tags:[],version:"current",frontMatter:{title:"Service Providers",order:4},sidebar:"tutorialSidebar",previous:{title:"Building Gaia Deterministically",permalink:"/main/resources/reproducible-builds"},next:{title:"Architecture Decision Records (ADR)",permalink:"/main/architecture/"}},s={},c=[{value:"Connection Options",id:"connection-options",level:2},{value:"Running a Full Node",id:"running-a-full-node",level:2},{value:"What is a Full Node?",id:"what-is-a-full-node",level:3},{value:"Installation and Configuration",id:"installation-and-configuration",level:3},{value:"Command-Line Interface",id:"command-line-interface",level:2},{value:"Available Commands",id:"available-commands",level:3},{value:"Remote Access to gaiad",id:"remote-access-to-gaiad",level:3},{value:"Create a Key Pair",id:"create-a-key-pair",level:3},{value:"Check your Account",id:"check-your-account",level:4},{value:"Check your Balance",id:"check-your-balance",level:3},{value:"Send Coins Using the CLI",id:"send-coins-using-the-cli",level:4},{value:"REST API",id:"rest-api",level:2},{value:"Listen for Incoming Transactions",id:"listen-for-incoming-transactions",level:3}],u={toc:c},d="wrapper";function g(e){let{components:n,...a}=e;return(0,o.yg)(d,(0,t.A)({},u,a,{components:n,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"'Service Providers' are defined as entities that provide services for end-users that involve some form of interaction with the Cosmos Hub. More specifically, this document is focused on interactions with tokens."),(0,o.yg)("p",null,"Service Providers are expected to act as trusted points of contact to the blockchain for their end-users. This Service Providers section does not apply to wallet builders that want to provide Light Client functionalities."),(0,o.yg)("p",null,"This document describes:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#connection-options"},"Connection Options")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#running-a-full-node"},"Running a Full Node"),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#what-is-a-full-node"},"What is a Full Node?")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#installation-and-configuration"},"Installation and Configuration")))),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#command-line-interface"},"Command-Line Interface"),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#available-commands"},"Available Commands")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#remote-access-to-gaiad"},"Remote Access to gaiad")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#create-a-key-pair"},"Create a Key Pair"),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#check-your-account"},"Check your Account")))),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#check-your-balance"},"Check your Balance"),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#send-coins-using-the-cli"},"Send Coins Using the CLI")))))),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#rest-api"},"REST API"),(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"#listen-for-incoming-transactions"},"Listen for Incoming Transactions"))))),(0,o.yg)("h2",{id:"connection-options"},"Connection Options"),(0,o.yg)("p",null,"There are four main technologies to consider to connect to the Cosmos Hub:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Full Nodes: Interact with the blockchain."),(0,o.yg)("li",{parentName:"ul"},"REST Server: Serves for HTTP calls."),(0,o.yg)("li",{parentName:"ul"},"REST API: Use available endpoints for the REST Server."),(0,o.yg)("li",{parentName:"ul"},"GRPC: Connect to the Cosmos Hub using gRPC.")),(0,o.yg)("h2",{id:"running-a-full-node"},"Running a Full Node"),(0,o.yg)("h3",{id:"what-is-a-full-node"},"What is a Full Node?"),(0,o.yg)("p",null,"A Full Node is a network node that syncs up with the state of the blockchain. It provides blockchain data to others by using RESTful APIs, a replica of the database by exposing data with interfaces. A Full Node keeps in syncs with the rest of the blockchain nodes and stores the state on disk. If the full node does not have the queried block on disk the full node can go find the blockchain where the queried data lives."),(0,o.yg)("h3",{id:"installation-and-configuration"},"Installation and Configuration"),(0,o.yg)("p",null,"This section describes the steps to run and interact with a full node for the Cosmos Hub."),(0,o.yg)("p",null,"First, you need to ",(0,o.yg)("a",{parentName:"p",href:"../getting-started/installation"},"install the software"),"."),(0,o.yg)("p",null,"Consider running your own ",(0,o.yg)("a",{parentName:"p",href:"../hub-tutorials/join-mainnet"},"Cosmos Hub Full Node"),"."),(0,o.yg)("h2",{id:"command-line-interface"},"Command-Line Interface"),(0,o.yg)("p",null,"The command-line interface (CLI) is the most powerful tool to access the Cosmos Hub and use gaia.\nTo use the CLI, you must install the latest version of ",(0,o.yg)("inlineCode",{parentName:"p"},"gaia")," on your machine."),(0,o.yg)("p",null,"Compare your version with the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/gaia/releases"},"latest release version")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad version --long\n")),(0,o.yg)("h3",{id:"available-commands"},"Available Commands"),(0,o.yg)("p",null,"All available CLI commands are shown when you run the ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad\n")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'Stargate Cosmos Hub App\n\nUsage:\n gaiad [command]\n\nAvailable Commands:\n\n\n add-genesis-account Add a genesis account to genesis.json\n collect-gentxs Collect genesis txs and output a genesis.json file\n debug Tool for helping with debugging your application\n export Export state to JSON\n gentx Generate a genesis tx carrying a self delegation\n help Help about any command\n init Initialize private validator, p2p, genesis, and application configuration files\n keys Manage your application\'s keys\n migrate Migrate genesis to a specified target version\n query Querying subcommands\n start Run the full node\n status Query remote node for status\n tendermint Tendermint subcommands\n testnet Initialize files for a simapp testnet\n tx Transactions subcommands\n unsafe-reset-all Resets the blockchain database, removes address book files, and resets data/priv_validator_state.json to the genesis state\n validate-genesis validates the genesis file at the default location or at the location passed as an arg\n version Print the application binary version information\n\nFlags:\n -h, --help help for gaiad\n --home string directory for config and data (default "/Users/tobias/.gaia")\n --log_format string The logging format (json|plain) (default "plain")\n --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")\n --trace print out full stack trace on errors\n\nUse "gaiad [command] --help" for more information about a command.\n')),(0,o.yg)("p",null,"For each displayed command, you can use the ",(0,o.yg)("inlineCode",{parentName:"p"},"--help")," flag to get further information."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'gaiad query --help\nUsage:\n gaiad query [flags]\n gaiad query [command]\n\nAliases:\n query, q\n\nAvailable Commands:\n account Query for account by address\n auth Querying commands for the auth module\n bank Querying commands for the bank module\n block Get verified data for a the block at given height\n distribution Querying commands for the distribution module\n evidence Query for evidence by hash or for all (paginated) submitted evidence\n gov Querying commands for the governance module\n ibc Querying commands for the IBC module\n ibc-transfer IBC fungible token transfer query subcommands\n mint Querying commands for the minting module\n params Querying commands for the params module\n slashing Querying commands for the slashing module\n staking Querying commands for the staking module\n tendermint-validator-set Get the full tendermint validator set at given height\n tx Query for a transaction by hash in a committed block\n txs Query for paginated transactions that match a set of events\n upgrade Querying commands for the upgrade module\n\nFlags:\n --chain-id string The network chain ID\n -h, --help help for query\n\nGlobal Flags:\n --home string directory for config and data (default "/Users/tobias/.gaia")\n --log_format string The logging format (json|plain) (default "plain")\n --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")\n --trace print out full stack trace on errors\n\nUse "gaiad query [command] --help" for more information about a command.\n')),(0,o.yg)("h3",{id:"remote-access-to-gaiad"},"Remote Access to gaiad"),(0,o.yg)("p",null,"When choosing to remote access a Full Node and gaiad, you need a Full Node running and gaia installed on your local machine."),(0,o.yg)("p",null,(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," is the tool that enables you to interact with the node that runs on the Cosmos Hub network, whether you run it yourself or not."),(0,o.yg)("p",null,"To set up ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," on a local machine and connect to an existing full node, use the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad config \n")),(0,o.yg)("p",null,"First, set up the address of the full node you want to connect to:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad config node : \n")),(0,o.yg)("p",null,"You will be asked to create a password (at least 8 characters) for this key-pair. This will return the information listed below:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"NAME"),": Name of your key"),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"TYPE"),": Type of your key, always ",(0,o.yg)("inlineCode",{parentName:"li"},"local"),"."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"ADDRESS"),": Your address. Used to receive funds."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"PUBKEY"),": Your public key. Useful for validators."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"MNEMONIC"),": 24-word phrase. ",(0,o.yg)("strong",{parentName:"li"},"Save this mnemonic somewhere safe"),". This phrase is required to recover your private key in case you forget the password. The mnemonic is displayed at the end of the output.")),(0,o.yg)("p",null,"You can see all available keys by typing:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys list\n")),(0,o.yg)("p",null,"Use the ",(0,o.yg)("inlineCode",{parentName:"p"},"--recover")," flag to add a key that imports a mnemonic to your keyring."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add --recover\n")),(0,o.yg)("h4",{id:"check-your-account"},"Check your Account"),(0,o.yg)("p",null,"You can view your account by using the ",(0,o.yg)("inlineCode",{parentName:"p"},"query account")," command."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query account \n")),(0,o.yg)("p",null,"It will display your account type, account number, public key and current account sequence."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"'@type': /cosmos.auth.v1beta1.BaseAccount\naccount_number: \"xxxx\"\naddress: cosmosxxxx\npub_key:\n '@type': /cosmos.crypto.secp256k1.PubKey\n key: xxx\nsequence: \"x\"\n")),(0,o.yg)("h3",{id:"check-your-balance"},"Check your Balance"),(0,o.yg)("p",null,"Query the account balance with the command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query bank balances \n")),(0,o.yg)("p",null,"The response contains keys ",(0,o.yg)("inlineCode",{parentName:"p"},"balances")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"pagination"),".\nEach ",(0,o.yg)("inlineCode",{parentName:"p"},"balances")," entry contains an ",(0,o.yg)("inlineCode",{parentName:"p"},"amount")," held, connected to a ",(0,o.yg)("inlineCode",{parentName:"p"},"denom")," identifier.\nThe typical $ATOM token is identified by the denom ",(0,o.yg)("inlineCode",{parentName:"p"},"uatom"),". Where 1 ",(0,o.yg)("inlineCode",{parentName:"p"},"uatom")," is 0.000001 ATOM."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'balances:\n- amount: "12345678"\n denom: uatom\npagination:\n next_key: null\n total: "0"\n')),(0,o.yg)("p",null,"When you query an account that has not received any token yet, the ",(0,o.yg)("inlineCode",{parentName:"p"},"balances")," entry is shown as an empty array."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'balances: []\npagination:\n next_key: null\n total: "0"\n')),(0,o.yg)("h4",{id:"send-coins-using-the-cli"},"Send Coins Using the CLI"),(0,o.yg)("p",null,"To send coins using the CLI:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send [from_key_or_address] [to_address] [amount] [flags]\n")),(0,o.yg)("p",null,"Parameters:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"}," "),": Key name or address of sending account."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"}," "),": Address of the recipient."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"}," "),": This parameter accepts the format ",(0,o.yg)("inlineCode",{parentName:"li"}," "),", such as ",(0,o.yg)("inlineCode",{parentName:"li"},"1000000uatom"),".")),(0,o.yg)("p",null,"Flags:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"--chain-id"),": This flag allows you to specify the id of the chain. There are different ids for different testnet chains and mainnet chains."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"--gas-prices"),": This flag allows you to specify the gas prices you pay for the transaction. The format is used as ",(0,o.yg)("inlineCode",{parentName:"li"},"0.0025uatom"))),(0,o.yg)("h2",{id:"rest-api"},"REST API"),(0,o.yg)("p",null,"The REST API documents list all the available endpoints that you can use to interact\nwith your full node. Learn ",(0,o.yg)("a",{parentName:"p",href:"/main/hub-tutorials/join-mainnet#enable-the-rest-api"},"how to enable the REST API")," on your full node."),(0,o.yg)("h3",{id:"listen-for-incoming-transactions"},"Listen for Incoming Transactions"),(0,o.yg)("p",null,"The recommended way to listen for incoming transactions is to periodically query the blockchain by using the following HTTP endpoint:"),(0,o.yg)("p",null,(0,o.yg)("inlineCode",{parentName:"p"},"/cosmos/bank/v1beta1/balances/{address}")))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/62b775bc.4dabb2fb.js b/assets/js/62b775bc.4dabb2fb.js new file mode 100644 index 00000000000..f17498853c1 --- /dev/null +++ b/assets/js/62b775bc.4dabb2fb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[7335],{5680:(e,t,r)=>{r.d(t,{xA:()=>u,yg:()=>f});var n=r(6540);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t =0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var c=n.createContext({}),s=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(c.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=s(r),g=o,f=p["".concat(c,".").concat(g)]||p[g]||d[g]||a;return r?n.createElement(f,l(l({ref:t},u),{},{components:r})):n.createElement(f,l({ref:t},u))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,l=new Array(a);l[0]=g;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i[p]="string"==typeof e?e:o,l[1]=i;for(var s=2;s{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>s});var n=r(8168),o=(r(6540),r(5680));const a={title:"Delegators",order:1},l=void 0,i={unversionedId:"delegators/README",id:"delegators/README",title:"Delegators",description:"This folder contains documentation relevant to delegators of the Cosmos Hub and other gaia blockchains.",source:"@site/docs/delegators/README.md",sourceDirName:"delegators",slug:"/delegators/",permalink:"/main/delegators/",draft:!1,tags:[],version:"current",frontMatter:{title:"Delegators",order:1},sidebar:"tutorialSidebar",previous:{title:"Upgrading Your Node",permalink:"/main/hub-tutorials/upgrade-node"},next:{title:"Delegator FAQ",permalink:"/main/delegators/delegator-faq"}},c={},s=[],u={toc:s},p="wrapper";function d(e){let{components:t,...r}=e;return(0,o.yg)(p,(0,n.A)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"This folder contains documentation relevant to delegators of the Cosmos Hub and other ",(0,o.yg)("inlineCode",{parentName:"p"},"gaia")," blockchains."),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/delegators/delegator-guide-cli"},"Delegator CLI Guide")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/delegators/delegator-faq"},"Delegators FAQ")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/delegators/delegator-security"},"Delegator Security Notice"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/62f354e1.feac769b.js b/assets/js/62f354e1.feac769b.js new file mode 100644 index 00000000000..0dbca635570 --- /dev/null +++ b/assets/js/62f354e1.feac769b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[587],{5680:(e,n,a)=>{a.d(n,{xA:()=>g,yg:()=>m});var t=a(6540);function o(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function r(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function i(e){for(var n=1;n =0||(o[a]=e[a]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t =0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}var l=t.createContext({}),p=function(e){var n=t.useContext(l),a=n;return e&&(a="function"==typeof e?e(n):i(i({},n),e)),a},g=function(e){var n=p(e.components);return t.createElement(l.Provider,{value:n},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},c=t.forwardRef((function(e,n){var a=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,g=s(e,["components","mdxType","originalType","parentName"]),u=p(a),c=o,m=u["".concat(l,".").concat(c)]||u[c]||d[c]||r;return a?t.createElement(m,i(i({ref:n},g),{},{components:a})):t.createElement(m,i({ref:n},g))}));function m(e,n){var a=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var r=a.length,i=new Array(r);i[0]=c;var s={};for(var l in n)hasOwnProperty.call(n,l)&&(s[l]=n[l]);s.originalType=e,s[u]="string"==typeof e?e:o,i[1]=s;for(var p=2;p {a.r(n),a.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>r,metadata:()=>s,toc:()=>p});var t=a(8168),o=(a(6540),a(5680));const r={title:"Upgrading Your Node",order:4},i="Upgrade Your Node",s={unversionedId:"hub-tutorials/upgrade-node",id:"hub-tutorials/upgrade-node",title:"Upgrading Your Node",description:"This document describes the upgrade procedure of a gaiad full-node to a new version.",source:"@site/docs/hub-tutorials/upgrade-node.md",sourceDirName:"hub-tutorials",slug:"/hub-tutorials/upgrade-node",permalink:"/main/hub-tutorials/upgrade-node",draft:!1,tags:[],version:"current",frontMatter:{title:"Upgrading Your Node",order:4},sidebar:"tutorialSidebar",previous:{title:"Upgrading the Chain",permalink:"/main/hub-tutorials/live-upgrade-tutorial"},next:{title:"Delegators",permalink:"/main/delegators/"}},l={},p=[{value:"Cosmovisor",id:"cosmovisor",level:2},{value:"Setup",id:"setup",level:3},{value:"Preparing an Upgrade",id:"preparing-an-upgrade",level:3},{value:"Manual Software Upgrade",id:"manual-software-upgrade",level:2},{value:"Upgrade Genesis File",id:"upgrade-genesis-file",level:2},{value:"Fetching from a Trusted Source",id:"fetching-from-a-trusted-source",level:3},{value:"Exporting State to a New Genesis Locally",id:"exporting-state-to-a-new-genesis-locally",level:3},{value:"Reset Data",id:"reset-data",level:2},{value:"Restart",id:"restart",level:2}],g={toc:p},u="wrapper";function d(e){let{components:n,...a}=e;return(0,o.yg)(u,(0,t.A)({},g,a,{components:n,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"upgrade-your-node"},"Upgrade Your Node"),(0,o.yg)("p",null,"This document describes the upgrade procedure of a ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," full-node to a new version."),(0,o.yg)("h2",{id:"cosmovisor"},"Cosmovisor"),(0,o.yg)("p",null,"The Cosmos SDK provides a convenient process manager that wraps around the ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," binary and can automatically swap in new binaries upon a successful governance upgrade proposal. Cosmovisor is entirely optional but recommended. More information can be found in ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/v0.45/run-node/cosmovisor.html"},"cosmos.network docs")," and ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/cosmos-sdk/blob/v0.47.11/tools/cosmovisor/README.md"},"cosmos-sdk/cosmovisor/readme"),"."),(0,o.yg)("h3",{id:"setup"},"Setup"),(0,o.yg)("p",null,"To get started with Cosmovisor first download it"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor\n")),(0,o.yg)("p",null,"Set up the environment variables"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'echo "# Setup Cosmovisor" >> ~/.profile\necho "export DAEMON_NAME=gaiad" >> ~/.profile\necho "export DAEMON_HOME=$HOME/.gaia" >> ~/.profile\nsource ~/.profile\n')),(0,o.yg)("p",null,"Create the appropriate directories"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"mkdir -p ~/.gaia/cosmovisor/upgrades\nmkdir -p ~/.gaia/cosmovisor/genesis/bin/\ncp $(which gaiad) ~/.gaia/cosmovisor/genesis/bin/\n\n# verify the setup. \n# It should return the same version as gaiad\ncosmovisor version\n")),(0,o.yg)("p",null,"Now ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," can start by running"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"cosmovisor start\n")),(0,o.yg)("h3",{id:"preparing-an-upgrade"},"Preparing an Upgrade"),(0,o.yg)("p",null,"Cosmovisor will continually poll the ",(0,o.yg)("inlineCode",{parentName:"p"},"$DAEMON_HOME/data/upgrade-info.json")," for new upgrade instructions. When an upgrade is ready, node operators can download the new binary and place it under ",(0,o.yg)("inlineCode",{parentName:"p"},"$DAEMON_HOME/cosmovisor/upgrades/ /bin")," where ",(0,o.yg)("inlineCode",{parentName:"p"}," ")," is the URI-encoded name of the upgrade as specified in the upgrade module plan."),(0,o.yg)("p",null,"It is possible to have Cosmovisor automatically download the new binary. To do this set the following environment variable."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"export DAEMON_ALLOW_DOWNLOAD_BINARIES=true\n")),(0,o.yg)("h2",{id:"manual-software-upgrade"},"Manual Software Upgrade"),(0,o.yg)("p",null,"First, stop your instance of ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad"),". Next, upgrade the software:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"cd gaia\ngit fetch --all && git checkout \nmake install\n")),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},(0,o.yg)("em",{parentName:"p"},"NOTE"),": If you have issues at this step, please check that you have the latest stable version of GO installed.")),(0,o.yg)("p",null,"See the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/testnets"},"testnet repo")," for details on which version is needed for which public testnet, and the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/Gaia/releases"},"Gaia release page")," for details on each release."),(0,o.yg)("p",null,"Your full node has been cleanly upgraded! If there are no breaking changes then you can simply restart the node by running:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad start\n")),(0,o.yg)("h2",{id:"upgrade-genesis-file"},"Upgrade Genesis File"),(0,o.yg)("admonition",{type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"If the new version you are upgrading to has breaking changes, you will have to restart your chain. If it is not breaking, you can skip to ",(0,o.yg)("a",{parentName:"p",href:"/hub-tutorials/upgrade-node#restart"},"Restart"))),(0,o.yg)("p",null,"To upgrade the genesis file, you can either fetch it from a trusted source or export it locally."),(0,o.yg)("h3",{id:"fetching-from-a-trusted-source"},"Fetching from a Trusted Source"),(0,o.yg)("p",null,"If you are joining the mainnet, fetch the genesis from the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/launch"},"mainnet repo"),". If you are joining a public testnet, fetch the genesis from the appropriate testnet in the ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/testnets"},"testnet repo"),". Otherwise, fetch it from your trusted source."),(0,o.yg)("p",null,"Save the new genesis as ",(0,o.yg)("inlineCode",{parentName:"p"},"new_genesis.json"),". Then replace the old ",(0,o.yg)("inlineCode",{parentName:"p"},"genesis.json")," with ",(0,o.yg)("inlineCode",{parentName:"p"},"new_genesis.json")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"cd $HOME/.gaia/config\ncp -f genesis.json new_genesis.json\nmv new_genesis.json genesis.json\n")),(0,o.yg)("p",null,"Then, go to the ",(0,o.yg)("a",{parentName:"p",href:"#reset-data"},"reset data")," section."),(0,o.yg)("h3",{id:"exporting-state-to-a-new-genesis-locally"},"Exporting State to a New Genesis Locally"),(0,o.yg)("p",null,"If you were running a node in the previous version of the network and want to build your new genesis locally from a state of this previous network, use the following command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"cd $HOME/.gaia/config\ngaiad export --for-zero-height --height= > new_genesis.json\n")),(0,o.yg)("p",null,"The command above take a state at a certain height ",(0,o.yg)("inlineCode",{parentName:"p"}," ")," and turns it into a new genesis file that can be used to start a new network."),(0,o.yg)("p",null,"Then, replace the old ",(0,o.yg)("inlineCode",{parentName:"p"},"genesis.json")," with ",(0,o.yg)("inlineCode",{parentName:"p"},"new_genesis.json"),"."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"cp -f genesis.json new_genesis.json\nmv new_genesis.json genesis.json\n")),(0,o.yg)("p",null,"At this point, you might want to run a script to update the exported genesis into a genesis that is compatible with your new version. For example, the attributes of the ",(0,o.yg)("inlineCode",{parentName:"p"},"Account")," type changed, a script should query encoded account from the account store, unmarshal them, update their type, re-marshal and re-store them. You can find an example of such script ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/cosmos/cosmos-sdk/blob/02c6c9fafd58da88550ab4d7d494724a477c8a68/contrib/migrate/v0.33.x-to-v0.34.0.py"},"here"),"."),(0,o.yg)("h2",{id:"reset-data"},"Reset Data"),(0,o.yg)("admonition",{type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"If the version you are upgrading to is not breaking from the previous one, you should not reset the data. If it is not breaking, you can skip to ",(0,o.yg)("a",{parentName:"p",href:"#restart"},"Restart"))),(0,o.yg)("admonition",{type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"If you are running a ",(0,o.yg)("strong",{parentName:"p"},"validator node")," on the mainnet, always be careful when doing ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad unsafe-reset-all"),". You should never use this command if you are not switching ",(0,o.yg)("inlineCode",{parentName:"p"},"chain-id"),".")),(0,o.yg)("p",null,"::: danger IMPORTANT\nMake sure that every node has a unique ",(0,o.yg)("inlineCode",{parentName:"p"},"priv_validator.json"),". Do not copy the ",(0,o.yg)("inlineCode",{parentName:"p"},"priv_validator.json")," from an old node to multiple new nodes. Running two nodes with the same ",(0,o.yg)("inlineCode",{parentName:"p"},"priv_validator.json")," will cause you to get slashed due to double signing!\n:::"),(0,o.yg)("p",null,"First, remove the outdated files and reset the data. ",(0,o.yg)("strong",{parentName:"p"},"If you are running a validator node, make sure you understand what you are doing before resetting"),"."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad unsafe-reset-all\n")),(0,o.yg)("p",null,"Your node is now in a pristine state while keeping the original ",(0,o.yg)("inlineCode",{parentName:"p"},"priv_validator.json")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"config.toml"),". If you had any sentry nodes or full nodes setup before, your node will still try to connect to them, but may fail if they haven't also been upgraded."),(0,o.yg)("h2",{id:"restart"},"Restart"),(0,o.yg)("p",null,"If there are no breaking changes then you can simply restart the node by running:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad start\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/66cfa501.abec7ff9.js b/assets/js/66cfa501.abec7ff9.js new file mode 100644 index 00000000000..920842140f9 --- /dev/null +++ b/assets/js/66cfa501.abec7ff9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[35],{5680:(e,t,r)=>{r.d(t,{xA:()=>l,yg:()=>d});var n=r(6540);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t =0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=n.createContext({}),u=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},l=function(e){var t=u(e.components);return n.createElement(c.Provider,{value:t},e.children)},p="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),p=u(r),m=a,d=p["".concat(c,".").concat(m)]||p[m]||h[m]||i;return r?n.createElement(d,o(o({ref:t},l),{},{components:r})):n.createElement(d,o({ref:t},l))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=m;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[p]="string"==typeof e?e:a,o[1]=s;for(var u=2;u{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var n=r(8168),a=(r(6540),r(5680));const i={title:"Interchain Security",order:3},o=void 0,s={unversionedId:"interchain-security/README",id:"interchain-security/README",title:"Interchain Security",description:"The Interchain Security feature brings to the Cosmos Hub a shared security model, where the Cosmos Hub validators, also validate consumer chains. This is valuable for consumer chains, as consumer chains can focus on product-market fit, rather than business and operational agreements in bringing together a validator set. As part of this agreement, consumer chains pay for the security by distributing a portion of the consumer chain revenue to Hub token holders.",source:"@site/docs/interchain-security/README.md",sourceDirName:"interchain-security",slug:"/interchain-security/",permalink:"/main/interchain-security/",draft:!1,tags:[],version:"current",frontMatter:{title:"Interchain Security",order:3},sidebar:"tutorialSidebar",previous:{title:"Submitting a Proposal",permalink:"/main/governance/submitting"},next:{title:"Resources",permalink:"/main/resources/"}},c={},u=[{value:"ICS features",id:"ics-features",level:2},{value:"Top-N consumer chains",id:"top-n-consumer-chains",level:3},{value:"Opt-in consumer chains",id:"opt-in-consumer-chains",level:3},{value:"Parameter customization",id:"parameter-customization",level:3},{value:"Notable consumer chains",id:"notable-consumer-chains",level:2},{value:"Neutron",id:"neutron",level:3},{value:"Stride",id:"stride",level:3},{value:"Resources",id:"resources",level:2}],l={toc:u},p="wrapper";function h(e){let{components:t,...r}=e;return(0,a.yg)(p,(0,n.A)({},l,r,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("p",null,"The ",(0,a.yg)("a",{parentName:"p",href:"https://cosmos.github.io/interchain-security/"},"Interchain Security")," feature brings to the Cosmos Hub a shared security model, where the Cosmos Hub validators, also validate consumer chains. This is valuable for consumer chains, as consumer chains can focus on product-market fit, rather than business and operational agreements in bringing together a validator set. As part of this agreement, consumer chains pay for the security by distributing a portion of the consumer chain revenue to Hub token holders."),(0,a.yg)("p",null,"All potential chains are onboarded as consumer chains, via Hub Governance, with the feedback from the Hub community."),(0,a.yg)("h2",{id:"ics-features"},"ICS features"),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://cosmos.github.io/interchain-security/features/partial-set-security"},"Partial Set Security")," and ",(0,a.yg)("a",{parentName:"p",href:"https://cosmos.github.io/interchain-security/features/power-shaping"},"Power Shaping")," bring benefits for both the consumer chains and validators:"),(0,a.yg)("h3",{id:"top-n-consumer-chains"},"Top-N consumer chains"),(0,a.yg)("p",null,"Validators inside the top-N percent of voting power are required to validate the consumer chain."),(0,a.yg)("p",null,"e.g. ",(0,a.yg)("inlineCode",{parentName:"p"},"top-95")," means that the 95% of the validators (by voting power) are required to run the consumer chain binary"),(0,a.yg)("h3",{id:"opt-in-consumer-chains"},"Opt-in consumer chains"),(0,a.yg)("p",null,"Only validators that opt to running a consumer chains are required to run the chain binary and become eligible for consumer chain rewards distribution."),(0,a.yg)("h3",{id:"parameter-customization"},"Parameter customization"),(0,a.yg)("p",null,"Consumer chains gain the ability to customize the validator set to their needs:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"define allow/denylists"),(0,a.yg)("li",{parentName:"ul"},"set maximum number of validators"),(0,a.yg)("li",{parentName:"ul"},"set validator power cap")),(0,a.yg)("h2",{id:"notable-consumer-chains"},"Notable consumer chains"),(0,a.yg)("p",null,"Currently the Cosmos Hub has the following two Consumer Chains."),(0,a.yg)("h3",{id:"neutron"},"Neutron"),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://neutron.org/"},"Neutron"),", is a smart contracting platform, that was the first consumer chain onboarded.",(0,a.yg)("br",{parentName:"p"}),"\n","Neutron was onboarded as a consumer chain in May 2023, see Hub ",(0,a.yg)("a",{parentName:"p",href:"https://www.mintscan.io/cosmos/proposals/792"},"proposal 792")," for more details."),(0,a.yg)("h3",{id:"stride"},"Stride"),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://www.stride.zone/"},"Stride"),", is a liquid staking provider, which aims to unlock liquidity for Cosmos Hub token holders.",(0,a.yg)("br",{parentName:"p"}),"\n","Stride was onboarded as a consumer chain in July 2023, see Hub ",(0,a.yg)("a",{parentName:"p",href:"https://www.mintscan.io/cosmos/proposals/799"},"proposal 799")," for more details."),(0,a.yg)("h2",{id:"resources"},"Resources"),(0,a.yg)("p",null,"For more information visit:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"https://cosmos.github.io/interchain-security"},"Interchain Security docs"))))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/68580c81.58bea881.js b/assets/js/68580c81.58bea881.js new file mode 100644 index 00000000000..f12e96d8fee --- /dev/null +++ b/assets/js/68580c81.58bea881.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[2424],{5680:(e,t,a)=>{a.d(t,{xA:()=>h,yg:()=>m});var o=a(6540);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function r(e){for(var t=1;t =0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o =0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var l=o.createContext({}),d=function(e){var t=o.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},h=function(e){var t=d(e.components);return o.createElement(l.Provider,{value:t},e.children)},g="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var a=e.components,i=e.mdxType,n=e.originalType,l=e.parentName,h=s(e,["components","mdxType","originalType","parentName"]),g=d(a),u=i,m=g["".concat(l,".").concat(u)]||g[u]||c[u]||n;return a?o.createElement(m,r(r({ref:t},h),{},{components:a})):o.createElement(m,r({ref:t},h))}));function m(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var n=a.length,r=new Array(n);r[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[g]="string"==typeof e?e:i,r[1]=s;for(var d=2;d {a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>c,frontMatter:()=>n,metadata:()=>s,toc:()=>d});var o=a(8168),i=(a(6540),a(5680));const n={title:"Delegator FAQ",order:4},r=void 0,s={unversionedId:"delegators/delegator-faq",id:"delegators/delegator-faq",title:"Delegator FAQ",description:"What is a delegator?",source:"@site/docs/delegators/delegator-faq.md",sourceDirName:"delegators",slug:"/delegators/delegator-faq",permalink:"/main/delegators/delegator-faq",draft:!1,tags:[],version:"current",frontMatter:{title:"Delegator FAQ",order:4},sidebar:"tutorialSidebar",previous:{title:"Delegators",permalink:"/main/delegators/"},next:{title:"Delegator Guide (CLI)",permalink:"/main/delegators/delegator-guide-cli"}},l={},d=[{value:"What is a delegator?",id:"what-is-a-delegator",level:2},{value:"Choosing a validator",id:"choosing-a-validator",level:2},{value:"Directives of delegators",id:"directives-of-delegators",level:2},{value:"Revenue",id:"revenue",level:2},{value:"Validator Commission",id:"validator-commission",level:2},{value:"Liquid Staking",id:"liquid-staking",level:2},{value:"Toggling the ability to tokenize shares",id:"toggling-the-ability-to-tokenize-shares",level:3},{value:"Risks",id:"risks",level:2}],h={toc:d},g="wrapper";function c(e){let{components:t,...a}=e;return(0,i.yg)(g,(0,o.A)({},h,a,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("h2",{id:"what-is-a-delegator"},"What is a delegator?"),(0,i.yg)("p",null,"People who cannot or do not want to operate ",(0,i.yg)("a",{parentName:"p",href:"/main/validators/overview"},"validator nodes")," can still participate in the staking process as delegators. Indeed, validators are not chosen based on their self-delegated stake but based on their total stake, which is the sum of their self-delegated stake and of the stake that is delegated to them. This is an important property, as it makes delegators a safeguard against validators that exhibit bad behavior. If a validator misbehaves, their delegators will move their Atoms away from them, thereby reducing their stake. Eventually, if a validator's stake falls under the top 180 addresses with highest stake, they will exit the validator set."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Delegators share the revenue of their validators, but they also share the risks.")," In terms of revenue, validators and delegators differ in that validators can apply a commission on the revenue that goes to their delegator before it is distributed. This commission is known to delegators beforehand and can only change according to predefined constraints (see ",(0,i.yg)("a",{parentName:"p",href:"#choosing-a-validator"},"section")," below). In terms of risk, delegators' Atoms can be slashed if their validator misbehaves. For more, see ",(0,i.yg)("a",{parentName:"p",href:"#risks"},"Risks")," section."),(0,i.yg)("p",null,"To become delegators, Atom holders need to send a ",(0,i.yg)("a",{parentName:"p",href:"/main/delegators/delegator-guide-cli#sending-transactions"},'"Delegate transaction"'),' where they specify how many Atoms they want to bond and to which validator. A list of validator candidates will be displayed in Cosmos Hub explorers. Later, if a delegator wants to unbond part or all of their stake, they need to send an "Unbond transaction". From there, the delegator will have to wait 3 weeks to retrieve their Atoms. Delegators can also send a "Rebond Transaction" to switch from one validator to another, without having to go through the 3 weeks waiting period.'),(0,i.yg)("p",null,"For a practical guide on how to become a delegator, click ",(0,i.yg)("a",{parentName:"p",href:"/main/delegators/delegator-guide-cli"},"here"),"."),(0,i.yg)("h2",{id:"choosing-a-validator"},"Choosing a validator"),(0,i.yg)("p",null,"In order to choose their validators, delegators have access to a range of information directly in ",(0,i.yg)("a",{parentName:"p",href:"https://lunie.io"},"Lunie")," or other Cosmos block explorers."),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Validator's moniker"),": Name of the validator candidate."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Validator's description"),": Description provided by the validator operator."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Validator's website"),": Link to the validator's website."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Initial commission rate"),": The commission rate on revenue charged to any delegator by the validator (see below for more detail)."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Commission max change rate:")," The maximum daily increase of the validator's commission. This parameter cannot be changed by the validator operator."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Maximum commission:")," The maximum commission rate this validator candidate can charge. This parameter cannot be changed by the validator operator."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Validator self-bond amount"),": A validator with a high amount of self-delegated Atoms has more skin-in-the-game than a validator with a low amount.")),(0,i.yg)("h2",{id:"directives-of-delegators"},"Directives of delegators"),(0,i.yg)("p",null,"Being a delegator is not a passive task. Here are the main directives of a delegator:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Perform careful due diligence on validators before delegating.")," If a validator misbehaves, part of their total stake, which includes the stake of their delegators, can be slashed. Delegators should therefore carefully select validators they think will behave correctly."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Actively monitor their validator after having delegated.")," Delegators should ensure that the validators they delegate to behave correctly, meaning that they have good uptime, do not double sign or get compromised, and participate in governance. They should also monitor the commission rate that is applied. If a delegator is not satisfied with its validator, they can unbond or switch to another validator (Note: Delegators do not have to wait for the unbonding period to switch validators. Rebonding takes effect immediately)."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Participate in governance.")," Delegators can and are expected to actively participate in governance. A delegator's voting power is proportional to the size of their bonded stake. If a delegator does not vote, they will inherit the vote of their validator(s). If they do vote, they override the vote of their validator(s). Delegators therefore act as a counterbalance to their validators.")),(0,i.yg)("h2",{id:"revenue"},"Revenue"),(0,i.yg)("p",null,"Validators and delegators earn revenue in exchange for their services. This revenue is given in three forms:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Block provisions (Atoms):")," They are paid in newly created Atoms. Block provisions exist to incentivize Atom holders to stake. The yearly inflation rate is calculated to target 2/3 bonded stake. If the total bonded stake in the network is less than 2/3 of the total Atom supply, inflation increases until it reaches 20%. If the total bonded stake is more than 2/3 of the Atom supply, inflation decreases until it reaches 7%. This means that if total bonded stake stays less than 2/3 of the total Atom supply for a prolonged period of time, unbonded Atom holders can expect their Atom value to deflate by 20% (compounded) per year."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Transaction fees (various tokens):")," Each transfer on the Cosmos Hub comes with transactions fees. These fees can be paid in any currency that is whitelisted by the Hub's governance. Fees are distributed to bonded Atom holders in proportion to their stake. The first whitelisted token at launch is the ATOM.")),(0,i.yg)("h2",{id:"validator-commission"},"Validator Commission"),(0,i.yg)("p",null,"Each validator receives revenue based on their total stake. Before this revenue is distributed to delegators, the validator can apply a commission. In other words, delegators have to pay a commission to their validators on the revenue they earn. Let us look at a concrete example:"),(0,i.yg)("p",null,"We consider a validator whose stake (i.e. self-delegated stake + delegated stake) is 10% of the total stake of all validators. This validator has 20% self-delegated stake and applies a commission of 10%. Now let us consider a block with the following revenue:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},"990 Atoms in block provisions"),(0,i.yg)("li",{parentName:"ul"},"10 Atoms in transaction fees.")),(0,i.yg)("p",null,"This amounts to a total of 1000 Atoms and 100 Photons to be distributed among all staking pools."),(0,i.yg)("p",null,"Our validator's staking pool represents 10% of the total stake, which means the pool obtains 100 Atoms and 10 Photons. Now let us look at the internal distribution of revenue:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},"Commission = ",(0,i.yg)("inlineCode",{parentName:"li"},"10% * 80% * 100")," Atoms = 8 Atoms"),(0,i.yg)("li",{parentName:"ul"},"Validator's revenue = ",(0,i.yg)("inlineCode",{parentName:"li"},"20% * 100")," Atoms + Commission = 28 Atoms"),(0,i.yg)("li",{parentName:"ul"},"Delegators' total revenue = ",(0,i.yg)("inlineCode",{parentName:"li"},"80% * 100")," Atoms - Commission = 72 Atoms")),(0,i.yg)("p",null,"Then, each delegator in the staking pool can claim their portion of the delegators' total revenue."),(0,i.yg)("h2",{id:"liquid-staking"},"Liquid Staking"),(0,i.yg)("p",null,"The Liquid Staking module enacts a safety framework and associated governance-controlled parameters to regulate the adoption of liquid staking."),(0,i.yg)("p",null,"The LSM mitigates liquid staking risks by limiting the total amount of ATOM that can be liquid staked to a percentage of all staked ATOM. As an additional risk-mitigation feature, the LSM introduces a requirement that validators self-bond ATOM to be eligible for delegations from liquid staking providers or to be eligible to mint LSM tokens. This mechanism is called the \u201cvalidator bond\u201d, and is technically distinct from the current self-bond mechanism, but functions similarly."),(0,i.yg)("p",null,"At the same time, the LSM introduces the ability for staked ATOM to be instantly liquid staked, without having to wait for the unbonding period."),(0,i.yg)("p",null,"The LSM enables users to instantly liquid stake their staked ATOM, without having to wait the twenty-one day unbonding period. This is important, because a very large portion of the ATOM supply is currently staked. Liquid staking ATOM that is already staked incurs a switching cost in the form of three weeks\u2019 forfeited staking rewards. The LSM eliminates this switching cost."),(0,i.yg)("p",null,"A user would be able to visit any liquid staking provider that has integrated with the LSM and click a button to convert her staked ATOM to liquid staked ATOM. It would be as easy as liquid staking unstaked ATOM."),(0,i.yg)("p",null,"Technically speaking, this is accomplished by using something called an \u201cLSM share.\u201d Using the liquid staking module, a user can tokenize their staked ATOM and turn it into LSM shares. LSM shares can be redeemed for underlying staked tokens and are transferable. After staked ATOM is tokenized it can be immediately transferred to a liquid staking provider in exchange for liquid staking tokens - without having to wait for the unbonding period."),(0,i.yg)("h3",{id:"toggling-the-ability-to-tokenize-shares"},"Toggling the ability to tokenize shares"),(0,i.yg)("p",null,"Currently the liquid staking module facilitates the immediate conversion of staked assets into liquid staked tokens. Despite the many benefits that come with this capability, it does inadvertently negate a protective measure available via traditional staking, where an account can stake their tokens to render them illiquid in the event that their wallet is compromised (the attacker would first need to unbond, then transfer out the tokens)."),(0,i.yg)("p",null,"Tokenization obviates this potential recovery measure, as an attacker could tokenize and immediately transfer staked tokens to another wallet. So, as an additional protective measure, the staking module permit accounts to selectively disable the tokenization of their stake with the ",(0,i.yg)("inlineCode",{parentName:"p"},"DisableTokenizeShares")," message."),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"DisableTokenizeShares")," message is exposed by the staking module and can be executed as follows:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-sh"},"gaiad tx staking disable-tokenize-shares --from mykey \n")),(0,i.yg)("p",null,"When tokenization is disabled, a lock is placed on the account, effectively preventing the tokenization of any delegations. Re-enabling tokenization would initiate the removal of the lock, but the process is not immediate. The lock removal is queued, with the lock itself persisting throughout the unbonding period. Following the completion of the unbonding period, the lock would be completely removed, restoring the account's ability to tokenize. For liquid staking protocols that enable the lock, this delay better positions the base layer to coordinate a recovery in the event of an exploit."),(0,i.yg)("h2",{id:"risks"},"Risks"),(0,i.yg)("p",null,"Staking Atoms is not free of risk. First, staked Atoms are locked up, and retrieving them requires a 3 week waiting period called unbonding period. Additionally, if a validator misbehaves, a portion of their total stake can be slashed (i.e. destroyed). This includes the stake of their delegators."),(0,i.yg)("p",null,"There is one main slashing condition:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("strong",{parentName:"li"},"Double signing:")," If someone reports on that a validator signed two different blocks with the same chain ID at the same height, this validator will get slashed.")),(0,i.yg)("p",null,"This is why Atom holders should perform careful due diligence on validators before delegating. It is also important that delegators actively monitor the activity of their validators. If a validator behaves suspiciously or is too often offline, delegators can choose to unbond from them or switch to another validator. ",(0,i.yg)("strong",{parentName:"p"},"Delegators can also mitigate risk by distributing their stake across multiple validators."),"s"))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/69e61f52.b4811c42.js b/assets/js/69e61f52.b4811c42.js new file mode 100644 index 00000000000..3347fb23f6d --- /dev/null +++ b/assets/js/69e61f52.b4811c42.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[2045],{5680:(e,t,r)=>{r.d(t,{xA:()=>c,yg:()=>d});var n=r(6540);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t =0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),u=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=u(e.components);return n.createElement(l.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},y=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),p=u(r),y=a,d=p["".concat(l,".").concat(y)]||p[y]||m[y]||i;return r?n.createElement(d,o(o({ref:t},c),{},{components:r})):n.createElement(d,o({ref:t},c))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=y;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:a,o[1]=s;for(var u=2;u{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var n=r(8168),a=(r(6540),r(5680));const i={title:"System requirements",sidebar_position:4},o="System requirements",s={unversionedId:"getting-started/system-requirements",id:"getting-started/system-requirements",title:"System requirements",description:"\x3c!--",source:"@site/docs/getting-started/system-requirements.md",sourceDirName:"getting-started",slug:"/getting-started/system-requirements",permalink:"/main/getting-started/system-requirements",draft:!1,tags:[],version:"current",sidebarPosition:4,frontMatter:{title:"System requirements",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Quick Start - Join Mainnet",permalink:"/main/getting-started/quickstart"},next:{title:"Gaia Tutorials",permalink:"/main/hub-tutorials/"}},l={},u=[{value:"Gaia Upgrades",id:"gaia-upgrades",level:2}],c={toc:u},p="wrapper";function m(e){let{components:t,...r}=e;return(0,a.yg)(p,(0,n.A)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"system-requirements"},"System requirements"),(0,a.yg)("h2",{id:"gaia-upgrades"},"Gaia Upgrades"),(0,a.yg)("p",null,"The Gaia application typically needs at least 32GB RAM, for smooth operation for upgrade, as there may be lengthy migrations to perform."),(0,a.yg)("p",null,"If you have less than 32GB RAM, you might try creating a swapfile to swap an idle program onto the hard disk to free up memory. This can allow your machine to run the binary than it could run in RAM alone."),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-shell"},"# Linux instructions\nsudo fallocate -l 16G /swapfile\nsudo chmod 600 /swapfile\nsudo mkswap /swapfile\nsudo swapon /swapfile\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6e233af6.35cb3878.js b/assets/js/6e233af6.35cb3878.js new file mode 100644 index 00000000000..56555476af6 --- /dev/null +++ b/assets/js/6e233af6.35cb3878.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[7169],{5680:(e,t,r)=>{r.d(t,{xA:()=>m,yg:()=>g});var a=r(6540);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t =0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a =0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=a.createContext({}),c=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},m=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var r=e.components,o=e.mdxType,n=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),u=c(r),d=o,g=u["".concat(s,".").concat(d)]||u[d]||p[d]||n;return r?a.createElement(g,i(i({ref:t},m),{},{components:r})):a.createElement(g,i({ref:t},m))}));function g(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var n=r.length,i=new Array(n);i[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:o,i[1]=l;for(var c=2;c {r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>p,frontMatter:()=>n,metadata:()=>l,toc:()=>c});var a=r(8168),o=(r(6540),r(5680));const n={title:"Gaia Modules",order:1},i=void 0,l={unversionedId:"modules/README",id:"modules/README",title:"Gaia Modules",description:"Here you can find an overview of the modules included on the Cosmos Hub (Gaia) blockchain with relevant info and",source:"@site/docs/modules/README.md",sourceDirName:"modules",slug:"/modules/",permalink:"/main/modules/",draft:!1,tags:[],version:"current",frontMatter:{title:"Gaia Modules",order:1},sidebar:"tutorialSidebar",previous:{title:"ADR Creation Process",permalink:"/main/architecture/PROCESS"},next:{title:"LSM Staking",permalink:"/main/modules/lsm-staking"}},s={},c=[{value:"cosmos-sdk",id:"cosmos-sdk",level:2},{value:"ibc-go",id:"ibc-go",level:2},{value:"gaia specific modules",id:"gaia-specific-modules",level:2},{value:"other modules",id:"other-modules",level:2}],m={toc:c},u="wrapper";function p(e){let{components:t,...r}=e;return(0,o.yg)(u,(0,a.A)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"Here you can find an overview of the modules included on the Cosmos Hub (Gaia) blockchain with relevant info and\nlinks for each one."),(0,o.yg)("h1",{id:"module-list"},"Module List"),(0,o.yg)("h2",{id:"cosmos-sdk"},"cosmos-sdk"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/auth"},"x/auth")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/authz"},"x/authz")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/bank"},"x/bank")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/capability"},"x/capability")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/consensus"},"x/consensus")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/crisis"},"x/crisis")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/distribution"},"x/distribution")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/evidence"},"x/evidence")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/feegrant"},"x/feegrant")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/gov"},"x/gov")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/mint"},"x/mint")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/params"},"x/params")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/slashing"},"x/slashing")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/staking"},"x/staking (with LSM changes)")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://docs.cosmos.network/v0.50/build/modules/upgrade"},"x/upgrade"))),(0,o.yg)("h2",{id:"ibc-go"},"ibc-go"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://ibc.cosmos.network/main/apps/transfer/overview"},"transfer")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://ibc.cosmos.network/v8/apps/interchain-accounts/client#host"},"interchain accounts - host")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://ibc.cosmos.network/v8/apps/interchain-accounts/client#controller"},"interchain accounts - controller")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/interchain-security/tree/main/x/ccv/provider"},"interchain-security/provider")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/cosmos/ibc-apps/tree/main/middleware/packet-forward-middleware"},"packetforward")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://ibc.cosmos.network/v8/middleware/ics29-fee/overview"},"ibcfee")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/Stride-Labs/ibc-rate-limiting"},"ibc-rate-limiting"))),(0,o.yg)("h2",{id:"gaia-specific-modules"},"gaia specific modules"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/modules/metaprotocols"},"Metaprotocols")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"/main/modules/lsm-staking"},"LSM staking"))),(0,o.yg)("h2",{id:"other-modules"},"other modules"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/skip-mev/feemarket"},"fee market"))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/781312e5.32264991.js b/assets/js/781312e5.32264991.js new file mode 100644 index 00000000000..09e2a0b26ff --- /dev/null +++ b/assets/js/781312e5.32264991.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[9053],{5680:(e,a,t)=>{t.d(a,{xA:()=>u,yg:()=>c});var n=t(6540);function o(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function i(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function r(e){for(var a=1;a =0||(o[t]=e[t]);return o}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=n.createContext({}),d=function(e){var a=n.useContext(l),t=a;return e&&(t="function"==typeof e?e(a):r(r({},a),e)),t},u=function(e){var a=d(e.components);return n.createElement(l.Provider,{value:a},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},g=n.forwardRef((function(e,a){var t=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=d(t),g=o,c=p["".concat(l,".").concat(g)]||p[g]||m[g]||i;return t?n.createElement(c,r(r({ref:a},u),{},{components:t})):n.createElement(c,r({ref:a},u))}));function c(e,a){var t=arguments,o=a&&a.mdxType;if("string"==typeof e||o){var i=t.length,r=new Array(i);r[0]=g;var s={};for(var l in a)hasOwnProperty.call(a,l)&&(s[l]=a[l]);s.originalType=e,s[p]="string"==typeof e?e:o,r[1]=s;for(var d=2;d{t.r(a),t.d(a,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>d});var n=t(8168),o=(t(6540),t(5680));const i={title:"Running a Validator",order:2},r=void 0,s={unversionedId:"validators/validator-setup",id:"validators/validator-setup",title:"Running a Validator",description:"We suggest you try out joining a public testnet first. Information on how to join the most recent testnet can be found here.",source:"@site/docs/validators/validator-setup.md",sourceDirName:"validators",slug:"/validators/validator-setup",permalink:"/main/validators/validator-setup",draft:!1,tags:[],version:"current",frontMatter:{title:"Running a Validator",order:2},sidebar:"tutorialSidebar",previous:{title:"Validator FAQ",permalink:"/main/validators/validator-faq"},next:{title:"Governance Overview",permalink:"/main/governance/"}},l={},d=[{value:"What is a Validator?",id:"what-is-a-validator",level:2},{value:"Create Your Validator",id:"create-your-validator",level:2},{value:"Edit Validator Description",id:"edit-validator-description",level:2},{value:"View Validator Description",id:"view-validator-description",level:2},{value:"Track Validator Signing Information",id:"track-validator-signing-information",level:2},{value:"Unjail Validator",id:"unjail-validator",level:2},{value:"Confirm Your Validator is Running",id:"confirm-your-validator-is-running",level:2},{value:"Halting Your Validator",id:"halting-your-validator",level:2},{value:"Advanced configuration",id:"advanced-configuration",level:2},{value:"Common Problems",id:"common-problems",level:2},{value:"Problem #1: My validator has voting_power: 0
",id:"problem-1-my-validator-has-voting_power-0",level:3},{value:"Problem #2: Mygaiad
crashes because oftoo many open files
",id:"problem-2-my-gaiad-crashes-because-of-too-many-open-files",level:3}],u={toc:d},p="wrapper";function m(e){let{components:a,...t}=e;return(0,o.yg)(p,(0,n.A)({},u,t,{components:a,mdxType:"MDXLayout"}),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"We suggest you try out joining a public testnet first. Information on how to join the most recent testnet can be found ",(0,o.yg)("a",{parentName:"p",href:"/hub-tutorials/join-testnet"},"here"),".")),(0,o.yg)("p",null,"Before setting up a validator node, make sure to have completed the ",(0,o.yg)("a",{parentName:"p",href:"/hub-tutorials/join-mainnet"},"Joining Mainnet")," guide."),(0,o.yg)("p",null,"If you plan to use a KMS (key management system), you should go through these steps first: ",(0,o.yg)("a",{parentName:"p",href:"/validators/kms/kms"},"Using a KMS"),"."),(0,o.yg)("h2",{id:"what-is-a-validator"},"What is a Validator?"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"/validators/overview"},"Validators")," are responsible for committing new blocks to the blockchain through an automated voting process. A validator's stake is slashed if they become unavailable or sign blocks at the same height. Because there is a chance of slashing, we suggest you read about ",(0,o.yg)("a",{parentName:"p",href:"/validators/validator-faq#how-can-validators-protect-themselves-from-denial-of-service-attacks"},"Sentry Node Architecture")," to protect your node from DDOS attacks and to ensure high-availability."),(0,o.yg)("admonition",{type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"If you want to become a validator for the Hub's ",(0,o.yg)("inlineCode",{parentName:"p"},"mainnet"),", you should learn more about ",(0,o.yg)("a",{parentName:"p",href:"/validators/security"},"security"),".")),(0,o.yg)("p",null,"The following instructions assume you have already ",(0,o.yg)("a",{parentName:"p",href:"/hub-tutorials/join-mainnet"},"set up a full-node")," and are synchronised to the latest blockheight."),(0,o.yg)("h2",{id:"create-your-validator"},"Create Your Validator"),(0,o.yg)("p",null,"Your ",(0,o.yg)("inlineCode",{parentName:"p"},"cosmosvalconspub")," can be used to create a new validator by staking tokens. You can find your validator pubkey by running:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tendermint show-validator\n")),(0,o.yg)("p",null,"To create your validator, just use the following command:"),(0,o.yg)("admonition",{type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"Don't use more ",(0,o.yg)("inlineCode",{parentName:"p"},"uatom")," than you have!")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'gaiad tx staking create-validator \\\n --amount=1000000uatom \\\n --pubkey=$(gaiad tendermint show-validator) \\\n --moniker="choose a moniker" \\\n --chain-id=\\\n --commission-rate="0.10" \\\n --commission-max-rate="0.20" \\\n --commission-max-change-rate="0.01" \\\n --gas="auto" \\\n --gas-prices="0.0025uatom" \\\n --from= \n')),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"When specifying commission parameters, the ",(0,o.yg)("inlineCode",{parentName:"p"},"commission-max-change-rate")," is used to measure % ",(0,o.yg)("em",{parentName:"p"},"point")," change over the ",(0,o.yg)("inlineCode",{parentName:"p"},"commission-rate"),". E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point.")),(0,o.yg)("p",null,"It's possible that you won't have enough ATOM to be part of the active set of validators in the beginning. Users are able to delegate to inactive validators (those outside of the active set) using the ",(0,o.yg)("a",{parentName:"p",href:"https://wallet.keplr.app/#/cosmoshub/stake?tab=inactive-validators"},"Keplr web app"),". You can confirm that you are in the validator set by using a third party explorer like ",(0,o.yg)("a",{parentName:"p",href:"https://www.mintscan.io/cosmos/validators"},"Mintscan"),"."),(0,o.yg)("h2",{id:"edit-validator-description"},"Edit Validator Description"),(0,o.yg)("p",null,"You can edit your validator's public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below. If a flag is not included in the command the field will default to empty (",(0,o.yg)("inlineCode",{parentName:"p"},"--moniker")," defaults to the machine name) if the field has never been set or remain the same if it has been set in the past."),(0,o.yg)("p",null,"The specifies which validator you are editing. If you choose to not include some of the flags below, remember that the --from flag ",(0,o.yg)("strong",{parentName:"p"},"must")," be included to identify the validator to update."),(0,o.yg)("p",null,"The ",(0,o.yg)("inlineCode",{parentName:"p"},"--identity")," can be used as to verify identity with systems like Keybase or UPort. When using Keybase, ",(0,o.yg)("inlineCode",{parentName:"p"},"--identity")," should be populated with a 16-digit string that is generated with a ",(0,o.yg)("a",{parentName:"p",href:"https://keybase.io"},"keybase.io")," account. It's a cryptographically secure method of verifying your identity across multiple online networks. The Keybase API allows us to retrieve your Keybase avatar. This is how you can add a logo to your validator profile."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'gaiad tx staking edit-validator\n --moniker="choose a moniker" \\\n --website="https://cosmos.network" \\\n --identity=6A0D65E29A4CBC8E \\\n --details="To infinity and beyond!" \\\n --chain-id= \\\n --gas="auto" \\\n --gas-prices="0.0025uatom" \\\n --from= \\\n --commission-rate="0.10"\n')),(0,o.yg)("admonition",{type:"warning"},(0,o.yg)("p",{parentName:"admonition"},"Please note that some parameters such as ",(0,o.yg)("inlineCode",{parentName:"p"},"commission-max-rate")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"commission-max-change-rate")," cannot be changed once your validator is up and running.")),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Note"),": The ",(0,o.yg)("inlineCode",{parentName:"p"},"commission-rate")," value must adhere to the following rules:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Must be between 0 and the validator's ",(0,o.yg)("inlineCode",{parentName:"li"},"commission-max-rate")),(0,o.yg)("li",{parentName:"ul"},"Must not exceed the validator's ",(0,o.yg)("inlineCode",{parentName:"li"},"commission-max-change-rate")," which is maximum\n% point change rate ",(0,o.yg)("strong",{parentName:"li"},"per day"),". In other words, a validator can only change\nits commission once per day and within ",(0,o.yg)("inlineCode",{parentName:"li"},"commission-max-change-rate")," bounds.")),(0,o.yg)("h2",{id:"view-validator-description"},"View Validator Description"),(0,o.yg)("p",null,"View the validator's information with this command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking validator \n")),(0,o.yg)("h2",{id:"track-validator-signing-information"},"Track Validator Signing Information"),(0,o.yg)("p",null,"In order to keep track of a validator's signatures in the past you can do so by using the ",(0,o.yg)("inlineCode",{parentName:"p"},"signing-info")," command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query slashing signing-info \\\n --chain-id= \n")),(0,o.yg)("h2",{id:"unjail-validator"},"Unjail Validator"),(0,o.yg)("p",null,'When a validator is "jailed" for downtime, you must submit an ',(0,o.yg)("inlineCode",{parentName:"p"},"Unjail")," transaction from the operator account in order to be able to get block proposer rewards again (depends on the zone fee distribution)."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx slashing unjail \\\n --from= \\\n --chain-id= \n")),(0,o.yg)("h2",{id:"confirm-your-validator-is-running"},"Confirm Your Validator is Running"),(0,o.yg)("p",null,"Your validator is active if the following command returns anything:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},'gaiad query tendermint-validator-set | grep "$(gaiad tendermint show-address)"\n')),(0,o.yg)("p",null,"You should now see your validator in one of the Cosmos Hub explorers. You are looking for the ",(0,o.yg)("inlineCode",{parentName:"p"},"bech32")," encoded ",(0,o.yg)("inlineCode",{parentName:"p"},"address")," in the ",(0,o.yg)("inlineCode",{parentName:"p"},"~/.gaia/config/priv_validator.json")," file."),(0,o.yg)("h2",{id:"halting-your-validator"},"Halting Your Validator"),(0,o.yg)("p",null,"When attempting to perform routine maintenance or planning for an upcoming coordinated upgrade, it can be useful to have your validator systematically and gracefully halt. You can achieve this by either setting the ",(0,o.yg)("inlineCode",{parentName:"p"},"halt-height")," to the height at which you want your node to shutdown or by passing the ",(0,o.yg)("inlineCode",{parentName:"p"},"--halt-height")," flag to ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad"),". The node will shutdown with a zero exit code at that given height after committing\nthe block."),(0,o.yg)("h2",{id:"advanced-configuration"},"Advanced configuration"),(0,o.yg)("p",null,"You can find more advanced information about running a node or a validator on the ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cometbft.com/v0.37/core/validators"},"CometBFT Core documentation"),"."),(0,o.yg)("h2",{id:"common-problems"},"Common Problems"),(0,o.yg)("h3",{id:"problem-1-my-validator-has-voting_power-0"},"Problem #1: My validator has ",(0,o.yg)("inlineCode",{parentName:"h3"},"voting_power: 0")),(0,o.yg)("p",null,"Your validator has become jailed. Validators get jailed, i.e. get removed from the active validator set, if they do not vote on at least ",(0,o.yg)("inlineCode",{parentName:"p"},"500")," of the last ",(0,o.yg)("inlineCode",{parentName:"p"},"10,000")," blocks, or if they double sign."),(0,o.yg)("p",null,"If you got jailed for downtime, you can get your voting power back to your validator. First, if you're not using ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/v0.45/run-node/cosmovisor.html"},"Cosmovisor")," and ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," is not running, start it up again:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad start\n")),(0,o.yg)("p",null,"Wait for your full node to catch up to the latest block. Then, you can ",(0,o.yg)("a",{parentName:"p",href:"#unjail-validator"},"unjail your validator")),(0,o.yg)("p",null,"After you have submitted the unjail transaction, check your validator again to see if your voting power is back."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad status\n")),(0,o.yg)("p",null,"You may notice that your voting power is less than it used to be. That's because you got slashed for downtime!"),(0,o.yg)("h3",{id:"problem-2-my-gaiad-crashes-because-of-too-many-open-files"},"Problem #2: My ",(0,o.yg)("inlineCode",{parentName:"h3"},"gaiad")," crashes because of ",(0,o.yg)("inlineCode",{parentName:"h3"},"too many open files")),(0,o.yg)("p",null,"The default number of files Linux can open (per-process) is ",(0,o.yg)("inlineCode",{parentName:"p"},"1024"),". ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," is known to open more than ",(0,o.yg)("inlineCode",{parentName:"p"},"1024")," files. This causes the process to crash. A quick fix is to run ",(0,o.yg)("inlineCode",{parentName:"p"},"ulimit -n 4096")," (increase the number of open files allowed) and then restarting the process with ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad start"),". If you are using ",(0,o.yg)("inlineCode",{parentName:"p"},"systemd")," or another process manager to launch ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," (such as ",(0,o.yg)("a",{parentName:"p",href:"https://docs.cosmos.network/v0.45/run-node/cosmovisor.html"},"Cosmovisor"),") this may require some configuration at that level. A sample ",(0,o.yg)("inlineCode",{parentName:"p"},"systemd")," file to fix this issue is below:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-toml"},"# /etc/systemd/system/gaiad.service\n[Unit]\nDescription=Cosmos Gaia Node\nAfter=network.target\n\n[Service]\nType=simple\nUser=ubuntu\nWorkingDirectory=/home/ubuntu\nExecStart=/home/ubuntu/go/bin/gaiad start\nRestart=on-failure\nRestartSec=3\nLimitNOFILE=4096\n\n[Install]\nWantedBy=multi-user.target\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7b876406.be75b00c.js b/assets/js/7b876406.be75b00c.js new file mode 100644 index 00000000000..01ddd30438a --- /dev/null +++ b/assets/js/7b876406.be75b00c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[7799],{5680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>m});var t=n(6540);function o(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a =0||(o[n]=e[n]);return o}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=t.createContext({}),d=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},p=function(e){var a=d(e.components);return t.createElement(s.Provider,{value:a},e.children)},g="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),g=d(n),u=o,m=g["".concat(s,".").concat(u)]||g[u]||c[u]||r;return n?t.createElement(m,i(i({ref:a},p),{},{components:n})):t.createElement(m,i({ref:a},p))}));function m(e,a){var n=arguments,o=a&&a.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=u;var l={};for(var s in a)hasOwnProperty.call(a,s)&&(l[s]=a[s]);l.originalType=e,l[g]="string"==typeof e?e:o,i[1]=l;for(var d=2;d {n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>i,default:()=>c,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var t=n(8168),o=(n(6540),n(5680));const r={title:"Ledger Nano Support",order:3},i="Ledger Nano Support",l={unversionedId:"resources/ledger",id:"resources/ledger",title:"Ledger Nano Support",description:"Using a hardware wallet to store your keys greatly improves the security of your crypto assets. The Ledger device acts as an enclave of the seed and private keys, and the process of signing transactions takes place within it. No private information ever leaves the Ledger device. The following is a short tutorial on using the Cosmos Ledger app with the Gaia CLI or the Keplr wallet extension.",source:"@site/docs/resources/ledger.md",sourceDirName:"resources",slug:"/resources/ledger",permalink:"/main/resources/ledger",draft:!1,tags:[],version:"current",frontMatter:{title:"Ledger Nano Support",order:3},sidebar:"tutorialSidebar",previous:{title:"HD Wallets",permalink:"/main/resources/hd-wallets"},next:{title:"Building Gaia Deterministically",permalink:"/main/resources/reproducible-builds"}},s={},d=[{value:"Install the Cosmos Ledger application",id:"install-the-cosmos-ledger-application",level:2},{value:"Keplr + Ledger Nano",id:"keplr--ledger-nano",level:2},{value:"(Optional) Confirm your address",id:"optional-confirm-your-address",level:3},{value:"Gaia CLI + Ledger Nano",id:"gaia-cli--ledger-nano",level:2},{value:"Before you Begin",id:"before-you-begin",level:3},{value:"Add your Ledger key",id:"add-your-ledger-key",level:3},{value:"Confirm your address",id:"confirm-your-address",level:3},{value:"Connect to a full node",id:"connect-to-a-full-node",level:3},{value:"Sign a transaction",id:"sign-a-transaction",level:3},{value:"Receive funds",id:"receive-funds",level:3},{value:"Further documentation",id:"further-documentation",level:3},{value:"The Cosmos Standard Transaction",id:"the-cosmos-standard-transaction",level:2},{value:"Support",id:"support",level:2}],p={toc:d},g="wrapper";function c(e){let{components:a,...r}=e;return(0,o.yg)(g,(0,t.A)({},p,r,{components:a,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"ledger-nano-support"},"Ledger Nano Support"),(0,o.yg)("p",null,"Using a hardware wallet to store your keys greatly improves the security of your crypto assets. The Ledger device acts as an enclave of the seed and private keys, and the process of signing transactions takes place within it. No private information ever leaves the Ledger device. The following is a short tutorial on using the Cosmos Ledger app with the Gaia CLI or the ",(0,o.yg)("a",{parentName:"p",href:"https://www.keplr.app/"},"Keplr")," wallet extension."),(0,o.yg)("p",null,"At the core of a Ledger device there is a mnemonic seed phrase that is used to generate private keys. This phrase is generated when you initialize your Ledger. The mnemonic is compatible with Cosmos and can be used to seed new accounts."),(0,o.yg)("admonition",{type:"danger"},(0,o.yg)("p",{parentName:"admonition"},"Do not lose or share your 24 words with anyone. To prevent theft or loss of funds, it is best to keep multiple copies of your mnemonic stored in safe, secure places. If someone is able to gain access to your mnemonic, they will fully control the accounts associated with them.")),(0,o.yg)("h2",{id:"install-the-cosmos-ledger-application"},"Install the Cosmos Ledger application"),(0,o.yg)("p",null,"Installing the ",(0,o.yg)("inlineCode",{parentName:"p"},"Cosmos")," application on your ledger device is required before you can use either ",(0,o.yg)("a",{parentName:"p",href:"#keplr--ledger-nano"},"Keplr")," or ",(0,o.yg)("a",{parentName:"p",href:"#gaia-cli--ledger-nano"},(0,o.yg)("inlineCode",{parentName:"a"},"gaiad")),". To do so, you need to:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"Install ",(0,o.yg)("a",{parentName:"li",href:"https://www.ledger.com/ledger-live"},"Ledger Live")," on your machine."),(0,o.yg)("li",{parentName:"ol"},"Using Ledger Live, ",(0,o.yg)("a",{parentName:"li",href:"https://support.ledger.com/hc/en-us/articles/360002731113?docs=true"},"update your Ledger Nano S with the latest firmware"),"."),(0,o.yg)("li",{parentName:"ol"},"On the Ledger Live application, navigate to the ",(0,o.yg)("inlineCode",{parentName:"li"},"Manager")," menu .\n",(0,o.yg)("img",{alt:"manager",src:n(9771).A,width:"2034",height:"1526"})),(0,o.yg)("li",{parentName:"ol"},"Connect your Ledger Nano device and allow Ledger Manager from it."),(0,o.yg)("li",{parentName:"ol"},"On the Ledger Live application, Search for ",(0,o.yg)("inlineCode",{parentName:"li"},"Cosmos"),".\n",(0,o.yg)("img",{alt:"search",src:n(1092).A,width:"2044",height:"1532"})),(0,o.yg)("li",{parentName:"ol"},"Install the Cosmos application by clicking on ",(0,o.yg)("inlineCode",{parentName:"li"},"Install"),".")),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"To see the ",(0,o.yg)("inlineCode",{parentName:"p"},"Cosmos")," application when you search for it, you might need to activate the ",(0,o.yg)("inlineCode",{parentName:"p"},"Developer Mode"),", located in the Experimental features tab of the Ledger Live application.")),(0,o.yg)("p",null,(0,o.yg)("img",{alt:"Devmode",src:n(8667).A,width:"2040",height:"1530"})),(0,o.yg)("h2",{id:"keplr--ledger-nano"},"Keplr + Ledger Nano"),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Note: You need to ",(0,o.yg)("a",{parentName:"strong",href:"#install-the-cosmos-ledger-application"},"install the Cosmos app")," on your Ledger Nano before following this section")),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"Connect your Ledger device to your computer, unlock it with the PIN and open the Cosmos app."),(0,o.yg)("li",{parentName:"ol"},"Install the ",(0,o.yg)("a",{parentName:"li",href:"https://www.keplr.app/"},"Keplr browser extension"),"."),(0,o.yg)("li",{parentName:"ol"},"Click on the Keplr extension icon and select ",(0,o.yg)("inlineCode",{parentName:"li"},"Import Ledger")," and choose an account name and password."),(0,o.yg)("li",{parentName:"ol"},"Make sure your Ledger device is unlocked and has the Cosmos app open and then follow the instructions on the Keplr pop-up.")),(0,o.yg)("p",null,"That's it! You can now use Keplr with your Ledger Nano S. You can use the ",(0,o.yg)("a",{parentName:"p",href:"https://wallet.keplr.app/#/dashboard"},"Keplr web app")," to get a more detailed overview of your Cosmos account."),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Note: Each time you will send a transaction, you will need to confirm it on your Ledger device. Indication will be prompted from the Keplr interface")),(0,o.yg)("h3",{id:"optional-confirm-your-address"},"(Optional) Confirm your address"),(0,o.yg)("p",null,"You can double check that Keplr is displaying the correct address directly on your Ledger Nano device. To do so:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"Connect your Ledger to your computer and open the Cosmos application on the device."),(0,o.yg)("li",{parentName:"ol"},"Once the Cosmos app is open, click on the right button to access the ",(0,o.yg)("inlineCode",{parentName:"li"},"Show Address")," option."),(0,o.yg)("li",{parentName:"ol"},"Click on both button, then select ",(0,o.yg)("inlineCode",{parentName:"li"},"Account 0")," and ",(0,o.yg)("inlineCode",{parentName:"li"},"Index 0"),".")),(0,o.yg)("p",null,"You should now see the same address that is displayed on the Keplr extension."),(0,o.yg)("p",null,"To learn more about using Keplr, we suggest you have a look at their ",(0,o.yg)("a",{parentName:"p",href:"https://keplr.crunch.help"},"support documentation"),"."),(0,o.yg)("p",null,"You can also have a look at the ",(0,o.yg)("a",{parentName:"p",href:"https://support.ledger.com/hc/en-us/articles/4411149814417?docs=true"},"Ledger support page")," for more details."),(0,o.yg)("h2",{id:"gaia-cli--ledger-nano"},"Gaia CLI + Ledger Nano"),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Note: You need to ",(0,o.yg)("a",{parentName:"strong",href:"#install-the-cosmos-ledger-application"},"install the Cosmos app")," on your Ledger Nano before following this section")),(0,o.yg)("p",null,"The tool used to generate addresses and transactions on the Cosmos Hub network is ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad"),". Here is how to get started. If using a CLI tool is unfamiliar to you, scroll down and follow instructions for using the Keplr wallet instead."),(0,o.yg)("h3",{id:"before-you-begin"},"Before you Begin"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://golang.org/doc/install"},"Install Golang")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"../getting-started/installation"},"Install Gaia"))),(0,o.yg)("p",null,"Verify that gaiad is installed correctly with the following command"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad version --long\n\n\u279c cosmos-sdk: 0.34.3\ngit commit: 67ab0b1e1d1e5b898c8cbdede35ad5196dba01b2\nvendor hash: 0341b356ad7168074391ca7507f40b050e667722\nbuild tags: netgo ledger\ngo version go1.11.5 darwin/amd64\n")),(0,o.yg)("h3",{id:"add-your-ledger-key"},"Add your Ledger key"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Connect and unlock your Ledger device."),(0,o.yg)("li",{parentName:"ul"},"Open the Cosmos app on your Ledger."),(0,o.yg)("li",{parentName:"ul"},"Create an account in gaiad from your ledger key.")),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"Be sure to change the ",(0,o.yg)("em",{parentName:"p"},"keyName")," parameter to be a meaningful name. The ",(0,o.yg)("inlineCode",{parentName:"p"},"ledger")," flag tells ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," to use your Ledger to seed the account.")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add --ledger\n\n\u279c NAME: TYPE: ADDRESS: PUBKEY:\n ledger cosmos1... cosmospub1...\n")),(0,o.yg)("p",null,"Cosmos uses ",(0,o.yg)("a",{parentName:"p",href:"/main/resources/hd-wallets"},"HD Wallets"),". This means you can setup many accounts using the same Ledger seed. To create another account from your Ledger device, run (change the integer i to some value >= 0 to choose the account for HD derivation):"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys add --ledger --account \n")),(0,o.yg)("h3",{id:"confirm-your-address"},"Confirm your address"),(0,o.yg)("p",null,"Run this command to display your address on the device. Use the ",(0,o.yg)("inlineCode",{parentName:"p"},"keyName")," you gave your ledger key. The ",(0,o.yg)("inlineCode",{parentName:"p"},"-d")," flag is supported in version ",(0,o.yg)("inlineCode",{parentName:"p"},"1.5.0")," and higher."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys show -d\n")),(0,o.yg)("p",null,"Confirm that the address displayed on the device matches that displayed when you added the key."),(0,o.yg)("h3",{id:"connect-to-a-full-node"},"Connect to a full node"),(0,o.yg)("p",null,"Next, you need to configure gaiad with the URL of a Cosmos full node and the appropriate ",(0,o.yg)("inlineCode",{parentName:"p"},"chain_id"),". In this example we connect to the public load balanced full node operated by Chorus One on the ",(0,o.yg)("inlineCode",{parentName:"p"},"cosmoshub-2")," chain. But you can point your ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," to any Cosmos full node. Be sure that the ",(0,o.yg)("inlineCode",{parentName:"p"},"chain-id")," is set to the same chain as the full node."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad config node https://cosmos.chorus.one:26657\ngaiad config chain_id cosmoshub-2\n")),(0,o.yg)("p",null,"Test your connection with a query such as:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query staking validators\n")),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"To run your own full node locally ",(0,o.yg)("a",{parentName:"p",href:"/main/hub-tutorials/join-mainnet"},"read more here."),".")),(0,o.yg)("h3",{id:"sign-a-transaction"},"Sign a transaction"),(0,o.yg)("p",null,"You are now ready to start signing and sending transactions. Send a transaction with gaiad using the ",(0,o.yg)("inlineCode",{parentName:"p"},"tx send")," command."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send --help # to see all available options.\n")),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"Be sure to unlock your device with the PIN and open the Cosmos app before trying to run these commands")),(0,o.yg)("p",null,"Use the ",(0,o.yg)("inlineCode",{parentName:"p"},"keyName")," you set for your Ledger key and gaia will connect with the Cosmos Ledger app to then sign your transaction."),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx bank send \n")),(0,o.yg)("p",null,"When prompted with ",(0,o.yg)("inlineCode",{parentName:"p"},"confirm transaction before signing"),", Answer ",(0,o.yg)("inlineCode",{parentName:"p"},"Y"),"."),(0,o.yg)("p",null,"Next you will be prompted to review and approve the transaction on your Ledger device. Be sure to inspect the transaction JSON displayed on the screen. You can scroll through each field and each message. Scroll down to read more about the data fields of a standard transaction object."),(0,o.yg)("p",null,"Now, you are all set to start ",(0,o.yg)("a",{parentName:"p",href:"/main/delegators/delegator-guide-cli#sending-transactions"},"sending transactions on the network"),"."),(0,o.yg)("h3",{id:"receive-funds"},"Receive funds"),(0,o.yg)("p",null,"To receive funds to the Cosmos account on your Ledger device, retrieve the address for your Ledger account (the ones with ",(0,o.yg)("inlineCode",{parentName:"p"},"TYPE ledger"),") with this command:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad keys list\n\n\u279c NAME: TYPE: ADDRESS: PUBKEY:\n ledger cosmos1... cosmospub1...\n")),(0,o.yg)("h3",{id:"further-documentation"},"Further documentation"),(0,o.yg)("p",null,"Not sure what ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," can do? Simply run the command without arguments to output documentation for the commands in supports."),(0,o.yg)("admonition",{type:"tip"},(0,o.yg)("p",{parentName:"admonition"},"The ",(0,o.yg)("inlineCode",{parentName:"p"},"gaiad")," help commands are nested. So ",(0,o.yg)("inlineCode",{parentName:"p"},"$ gaiad")," will output docs for the top level commands (status, config, query, and tx). You can access documentation for sub commands with further help commands."),(0,o.yg)("p",{parentName:"admonition"},"For example, to print the ",(0,o.yg)("inlineCode",{parentName:"p"},"query")," commands:"),(0,o.yg)("pre",{parentName:"admonition"},(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad query --help\n")),(0,o.yg)("p",{parentName:"admonition"},"Or to print the ",(0,o.yg)("inlineCode",{parentName:"p"},"tx")," (transaction) commands:"),(0,o.yg)("pre",{parentName:"admonition"},(0,o.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad tx --help\n"))),(0,o.yg)("h2",{id:"the-cosmos-standard-transaction"},"The Cosmos Standard Transaction"),(0,o.yg)("p",null,"Transactions in Cosmos embed the ",(0,o.yg)("a",{parentName:"p",href:"https://godoc.org/github.com/cosmos/cosmos-sdk/x/auth#StdTx"},"Standard Transaction type")," from the Cosmos SDK. The Ledger device displays a serialized JSON representation of this object for you to review before signing the transaction. Here are the fields and what they mean:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"chain-id"),": The chain to which you are broadcasting the tx, such as the ",(0,o.yg)("inlineCode",{parentName:"li"},"gaia-13003")," testnet or ",(0,o.yg)("inlineCode",{parentName:"li"},"cosmoshub-2"),": mainnet."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"account_number"),": The global id of the sending account assigned when the account receives funds for the first time."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"sequence"),": The nonce for this account, incremented with each transaction."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"fee"),": JSON object describing the transaction fee, its gas amount and coin denomination"),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"memo"),": optional text field used in various ways to tag transactions."),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("inlineCode",{parentName:"li"},"msgs_ / "),": The array of messages included in the transaction. Double click to drill down into nested fields of the JSON.")),(0,o.yg)("h2",{id:"support"},"Support"),(0,o.yg)("p",null,"For further support, start by looking over the posts in our ",(0,o.yg)("a",{parentName:"p",href:"https://forum.cosmos.network/search?q=ledger"},"forum")),(0,o.yg)("p",null,"Feel welcome to reach out in our ",(0,o.yg)("a",{parentName:"p",href:"https://t.me/cosmosproject"},"Telegram channel")," to ask for help."),(0,o.yg)("p",null,"Here are a few relevant and helpful tutorials from the wonderful Cosmos community:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://catdotfish.medium.com/"},"Catdotfish")," - ",(0,o.yg)("a",{parentName:"li",href:"https://medium.com/chainapsis/how-to-use-keplr-wallet-40afc80907f6"},"How to use the Keplr Wallet")),(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://medium.com/cryptium"},"Cryptium Labs")," - ",(0,o.yg)("a",{parentName:"li",href:"https://medium.com/cryptium-cosmos/how-to-store-your-cosmos-atoms-on-your-ledger-and-delegate-with-the-command-line-929eb29705f"},"How to store your ATOMS on your Ledger and delegate with the command line"))))}c.isMDXComponent=!0},8667:(e,a,n)=>{n.d(a,{A:()=>t});const t=n.p+"assets/images/ledger-tuto-dev-mode-c4e394fda2491363a287cbf1fc82ab39.png"},9771:(e,a,n)=>{n.d(a,{A:()=>t});const t=n.p+"assets/images/ledger-tuto-manager-f0a3a54c10bfa2405995efaed78536f1.png"},1092:(e,a,n)=>{n.d(a,{A:()=>t});const t=n.p+"assets/images/ledger-tuto-search-d4d718ef5efa0fb720af125ef8819fd5.png"}}]); \ No newline at end of file diff --git a/assets/js/7b940702.cc2454a5.js b/assets/js/7b940702.cc2454a5.js new file mode 100644 index 00000000000..186bff150e6 --- /dev/null +++ b/assets/js/7b940702.cc2454a5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkcosmos_hub_docs_site=self.webpackChunkcosmos_hub_docs_site||[]).push([[1046],{5680:(e,n,a)=>{a.d(n,{xA:()=>p,yg:()=>y});var i=a(6540);function t(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function l(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,i)}return a}function o(e){for(var n=1;n =0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i =0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var r=i.createContext({}),d=function(e){var n=i.useContext(r),a=n;return e&&(a="function"==typeof e?e(n):o(o({},n),e)),a},p=function(e){var n=d(e.components);return i.createElement(r.Provider,{value:n},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return i.createElement(i.Fragment,{},n)}},u=i.forwardRef((function(e,n){var a=e.components,t=e.mdxType,l=e.originalType,r=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),g=d(a),u=t,y=g["".concat(r,".").concat(u)]||g[u]||m[u]||l;return a?i.createElement(y,o(o({ref:n},p),{},{components:a})):i.createElement(y,o({ref:n},p))}));function y(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var l=a.length,o=new Array(l);o[0]=u;var s={};for(var r in n)hasOwnProperty.call(n,r)&&(s[r]=n[r]);s.originalType=e,s[g]="string"==typeof e?e:t,o[1]=s;for(var d=2;d {a.r(n),a.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>m,frontMatter:()=>l,metadata:()=>s,toc:()=>d});var i=a(8168),t=(a(6540),a(5680));const l={title:"The Genesis File",order:1},o=void 0,s={unversionedId:"resources/genesis",id:"resources/genesis",title:"The Genesis File",description:"This document explains how the genesis file of the Cosmos Hub mainnet is structured. It also explains how you can build a genesis file for your own gaia testnet.",source:"@site/docs/resources/genesis.md",sourceDirName:"resources",slug:"/resources/genesis",permalink:"/main/resources/genesis",draft:!1,tags:[],version:"current",frontMatter:{title:"The Genesis File",order:1},sidebar:"tutorialSidebar",previous:{title:"Cosmos Hub Archives",permalink:"/main/resources/archives"},next:{title:"HD Wallets",permalink:"/main/resources/hd-wallets"}},r={},d=[{value:"What is a Genesis File",id:"what-is-a-genesis-file",level:2},{value:"Genesis Time and Chain_id",id:"genesis-time-and-chain_id",level:2},{value:"Consensus Parameters",id:"consensus-parameters",level:2},{value:"Application State",id:"application-state",level:2},{value:"Genesis Accounts",id:"genesis-accounts",level:3},{value:"Bank",id:"bank",level:3},{value:"Staking",id:"staking",level:3},{value:"Mint",id:"mint",level:3},{value:"Distribution",id:"distribution",level:3},{value:"Governance",id:"governance",level:3},{value:"Slashing",id:"slashing",level:3},{value:"Genesis Transactions",id:"genesis-transactions",level:3}],p={toc:d},g="wrapper";function m(e){let{components:n,...a}=e;return(0,t.yg)(g,(0,i.A)({},p,a,{components:n,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"This document explains how the genesis file of the Cosmos Hub mainnet is structured. It also explains how you can build a genesis file for your own ",(0,t.yg)("inlineCode",{parentName:"p"},"gaia")," testnet."),(0,t.yg)("p",null,"Note that you can generate a default genesis file for your own testnet by running the following command:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"gaiad init --chain-id \n")),(0,t.yg)("p",null,"The genesis file is stored in ",(0,t.yg)("inlineCode",{parentName:"p"},"~/.gaia/config/genesis.toml"),"."),(0,t.yg)("h2",{id:"what-is-a-genesis-file"},"What is a Genesis File"),(0,t.yg)("p",null,"A genesis file is a JSON file which defines the initial state of your blockchain. It can be seen as height ",(0,t.yg)("inlineCode",{parentName:"p"},"0")," of your blockchain. The first block, at height ",(0,t.yg)("inlineCode",{parentName:"p"},"1"),", will reference the genesis file as its parent."),(0,t.yg)("p",null,"The state defined in the genesis file contains all the necessary information, like initial token allocation, genesis time, default parameters, and more. Let us break down this information."),(0,t.yg)("h2",{id:"genesis-time-and-chain_id"},"Genesis Time and Chain_id"),(0,t.yg)("p",null,"The ",(0,t.yg)("inlineCode",{parentName:"p"},"genesis_time")," is defined at the top of the genesis file. It is a ",(0,t.yg)("inlineCode",{parentName:"p"},"UTC")," timestamp that specifies when the blockchain is due to start. At this time, genesis validators are supposed to come online and start participating in the consensus process. The blockchain starts when more than 2/3rd of the genesis validators (weighted by voting power) are online."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-json"},'"genesis_time": "2019-03-13T17:00:00.000000000Z",\n')),(0,t.yg)("p",null,"The ",(0,t.yg)("inlineCode",{parentName:"p"},"chain_id")," is a unique identifier for your chain. It helps differentiate between different chains using the same version of the software."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-json"},'"chain_id": "cosmoshub-2",\n')),(0,t.yg)("h2",{id:"consensus-parameters"},"Consensus Parameters"),(0,t.yg)("p",null,"Next, the genesis file defines consensus parameters. Consensus parameters regroup all the parameters that are related to the consensus layer, which is ",(0,t.yg)("inlineCode",{parentName:"p"},"Tendermint")," in the case of ",(0,t.yg)("inlineCode",{parentName:"p"},"gaia"),". Let us look at these parameters:"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"block"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"max_bytes"),": Maximum number of bytes per block."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"max_gas"),": Gas limit per block. Each transaction included in the block will consume some gas. The total gas used by transactions included in a block cannot exceed this limit."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"evidence"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"max_age"),": An evidence is a proof that a validator signed two different blocks at the same height (and round). This is an explicitly malicious behaviour that is punished at the state-machine level. The ",(0,t.yg)("inlineCode",{parentName:"li"},"max_age")," defines the maximum number of ",(0,t.yg)("strong",{parentName:"li"},"blocks")," after which an evidence is not valid anymore."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"validator"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"pub_key_types"),": The types of pubkey (",(0,t.yg)("inlineCode",{parentName:"li"},"ed25519"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"secp256k1"),", ...) that are accepted for validators. Currently only ",(0,t.yg)("inlineCode",{parentName:"li"},"ed25519")," is accepted.")))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-json"},'"consensus_params": {\n "block_size": {\n "max_bytes": "150000",\n "max_gas": "1500000"\n },\n "evidence": {\n "max_age": "1000000"\n },\n "validator": {\n "pub_key_types": [\n "ed25519"\n ]\n }\n },\n')),(0,t.yg)("h2",{id:"application-state"},"Application State"),(0,t.yg)("p",null,"The application state defines the initial state of the state-machine."),(0,t.yg)("h3",{id:"genesis-accounts"},"Genesis Accounts"),(0,t.yg)("p",null,"In this section, the initial allocation of tokens is defined. It is possible to add accounts manually by directly editing the genesis file, but it is also possible to use the following command:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"// Example: gaiad add-genesis-account cosmos1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z37gh3h 10000000uatom\n\ngaiad genesis add-genesis-account