From 2d7f5c40808c4934acbc26b2433e4d5bcb1a8587 Mon Sep 17 00:00:00 2001 From: Denali Marsh Date: Wed, 3 Jun 2020 11:54:31 -0700 Subject: [PATCH] [R4R] Better docs (#541) * update sidebar order * update event backticks * fix broken links * fix spelling --- docs/.vuepress/config.js | 16 +++-- docs/post.sh | 4 +- docs/pre.sh | 15 ++-- x/auction/spec/01_concepts.md | 4 ++ x/auction/spec/02_state.md | 4 ++ x/auction/spec/03_messages.md | 4 ++ x/auction/spec/04_events.md | 44 ++++++------ x/auction/spec/05_params.md | 4 ++ x/auction/spec/06_begin_block.md | 4 ++ x/auction/spec/README.md | 7 ++ x/bep3/spec/01_concepts.md | 6 +- x/bep3/spec/02_state.md | 4 ++ x/bep3/spec/03_messages.md | 4 ++ x/bep3/spec/04_events.md | 72 ++++++++++--------- x/bep3/spec/05_params.md | 4 ++ x/bep3/spec/06_begin_block.md | 4 ++ x/bep3/spec/README.md | 7 ++ x/cdp/spec/01_concepts.md | 6 +- x/cdp/spec/02_state.md | 6 +- x/cdp/spec/03_messages.md | 4 ++ x/cdp/spec/{06_params.md => 04_params.md} | 4 ++ x/cdp/spec/05_events.md | 72 ++++++++++--------- .../{04_begin_block.md => 06_begin_block.md} | 4 ++ x/cdp/spec/README.md | 11 ++- x/committee/spec/01_concepts.md | 4 ++ x/committee/spec/02_state.md | 4 ++ x/committee/spec/03_messages.md | 4 ++ x/committee/spec/04_events.md | 24 ++++--- x/committee/spec/05_params.md | 4 ++ x/committee/spec/06_begin_block.md | 4 ++ x/committee/spec/README.md | 6 ++ x/incentive/spec/01_concepts.md | 4 ++ x/incentive/spec/02_state.md | 4 ++ x/incentive/spec/03_messages.md | 4 ++ x/incentive/spec/04_events.md | 26 ++++--- x/incentive/spec/05_params.md | 4 ++ x/incentive/spec/06_begin_block.md | 4 ++ x/incentive/spec/README.md | 7 ++ x/kavadist/spec/01_concepts.md | 4 ++ x/kavadist/spec/02_state.md | 4 ++ x/kavadist/spec/03_messages.md | 4 ++ x/kavadist/spec/04_events.md | 6 +- x/kavadist/spec/05_params.md | 4 ++ x/kavadist/spec/06_begin_block.md | 4 ++ x/kavadist/spec/README.md | 7 ++ x/pricefeed/spec/01_concepts.md | 4 ++ x/pricefeed/spec/02_state.md | 4 ++ x/pricefeed/spec/03_messages.md | 4 ++ x/pricefeed/spec/04_events.md | 30 ++++---- x/pricefeed/spec/05_params.md | 4 ++ x/pricefeed/spec/06_end_block.md | 4 ++ x/pricefeed/spec/README.md | 7 ++ x/validator-vesting/spec/01_concepts.md | 4 ++ x/validator-vesting/spec/02_state.md | 4 ++ x/validator-vesting/spec/03_begin_block.md | 4 ++ x/validator-vesting/spec/README.md | 7 ++ 56 files changed, 388 insertions(+), 138 deletions(-) rename x/cdp/spec/{06_params.md => 04_params.md} (99%) rename x/cdp/spec/{04_begin_block.md => 06_begin_block.md} (99%) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 80916ec1..47925c8f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -13,12 +13,20 @@ module.exports = { children: [ { title: "Chainlink Price Oracle", - path: "https://docs.kava.io/Tools/oracle.html" + path: "/tools/oracle.html" }, { title: "Auction Bot", - path: "https://docs.kava.io/Tools/auction.html", - static: true + path: "/tools/auction.html", + } + ] + }, + { + title: "Building on Kava", + children: [ + { + title: "JavaScript SDK", + path: "/building/javascript-sdk.html" } ] }, @@ -31,7 +39,7 @@ module.exports = { }, { title: "Protocol Reference", - path: "https://godoc.org/github.com/Kava-Labs/kava" + path: "https://pkg.go.dev/github.com/kava-labs/kava?tab=subdirectories" } ] }, diff --git a/docs/post.sh b/docs/post.sh index cdc90f62..d7de094c 100755 --- a/docs/post.sh +++ b/docs/post.sh @@ -4,7 +4,7 @@ rm -rf Modules # JavaScript SDK docs - rm -rf Building + rm -rf building # Kava Tools docs - rm -rf Tools + rm -rf tools diff --git a/docs/pre.sh b/docs/pre.sh index 36ef66b7..f03365b6 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -5,7 +5,7 @@ mkdir -p Modules for D in ../x/*; do if [ -d "${D}" ]; then rm -rf "Modules/$(echo $D | awk -F/ '{print $NF}')" - mkdir -p "Modules/$(echo $D | awk -F/ '{print $NF}')" && cp -r $D/spec/* "$_" && mv "./$_/README.md" "./$_/00_README.md" + mkdir -p "Modules/$(echo $D | awk -F/ '{print $NF}')" && cp -r $D/spec/* "$_" fi done @@ -13,18 +13,25 @@ baseGitUrl="https://raw.githubusercontent.com/Kava-Labs" # Client docs (JavaScript SDK) clientGitRepo="javascript-sdk" -clientDir="Building" +clientDir="building" mkdir -p "./${clientDir}" curl "${baseGitUrl}/${clientGitRepo}/master/README.md" -o "./${clientDir}/${clientGitRepo}.md" +echo "--- +parent: + order: false +---" > "./${clientDir}/readme.md" # Kava Tools docs toolsGitRepo="kava-tools" -toolsDir="Tools" +toolsDir="tools" toolDocs=("auction" "oracle") mkdir -p "./${toolsDir}" for T in ${toolDocs[@]}; do curl "${baseGitUrl}/${toolsGitRepo}/master/${T}/README.md" -o "./${toolsDir}/${T}.md" done - +echo "--- +parent: + order: false +---" > "./${toolsDir}/readme.md" \ No newline at end of file diff --git a/x/auction/spec/01_concepts.md b/x/auction/spec/01_concepts.md index a7365d0c..9c47f348 100644 --- a/x/auction/spec/01_concepts.md +++ b/x/auction/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts Auctions are broken down into three distinct types, which correspond to three specific functionalities within the CDP system. diff --git a/x/auction/spec/02_state.md b/x/auction/spec/02_state.md index a85a8cc3..29046fe7 100644 --- a/x/auction/spec/02_state.md +++ b/x/auction/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Parameters and genesis state diff --git a/x/auction/spec/03_messages.md b/x/auction/spec/03_messages.md index 3a26a722..92fff7a5 100644 --- a/x/auction/spec/03_messages.md +++ b/x/auction/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages ## Bidding diff --git a/x/auction/spec/04_events.md b/x/auction/spec/04_events.md index 4da22b31..36992c04 100644 --- a/x/auction/spec/04_events.md +++ b/x/auction/spec/04_events.md @@ -1,34 +1,38 @@ + + # Events The `x/auction` module emits the following events: ## Triggered By Other Modules -| Type | Attribute Key | Attribute Value | -|---------------|---------------|-----------------| -| auction_start | auction_id | {auction ID} | -| auction_start | auction_type | {auction type} | -| auction_start | lot | {coin amount} | -| auction_start | bid | {coin amount} | -| auction_start | max_bid | {coin amount} | +| Type | Attribute Key | Attribute Value | +|---------------|---------------|-------------------| +| auction_start | auction_id | `{auction ID}` | +| auction_start | auction_type | `{auction type}` | +| auction_start | lot | `{coin amount}` | +| auction_start | bid | `{coin amount}` | +| auction_start | max_bid | `{coin amount}` | ## Handlers ### MsgPlaceBid -| Type | Attribute Key | Attribute Value | -|-------------|---------------|--------------------| -| auction_bid | auction_id | {auction ID} | -| auction_bid | bidder | {latest bidder} | -| auction_bid | bid | {coin amount} | -| auction_bid | lot | {coin amount} | -| auction_bid | end_time | {auction end time} | -| message | module | auction | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|-------------|---------------|----------------------| +| auction_bid | auction_id | `{auction ID}` | +| auction_bid | bidder | `{latest bidder}` | +| auction_bid | bid | `{coin amount}` | +| auction_bid | lot | `{coin amount}` | +| auction_bid | end_time | `{auction end time}` | +| message | module | auction | +| message | sender | `{sender address}` | ## BeginBlock -| Type | Attribute Key | Attribute Value | -|---------------|---------------|-----------------| -| auction_close | auction_id | {auction ID} | -| auction_close | close_block | {block height} | +| Type | Attribute Key | Attribute Value | +|---------------|---------------|-------------------| +| auction_close | auction_id | `{auction ID}` | +| auction_close | close_block | `{block height}` | diff --git a/x/auction/spec/05_params.md b/x/auction/spec/05_params.md index c5ce5c52..88960f9c 100644 --- a/x/auction/spec/05_params.md +++ b/x/auction/spec/05_params.md @@ -1,3 +1,7 @@ + + # Parameters The auction module contains the following parameters: diff --git a/x/auction/spec/06_begin_block.md b/x/auction/spec/06_begin_block.md index c673159a..64c6a6a0 100644 --- a/x/auction/spec/06_begin_block.md +++ b/x/auction/spec/06_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At the start of each block, auctions that have reached `EndTime` are closed. The logic to close auctions is as follows: diff --git a/x/auction/spec/README.md b/x/auction/spec/README.md index 32ae71d1..5ba72788 100644 --- a/x/auction/spec/README.md +++ b/x/auction/spec/README.md @@ -1,3 +1,10 @@ + + # `auction` diff --git a/x/bep3/spec/01_concepts.md b/x/bep3/spec/01_concepts.md index f897237c..db89b389 100644 --- a/x/bep3/spec/01_concepts.md +++ b/x/bep3/spec/01_concepts.md @@ -1,6 +1,10 @@ + + # Concepts - The BEP3 module implements the [BEP3 protocol](https://github.com/binance-chain/BEPs/blob/master/BEP3.md) for secure cross-chain asset transfers between Kava and other BEP3 compatible chains, such as Binance Chain. Tranactions are witnessed and relayed between the two blockchains by Binance's BEP3 deputy process. The deputy maintains an address on both chains and is responsible for delivering tokens upon the successful completion of an Atomic Swap. Learn more about the BEP3 deputy process [here](https://github.com/binance-chain/bep3-deputy). + The BEP3 module implements the [BEP3 protocol](https://github.com/binance-chain/BEPs/blob/master/BEP3.md) for secure cross-chain asset transfers between Kava and other BEP3 compatible chains, such as Binance Chain. Transactions are witnessed and relayed between the two blockchains by Binance's BEP3 deputy process. The deputy maintains an address on both chains and is responsible for delivering tokens upon the successful completion of an Atomic Swap. Learn more about the BEP3 deputy process [here](https://github.com/binance-chain/bep3-deputy). ## Requirements Kava diff --git a/x/bep3/spec/02_state.md b/x/bep3/spec/02_state.md index 50b6a958..11a7ee99 100644 --- a/x/bep3/spec/02_state.md +++ b/x/bep3/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Parameters and genesis state diff --git a/x/bep3/spec/03_messages.md b/x/bep3/spec/03_messages.md index 0b22692d..9274c818 100644 --- a/x/bep3/spec/03_messages.md +++ b/x/bep3/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages ## Create swap diff --git a/x/bep3/spec/04_events.md b/x/bep3/spec/04_events.md index df4b7d66..8fcd59ad 100644 --- a/x/bep3/spec/04_events.md +++ b/x/bep3/spec/04_events.md @@ -1,3 +1,7 @@ + + # Events The `x/bep3` module emits the following events: @@ -6,46 +10,46 @@ The `x/bep3` module emits the following events: ### MsgCreateAtomicSwap -| Type | Attribute Key | Attribute Value | -|--------------------|--------------------|--------------------------| -| create_atomic_swap | sender | {sender address} | -| create_atomic_swap | recipient | {recipient address} | -| create_atomic_swap | atomic_swap_id | {swap ID} | -| create_atomic_swap | random_number_hash | {random number hash} | -| create_atomic_swap | timestamp | {timestamp} | -| create_atomic_swap | sender_other_chain | {sender other chain} | -| create_atomic_swap | expire_height | {swap expiration block} | -| create_atomic_swap | amount | {coin amount} | -| create_atomic_swap | direction | {incoming or outgoing} | -| message | module | bep3 | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|--------------------|--------------------|---------------------------| +| create_atomic_swap | sender | `{sender address}` | +| create_atomic_swap | recipient | `{recipient address}` | +| create_atomic_swap | atomic_swap_id | `{swap ID}` | +| create_atomic_swap | random_number_hash | `{random number hash}` | +| create_atomic_swap | timestamp | `{timestamp}` | +| create_atomic_swap | sender_other_chain | `{sender other chain}` | +| create_atomic_swap | expire_height | `{swap expiration block}` | +| create_atomic_swap | amount | `{coin amount}` | +| create_atomic_swap | direction | `{incoming or outgoing}` | +| message | module | bep3 | +| message | sender | `{sender address}` | ### MsgClaimAtomicSwap -| Type | Attribute Key | Attribute Value | -|--------------------|--------------------|--------------------------| -| claim_atomic_swap | claim_sender | {sender address} | -| claim_atomic_swap | recipient | {recipient address} | -| claim_atomic_swap | atomic_swap_id | {swap ID} | -| claim_atomic_swap | random_number_hash | {random number hash} | -| claim_atomic_swap | random_number | {secret random number} | -| message | module | bep3 | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|--------------------|--------------------|---------------------------| +| claim_atomic_swap | claim_sender | `{sender address}` | +| claim_atomic_swap | recipient | `{recipient address}` | +| claim_atomic_swap | atomic_swap_id | `{swap ID}` | +| claim_atomic_swap | random_number_hash | `{random number hash}` | +| claim_atomic_swap | random_number | `{secret random number}` | +| message | module | bep3 | +| message | sender | `{sender address}` | ## MsgRefundAtomicSwap -| Type | Attribute Key | Attribute Value | -|--------------------|--------------------|--------------------------| -| refund_atomic_swap | refund_sender | {sender address} | -| refund_atomic_swap | sender | {swap creator address} | -| refund_atomic_swap | atomic_swap_id | {swap ID} | -| refund_atomic_swap | random_number_hash | {random number hash} | -| message | module | bep3 | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|--------------------|--------------------|---------------------------| +| refund_atomic_swap | refund_sender | `{sender address}` | +| refund_atomic_swap | sender | `{swap creator address}` | +| refund_atomic_swap | atomic_swap_id | `{swap ID}` | +| refund_atomic_swap | random_number_hash | `{random number hash}` | +| message | module | bep3 | +| message | sender | `{sender address}` | ## BeginBlock -| Type | Attribute Key | Attribute Value | -|---------------|------------------|------------------------------| -| swaps_expired | atomic_swap_ids | {array of swap IDs} | -| swaps_expired | expiration_block | {block height at expiration} | +| Type | Attribute Key | Attribute Value | +|---------------|------------------|----------------------------------| +| swaps_expired | atomic_swap_ids | `{array of swap IDs}` | +| swaps_expired | expiration_block | `{block height at expiration}` | diff --git a/x/bep3/spec/05_params.md b/x/bep3/spec/05_params.md index d51312dd..be2b0782 100644 --- a/x/bep3/spec/05_params.md +++ b/x/bep3/spec/05_params.md @@ -1,3 +1,7 @@ + + # Parameters The bep3 module contains the following parameters: diff --git a/x/bep3/spec/06_begin_block.md b/x/bep3/spec/06_begin_block.md index ee5db461..a1d9f74d 100644 --- a/x/bep3/spec/06_begin_block.md +++ b/x/bep3/spec/06_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At the start of each block, atomic swaps that meet certain criteria are expired or deleted. diff --git a/x/bep3/spec/README.md b/x/bep3/spec/README.md index bf850db1..542df85a 100644 --- a/x/bep3/spec/README.md +++ b/x/bep3/spec/README.md @@ -1,3 +1,10 @@ + + # `bep3` diff --git a/x/cdp/spec/01_concepts.md b/x/cdp/spec/01_concepts.md index b7a51006..7e8876f9 100644 --- a/x/cdp/spec/01_concepts.md +++ b/x/cdp/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts ## Collateralized Debt Positions @@ -58,7 +62,7 @@ Fees accumulate to the system and are split between the savings rate and surplus ## Governance -The cdp module's behavior is controlled through several parameters which are updated through a governance mechanism. These parameters are listed in [Parameters](06_params.md). +The cdp module's behavior is controlled through several parameters which are updated through a governance mechanism. These parameters are listed in [Parameters](04_params.md). Governance is important for actions such as: diff --git a/x/cdp/spec/02_state.md b/x/cdp/spec/02_state.md index 07520c38..067e0bef 100644 --- a/x/cdp/spec/02_state.md +++ b/x/cdp/spec/02_state.md @@ -1,3 +1,7 @@ + + # State For detail on the state tracked by the cdp module see the types package. In particular [keys.go](../types/keys.go) describes how state is stored in the key-value store. @@ -49,7 +53,7 @@ type Deposit struct { ## Params -Module parameters controlled by governance. See [Parameters](06_params.md) for details. +Module parameters controlled by governance. See [Parameters](04_params.md) for details. ## NextCDPID diff --git a/x/cdp/spec/03_messages.md b/x/cdp/spec/03_messages.md index 9f7d976d..4b968154 100644 --- a/x/cdp/spec/03_messages.md +++ b/x/cdp/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages Users can submit various messages to the cdp module which trigger state changes detailed below. diff --git a/x/cdp/spec/06_params.md b/x/cdp/spec/04_params.md similarity index 99% rename from x/cdp/spec/06_params.md rename to x/cdp/spec/04_params.md index 7c1fdfc2..70e4b16c 100644 --- a/x/cdp/spec/06_params.md +++ b/x/cdp/spec/04_params.md @@ -1,3 +1,7 @@ + + # Parameters The cdp module contains the following parameters: diff --git a/x/cdp/spec/05_events.md b/x/cdp/spec/05_events.md index 863806ee..d001d496 100644 --- a/x/cdp/spec/05_events.md +++ b/x/cdp/spec/05_events.md @@ -1,3 +1,7 @@ + + # Events The cdp module emits the following events: @@ -6,59 +10,59 @@ The cdp module emits the following events: ### MsgCreateCDP -| Type | Attribute Key | Attribute Value | -|-------------|---------------|------------------| -| message | module | cdp | -| message | sender | {sender address} | -| create_cdp | cdp_id | {cdp id} | -| cdp_deposit | cdp_id | {cdp id} | -| cdp_deposit | amount | {deposit amount} | -| cdp_draw | cdp_id | {cdp id} | -| cdp_draw | amount | {draw amount} | +| Type | Attribute Key | Attribute Value | +|-------------|---------------|--------------------| +| message | module | cdp | +| message | sender | `{sender address}' | +| create_cdp | cdp_id | `{cdp id}' | +| cdp_deposit | cdp_id | `{cdp id}' | +| cdp_deposit | amount | `{deposit amount}' | +| cdp_draw | cdp_id | `{cdp id}' | +| cdp_draw | amount | `{draw amount}' | ### MsgWithdraw | Type | Attribute Key | Attribute Value | |---------|--------------- |-----------------------| -| message | cdp_withdrawal | {collateral amount} | -| message | cdp_id | {cdp_id} | +| message | cdp_withdrawal | `{collateral amount}' | +| message | cdp_id | `{cdp_id}' | | message | module | cdp | -| message | sender | {sender address} | +| message | sender | `{sender address}' | ### MsgDeposit -| Type | Attribute Key | Attribute Value | -|-------------|---------------|------------------| -| message | module | cdp | -| message | sender | {sender address} | -| cdp_deposit | cdp_id | {cdp id} | -| cdp_deposit | amount | {deposit amount} | +| Type | Attribute Key | Attribute Value | +|-------------|---------------|--------------------| +| message | module | cdp | +| message | sender | `{sender address}' | +| cdp_deposit | cdp_id | `{cdp id}' | +| cdp_deposit | amount | `{deposit amount}' | ### MsgDrawDebt -| Type | Attribute Key | Attribute Value | -|----------|---------------|------------------| -| message | module | cdp | -| message | sender | {sender address} | -| cdp_draw | cdp_id | {cdp id} | -| cdp_draw | amount | {draw amount} | +| Type | Attribute Key | Attribute Value | +|----------|---------------|--------------------| +| message | module | cdp | +| message | sender | `{sender address}' | +| cdp_draw | cdp_id | `{cdp id}' | +| cdp_draw | amount | `{draw amount}' | ### MsgRepayDebt -| Type | Attribute Key | Attribute Value | -|---------------|---------------|--------------------| -| cdp_repayment | amount | {repayment amount} | -| cdp_repayment | cdp_id | {cdp id} | -| cdp_close | cdp_id | {cdp id} | -| message | module | cdp | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|---------------|---------------|----------------------| +| cdp_repayment | amount | `{repayment amount}' | +| cdp_repayment | cdp_id | `{cdp id}' | +| cdp_close | cdp_id | `{cdp id}' | +| message | module | cdp | +| message | sender | `{sender address}' | ## BeginBlock | Type | Attribute Key | Attribute Value | |-------------------------|---------------|---------------------| | cdp_liquidation | module | cdp | -| cdp_liquidation | cdp_id | {cdp id} | -| cdp_liquidation | deposit | {deposit} | +| cdp_liquidation | cdp_id | `{cdp id}' | +| cdp_liquidation | deposit | `{deposit}' | | cdp_begin_blocker_error | module | cdp | -| cdp_begin_blocker_error | error_message | {error} | +| cdp_begin_blocker_error | error_message | `{error}' | diff --git a/x/cdp/spec/04_begin_block.md b/x/cdp/spec/06_begin_block.md similarity index 99% rename from x/cdp/spec/04_begin_block.md rename to x/cdp/spec/06_begin_block.md index b4f947fd..cae98e21 100644 --- a/x/cdp/spec/04_begin_block.md +++ b/x/cdp/spec/06_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At the start of every block the BeginBlock of the cdp module: diff --git a/x/cdp/spec/README.md b/x/cdp/spec/README.md index a8006589..225f2d01 100644 --- a/x/cdp/spec/README.md +++ b/x/cdp/spec/README.md @@ -1,3 +1,10 @@ + + # `cdp` ## Table of Contents @@ -5,9 +12,9 @@ 1. **[Concepts](01_concepts.md)** 2. **[State](02_state.md)** 3. **[Messages](03_messages.md)** -4. **[BeginBlock](04_begin_block.md)** +4. **[Parameters](04_params.md)** 5. **[Events](05_events.md)** -6. **[Parameters](06_params.md)** +6. **[BeginBlock](06_begin_block.md)** ## Overview diff --git a/x/committee/spec/01_concepts.md b/x/committee/spec/01_concepts.md index d19d6ae5..0a6762a4 100644 --- a/x/committee/spec/01_concepts.md +++ b/x/committee/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts For a general introduction to governance using the Comsos-SDK, see [x/gov](https://github.com/cosmos/cosmos-sdk/blob/v0.38.3/x/gov/spec/01_concepts.md). diff --git a/x/committee/spec/02_state.md b/x/committee/spec/02_state.md index 362fb2bc..97505500 100644 --- a/x/committee/spec/02_state.md +++ b/x/committee/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Genesis state diff --git a/x/committee/spec/03_messages.md b/x/committee/spec/03_messages.md index 2db9cf5a..fd00a3bc 100644 --- a/x/committee/spec/03_messages.md +++ b/x/committee/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages Committee members submit proposals using a `MsgSubmitProposal` diff --git a/x/committee/spec/04_events.md b/x/committee/spec/04_events.md index bbf79a53..0411b351 100644 --- a/x/committee/spec/04_events.md +++ b/x/committee/spec/04_events.md @@ -1,3 +1,7 @@ + + # Events The `x/committee` module emits the following events: @@ -6,25 +10,25 @@ The `x/committee` module emits the following events: | Type | Attribute Key | Attribute Value | |----------------------|---------------------|--------------------| -| proposal_submit | committee_id | {committee ID} | -| proposal_submit | proposal_id | {proposal ID} | +| proposal_submit | committee_id | {'committee ID}' | +| proposal_submit | proposal_id | {'proposal ID}' | | message | module | committee | -| message | sender | {sender address} | +| message | sender | {'sender address}' | ## MsgVote | Type | Attribute Key | Attribute Value | |----------------------|---------------------|--------------------| -| proposal_vote | committee_id | {committee ID} | -| proposal_vote | proposal_id | {proposal ID} | -| proposal_vote | voter | {voter address} | +| proposal_vote | committee_id | {'committee ID}' | +| proposal_vote | proposal_id | {'proposal ID}' | +| proposal_vote | voter | {'voter address}' | | message | module | committee | -| message | sender | {sender address} | +| message | sender | {'sender address}' | ## BeginBlock | Type | Attribute Key | Attribute Value | |----------------------|---------------------|--------------------| -| proposal_close | committee_id | {committee ID} | -| proposal_close | proposal_id | {proposal ID} | -| proposal_close | status | {outcome} | +| proposal_close | committee_id | {'committee ID}' | +| proposal_close | proposal_id | {'proposal ID}' | +| proposal_close | status | {'outcome}' | diff --git a/x/committee/spec/05_params.md b/x/committee/spec/05_params.md index 9785d7f9..27c8df37 100644 --- a/x/committee/spec/05_params.md +++ b/x/committee/spec/05_params.md @@ -1,3 +1,7 @@ + + # Parameters The committee module has no parameters. Committees are created using the `x/gov` module and and inherit the parameters controlling governance proposals from `x/gov`. diff --git a/x/committee/spec/06_begin_block.md b/x/committee/spec/06_begin_block.md index 4e4e602d..baeae944 100644 --- a/x/committee/spec/06_begin_block.md +++ b/x/committee/spec/06_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At the start of each block, expired proposals are deleted. The logic is as follows: diff --git a/x/committee/spec/README.md b/x/committee/spec/README.md index fa9b3dff..da753625 100644 --- a/x/committee/spec/README.md +++ b/x/committee/spec/README.md @@ -1,3 +1,9 @@ + # `committee` diff --git a/x/incentive/spec/01_concepts.md b/x/incentive/spec/01_concepts.md index 3074feb0..e3e68edf 100644 --- a/x/incentive/spec/01_concepts.md +++ b/x/incentive/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts This module presents an implementation of user incentives that are controlled by governance. When users take a certain action, in this case opening a CDP, they become eligible for rewards. Rewards are __opt in__ meaning that users must submit a message before the claim deadline to claim their rewards. The goals and background of this module were subject of a previous Kava governance proposal, which can be found [here](https://ipfs.io/ipfs/QmSYedssC3nyQacDJmNcREtgmTPyaMx2JX7RNkMdAVkdkr/user-growth-fund-proposal.pdf). diff --git a/x/incentive/spec/02_state.md b/x/incentive/spec/02_state.md index 34b5258d..f05ed35c 100644 --- a/x/incentive/spec/02_state.md +++ b/x/incentive/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Parameters and Genesis State diff --git a/x/incentive/spec/03_messages.md b/x/incentive/spec/03_messages.md index 8d1910b2..71c29dbf 100644 --- a/x/incentive/spec/03_messages.md +++ b/x/incentive/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages Users claim rewards using a `MsgClaimReward`. diff --git a/x/incentive/spec/04_events.md b/x/incentive/spec/04_events.md index 8bc1d8a6..037dabc5 100644 --- a/x/incentive/spec/04_events.md +++ b/x/incentive/spec/04_events.md @@ -1,20 +1,24 @@ + + # Events The `x/incentive` module emits the following events: ## MsgClaimReward -| Type | Attribute Key | Attribute Value | -|----------------------|---------------------|--------------------| -| claim_reward | claimed_by | {claiming address} | -| claim_reward | claim_amount | {amount claimed} | -| message | module | incentive | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|----------------------|---------------------|----------------------| +| claim_reward | claimed_by | `{claiming address}' | +| claim_reward | claim_amount | `{amount claimed}' | +| message | module | incentive | +| message | sender | `{sender address}' | ## BeginBlock -| Type | Attribute Key | Attribute Value | -|----------------------|---------------------|--------------------| -| new_claim_period | claim_period | {claim period} | -| new_reward_period | reward_period | {reward period} | -| claim_period_expiry | claim_period | {claim period} | +| Type | Attribute Key | Attribute Value | +|----------------------|---------------------|----------------------| +| new_claim_period | claim_period | `{claim period}' | +| new_reward_period | reward_period | `{reward period}' | +| claim_period_expiry | claim_period | `{claim period}' | diff --git a/x/incentive/spec/05_params.md b/x/incentive/spec/05_params.md index 857ba1ef..6742914c 100644 --- a/x/incentive/spec/05_params.md +++ b/x/incentive/spec/05_params.md @@ -1,3 +1,7 @@ + + # Parameters The incentive module contains the following parameters: diff --git a/x/incentive/spec/06_begin_block.md b/x/incentive/spec/06_begin_block.md index 47825384..f2228d4e 100644 --- a/x/incentive/spec/06_begin_block.md +++ b/x/incentive/spec/06_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At the start of each block, expired claims and claim periods are deleted, rewards are applied to CDPs for any ongoing reward periods, expired reward periods are deleted and replaced with a new reward period (if active), and claim periods are created for expiring reward periods. The logic is as follows: diff --git a/x/incentive/spec/README.md b/x/incentive/spec/README.md index 91b783c5..8f803c34 100644 --- a/x/incentive/spec/README.md +++ b/x/incentive/spec/README.md @@ -1,3 +1,10 @@ + + # `incentive` diff --git a/x/kavadist/spec/01_concepts.md b/x/kavadist/spec/01_concepts.md index 4c9c4bd7..a5962e46 100644 --- a/x/kavadist/spec/01_concepts.md +++ b/x/kavadist/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts The minting mechanism in this module is designed to allow governance to determine a set of inflationary periods and the APR rate of inflation for each period. This module mints coins each block according to the schedule such that after 1 year the APR inflation worth of coins will have been minted. Governance can alter the APR inflation using a parameter change proposal. Parameter change proposals that change the APR will take effect in the block after they pass. \ No newline at end of file diff --git a/x/kavadist/spec/02_state.md b/x/kavadist/spec/02_state.md index cf34c8d6..abc3a0e6 100644 --- a/x/kavadist/spec/02_state.md +++ b/x/kavadist/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Parameters and Genesis State diff --git a/x/kavadist/spec/03_messages.md b/x/kavadist/spec/03_messages.md index 24f902d9..e72b7783 100644 --- a/x/kavadist/spec/03_messages.md +++ b/x/kavadist/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages There are no messages in the kavadist module. All state transitions are controlled by parameters, which can be updated via parameter change proposals. diff --git a/x/kavadist/spec/04_events.md b/x/kavadist/spec/04_events.md index 37f328ab..c76d8b65 100644 --- a/x/kavadist/spec/04_events.md +++ b/x/kavadist/spec/04_events.md @@ -1,3 +1,7 @@ + + # Events The `x/kavadist` module emits the following events: @@ -6,5 +10,5 @@ The `x/kavadist` module emits the following events: | Type | Attribute Key | Attribute Value | |----------------------|---------------------|-----------------| -| kavadist | kava_dist_inflation | {amount} | +| kavadist | kava_dist_inflation | `{amount}` | | kavadist | kava_dist_status | "inactive" | diff --git a/x/kavadist/spec/05_params.md b/x/kavadist/spec/05_params.md index 050384b7..83c7a858 100644 --- a/x/kavadist/spec/05_params.md +++ b/x/kavadist/spec/05_params.md @@ -1,3 +1,7 @@ + + # Parameters The kavadist module has the following parameters: diff --git a/x/kavadist/spec/06_begin_block.md b/x/kavadist/spec/06_begin_block.md index d19ebe38..db456764 100644 --- a/x/kavadist/spec/06_begin_block.md +++ b/x/kavadist/spec/06_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At the start of each block, the inflationary coins for the ongoing period, if any, are minted. The logic is as follows: diff --git a/x/kavadist/spec/README.md b/x/kavadist/spec/README.md index f846f459..0865d6a0 100644 --- a/x/kavadist/spec/README.md +++ b/x/kavadist/spec/README.md @@ -1,3 +1,10 @@ + + # `kavadist` diff --git a/x/pricefeed/spec/01_concepts.md b/x/pricefeed/spec/01_concepts.md index 76627d8d..aa3db8b5 100644 --- a/x/pricefeed/spec/01_concepts.md +++ b/x/pricefeed/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts Prices can be posted by any account which is added as an oracle. Oracles are specific to each market and can be updated via param change proposals. When an oracle posts a price, they submit a message to the blockchain that contains the current price for that market and a time when that price should be considered expired. If an oracle posts a new price, that price becomes the current price for that oracle, regardless of the previous price's expiry. A group of prices posted by a set of oracles for a particular market are referred to as 'raw prices' and the current median price of all valid oracle prices is referred to as the 'current price'. Each block, the current price for each market is determined by calculating the median of the raw prices. diff --git a/x/pricefeed/spec/02_state.md b/x/pricefeed/spec/02_state.md index 5ff2e5a8..048c0dc7 100644 --- a/x/pricefeed/spec/02_state.md +++ b/x/pricefeed/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Parameters and genesis state diff --git a/x/pricefeed/spec/03_messages.md b/x/pricefeed/spec/03_messages.md index 8ddb5f07..fb26c47e 100644 --- a/x/pricefeed/spec/03_messages.md +++ b/x/pricefeed/spec/03_messages.md @@ -1,3 +1,7 @@ + + # Messages ## Posting Prices diff --git a/x/pricefeed/spec/04_events.md b/x/pricefeed/spec/04_events.md index d114dcec..7bf4865a 100644 --- a/x/pricefeed/spec/04_events.md +++ b/x/pricefeed/spec/04_events.md @@ -1,22 +1,26 @@ + + # Events The `x/pricefeed` module emits the following events: ## MsgPostPrice -| Type | Attribute Key | Attribute Value | -|----------------------|---------------|------------------| -| oracle_updated_price | market_id | {market ID} | -| oracle_updated_price | oracle | {oracle} | -| oracle_updated_price | market_price | {price} | -| oracle_updated_price | expiry | {expiry} | -| message | module | pricefeed | -| message | sender | {sender address} | +| Type | Attribute Key | Attribute Value | +|----------------------|---------------|--------------------| +| oracle_updated_price | market_id | `{market ID}` | +| oracle_updated_price | oracle | `{oracle}` | +| oracle_updated_price | market_price | `{price}` | +| oracle_updated_price | expiry | `{expiry}` | +| message | module | pricefeed | +| message | sender | `{sender address}` | ## BeginBlock -| Type | Attribute Key | Attribute Value | -|----------------------|-----------------|-----------------| -| market_price_updated | market_id | {market ID} | -| market_price_updated | market_price | {price} | -| no_valid_prices | market_id | {market ID} | +| Type | Attribute Key | Attribute Value | +|----------------------|-----------------|------------------| +| market_price_updated | market_id | `{market ID}` | +| market_price_updated | market_price | `{price}` | +| no_valid_prices | market_id | `{market ID}` | diff --git a/x/pricefeed/spec/05_params.md b/x/pricefeed/spec/05_params.md index 1dc18f41..5eebda62 100644 --- a/x/pricefeed/spec/05_params.md +++ b/x/pricefeed/spec/05_params.md @@ -1,3 +1,7 @@ + + # Parameters The pricefeed module has the following parameters: diff --git a/x/pricefeed/spec/06_end_block.md b/x/pricefeed/spec/06_end_block.md index 4907cced..87f47e9f 100644 --- a/x/pricefeed/spec/06_end_block.md +++ b/x/pricefeed/spec/06_end_block.md @@ -1,3 +1,7 @@ + + # End Block At the end of each block, the current price is calculated as the median of all raw prices for each market. The logic is as follows: diff --git a/x/pricefeed/spec/README.md b/x/pricefeed/spec/README.md index 32d88e86..7004f81d 100644 --- a/x/pricefeed/spec/README.md +++ b/x/pricefeed/spec/README.md @@ -1,3 +1,10 @@ + + # `pricefeed` diff --git a/x/validator-vesting/spec/01_concepts.md b/x/validator-vesting/spec/01_concepts.md index d2402318..191d8dec 100644 --- a/x/validator-vesting/spec/01_concepts.md +++ b/x/validator-vesting/spec/01_concepts.md @@ -1,3 +1,7 @@ + + # Concepts The validator-vesting module is responsible for managing Validator Vesting Accounts, a vesting account for which the release of coins is tied to the validation of the blockchain. Validator Vesting Accounts implement the cosmos-sdk vesting account spec, which can be found [here](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth/spec). diff --git a/x/validator-vesting/spec/02_state.md b/x/validator-vesting/spec/02_state.md index b849296d..1580970d 100644 --- a/x/validator-vesting/spec/02_state.md +++ b/x/validator-vesting/spec/02_state.md @@ -1,3 +1,7 @@ + + # State ## Validator Vesting Account type diff --git a/x/validator-vesting/spec/03_begin_block.md b/x/validator-vesting/spec/03_begin_block.md index ffb1a1b8..6d496b6b 100644 --- a/x/validator-vesting/spec/03_begin_block.md +++ b/x/validator-vesting/spec/03_begin_block.md @@ -1,3 +1,7 @@ + + # Begin Block At each `BeginBlock`, all validator vesting accounts are iterated over to update the status of the current vesting period. Note that the address of each account is retrieved by iterating over the keys in the `validator-vesting` store, while the account objects are stored and accessed using the `auth` module's `AccountKeeper`. For each account, the block count is incremented, the missed sign count is incremented if the validator did not sign the block or was not found in the validator set. By comparing the blocktime of the current `BeginBlock`, with the value of `previousBlockTime` stored in the `validator-vesting` store, it is determined if the end of the current period has been reached. If the current period has ended, the `VestingPeriodProgress` field is updated to reflect if the coins for the ending period successfully vested or not. After updates are made regarding the status of the current vesting period, any outstanding debt on the account is attempted to be collected. If there is enough `SpendableBalance` on the account to cover the debt, coins are sent to the `ReturnAdress` or burned. If there is not enough `SpendableBalance` to cover the debt, all delegations of the account are `Unbonded`. Once those unbonding events reach maturity, the coins freed from the unbonding will be used to cover the debt. Finally, the time of the previous block is stored in the validator vesting account keeper, which is used to determine when a period has ended. diff --git a/x/validator-vesting/spec/README.md b/x/validator-vesting/spec/README.md index 186b18ae..708880ba 100644 --- a/x/validator-vesting/spec/README.md +++ b/x/validator-vesting/spec/README.md @@ -1,3 +1,10 @@ + + # `validator-vesting`