diff --git a/.github/workflows/markdown-ci/markdown-config.yml b/.github/linters/.markdown-lint.yml similarity index 96% rename from .github/workflows/markdown-ci/markdown-config.yml rename to .github/linters/.markdown-lint.yml index a579d9027..21a6823cf 100644 --- a/.github/workflows/markdown-ci/markdown-config.yml +++ b/.github/linters/.markdown-lint.yml @@ -4,11 +4,11 @@ default: false # includes/excludes all rules by default MD001: true # Heading style -MD003: true +MD003: style: 'consistent' # Unordered list style -MD004: true +MD004: style: 'consistent' # Inconsistent indentation for list items at the same level @@ -30,7 +30,7 @@ MD010: false MD011: true # Multiple consecutive blank lines -MD012: true +MD012: maximum: 2 # Line length @@ -58,7 +58,7 @@ MD022: true MD023: true # Multiple headings with the same content -MD024: true +MD024: allow_different_nesting: true # Multiple top level headings in the same document @@ -74,7 +74,7 @@ MD027: true MD028: false # Ordered list item prefix -MD029: true +MD029: style: 'one_or_ordered' # Spaces after list markers @@ -87,7 +87,7 @@ MD031: true MD032: true # Inline HTML -MD033: true +MD033: allowed_elements: ['a'] # Bare URL used @@ -137,9 +137,3 @@ MD047: true # Code fence style MD048: style: 'consistent' - -# Custom rules: -# CHANGELOG-RULE-001: false -# CHANGELOG-RULE-002: false -# CHANGELOG-RULE-003: false -# CHANGELOG-RULE-004: false diff --git a/.github/workflows/markdown-ci/mlc_config.json b/.github/linters/mlc_config.json similarity index 100% rename from .github/workflows/markdown-ci/mlc_config.json rename to .github/linters/mlc_config.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..616e89f8c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,60 @@ +name: Lint + +on: [push] + +jobs: + + # We can't use VALIDATE_GO from super linter because of this issue: + # https://github.com/github/super-linter/issues/143 + go-lint: + name: Lint go + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.43.0 + args: --timeout 5m0s + + md-link-check: + name: Check markdown links + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check if Markdown links are valid + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + config-file: '.github/linters/mlc_config.json' + folder-path: "." + + super-lint: + name: Run super linter + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Super-Linter + uses: github/super-linter/slim@v4 + env: + VALIDATE_MARKDOWN: true + VALIDATE_XML: true + VALIDATE_YAML: true + VALIDATE_OPENAPI: true + # VALIDATE_BASH: true + # VALIDATE_BASH_EXEC: true + # VALIDATE_DOCKERFILE_HADOLINT: true + # VALIDATE_ENV: true + # VALIDATE_GITHUB_ACTIONS: true + # VALIDATE_PROTOBUF: true + # VALIDATE_SHELL_SHFMT: true + + VALIDATE_ALL_CODEBASE: true + LOG_LEVEL: WARN + + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/markdown-ci.yml b/.github/workflows/markdown-ci.yml deleted file mode 100644 index 7978d99af..000000000 --- a/.github/workflows/markdown-ci.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Markdown quality control - -on: - push: - paths: - - '**.md' - - '**.markdown' - - '**.mdown' - - '**.mdwn' - - '**.mdx' - - '**.mkd' - - '**.mkdn' - - '**.mkdown' - - '**.ronn' - - '**.scd' - - '**.workbook' - -jobs: - check_links: - name: Markdown - Link Check - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Check if Markdown links are valid - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - config-file: '.github/workflows/markdown-ci/mlc_config.json' - folder-path: "." - - lint-check: - name: Markdown - Linting Check - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Check if Markdown is formatted correctly - uses: avto-dev/markdown-lint@v1 - with: - config: '.github/workflows/markdown-ci/markdown-config.yml' - args: '.' - fix: true diff --git a/.github/workflows/markdown-ci/markdown-rules.js b/.github/workflows/markdown-ci/markdown-rules.js deleted file mode 100644 index a201f2b72..000000000 --- a/.github/workflows/markdown-ci/markdown-rules.js +++ /dev/null @@ -1,116 +0,0 @@ - -"use strict"; - -module.exports = [{ - names: ["CHANGELOG-RULE-001"], - description: "Version header format", - tags: ["headings", "headers", "changelog"], - function: (params, onError) => { - params.tokens.filter(function filterToken(token) { - return token.type === "heading_open"; - }).forEach(function forToken(token) { - if (token.tag === "h2") { - // eg.: `## v1.0.0` - if (/^## [vV]?\d+\.\d+\.\d+(-[0-9A-Za-z-.]+|)$/m.test(token.line)) { - return; - } - - // eg.: `## [v1.0.0]` - if (/^## \[[vV]?\d+\.\d+\.\d+(-[0-9A-Za-z-.]+|)]$/m.test(token.line)) { - return; - } - - // eg.: `## v1.0.0 – 2020-01-01`, `## v1.0.0 - 2020-01-01` - if (/^## [vV]?\d+\.\d+\.\d+(-[0-9A-Za-z-.]+|) [-–] 20[12][0-9]-[01][0-9]-[0-3][0-9]$/m.test(token.line)) { - return; - } - - // eg.: `## [v1.0.0] – 2020-01-01`, `## [v1.0.0] - 2020-01-01` - if (/^## \[[vV]?\d+\.\d+\.\d+(-[0-9A-Za-z-.]+|)] [-–] 20[12][0-9]-[01][0-9]-[0-3][0-9]$/m.test(token.line)) { - return; - } - - // eg.: `## unreleased`, `## Unreleased`, `## UNRELEASED` - if (/^## unreleased$/mi.test(token.line)) { - return; - } - - // eg.: `## [unreleased]`, `## [Unreleased]`, `## [UNRELEASED]` - if (/^## \[unreleased]$/mi.test(token.line)) { - return; - } - - return onError({ - lineNumber: token.lineNumber, - detail: "Allowed formats: 'vX.X.X(-pre.release)', '[vX.X.X(-pre.release)]', 'vX.X.X(-pre.release) - YYYY-MM-DD', '[vX.X.X(-pre.release)] – YYYY-MM-DD', '[UNRELEASED]', or 'UNRELEASED'", - context: token.line - }); - } - }); - } -}, { - names: ["CHANGELOG-RULE-002"], - description: "Type of changes format", - tags: ["headings", "headers", "changelog"], - function: (params, onError) => { - params.tokens.filter(function filterToken(token) { - return token.type === "heading_open"; - }).forEach(function forToken(token) { - if (token.tag === "h3") { - if (/^### (Added|Changed|Deprecated|Removed|Fixed|Security)$/m.test(token.line)) { - return; - } - - return onError({ - lineNumber: token.lineNumber, - detail: "Allowed types is: Added, Changed, Deprecated, Removed, Fixed or Security", - context: token.line - }); - } - }); - } -}, { - names: ["CHANGELOG-RULE-003"], - description: "Lists items without punctuation at the end", - tags: ["lists", "changelog"], - function: (params, onError) => { - params.tokens.filter(function filterToken(token) { - return token.type === "list_item_open"; - }).forEach(function forToken(token) { - if (token.tag === "li") { - if (/[;,\.]$/m.test(token.line)) { - return onError({ - lineNumber: token.lineNumber, - detail: "'.', ';' or ',' at the end of list entry", - context: token.line - }); - } - } - }); - } -}, { - names: ["CHANGELOG-RULE-004"], - description: "Only one 'unreleased' version header allowed", - tags: ["headings", "headers", "changelog"], - function: (params, onError) => { - let headers_count = 0; - - params.tokens.filter(function filterToken(token) { - return token.type === "heading_open"; - }).forEach(function forToken(token) { - if (token.tag === "h2") { - if (/^## unreleased$/mi.test(token.line)) { - headers_count++; - } - - if (headers_count >= 2) { - return onError({ - lineNumber: token.lineNumber, - detail: "Remove duplicated header", - context: token.line - }); - } - } - }); - } -}]; \ No newline at end of file diff --git a/.github/workflows/node-ci.yml b/.github/workflows/test.yml similarity index 97% rename from .github/workflows/node-ci.yml rename to .github/workflows/test.yml index 185df740a..58da4dc50 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: cheqd-node CI +name: Test on: push: @@ -14,22 +14,10 @@ env: VERSION: "1.0.0" # Package build scripts require version to be provided jobs: - lint: - name: Lint - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.43.0 - args: --timeout 5m0s run-unit-test: name: Run unit tests runs-on: ubuntu-20.04 - needs: lint steps: - name: Set up Go 1.17 uses: actions/setup-go@v2 diff --git a/README.md b/README.md index 568a03f32..58747efe9 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ The [**cheqd Community Slack**](http://cheqd.link/join-cheqd-slack) is our chat Please reach out to us there for discussions, help, and feedback on the project. -## Bug Reporting & New Feature Requests +## Bug Reporting & New Feature Requests -If you notice anything not behaving how you expected, or would like to make a suggestion / request for a new feature, please submit a **bug_report** or **feature_request** by creating a [**New Issue**](https://github.com/cheqd/cheqd-node/issues/new/choose) and selecting the relevant template. +If you notice anything not behaving how you expected, or would like to make a suggestion / request for a new feature, please submit a **bug_report** or **feature_request** by creating a [**New Issue**](https://github.com/cheqd/cheqd-node/issues/new/choose) and selecting the relevant template. ### Social media diff --git a/architecture/adr-list/adr-001-payment-mechanism-for-issuing-credentials.md b/architecture/adr-list/adr-001-payment-mechanism-for-issuing-credentials.md index 6899304f0..fe087d350 100644 --- a/architecture/adr-list/adr-001-payment-mechanism-for-issuing-credentials.md +++ b/architecture/adr-list/adr-001-payment-mechanism-for-issuing-credentials.md @@ -83,7 +83,7 @@ The payment flow can be broken down into five steps: * **`denom`**: Defined in `details.total.amount.currency` from the Payment Request 2. **Build a transaction with the request from the previous step** Example: `cheqd_ledger::auth::build_tx(pool_alias, pub_key, builded_request, account_number, account_sequence, max_gas, max_coin_amount, denom, timeout_height, memo)` * `memo`: This should be the same as `details.id` from the Payment Request -3. **Sign the transaction** Example:`cheqd_keys::sign(wallet_handle, key_alias, tx)`. +3. **Sign the transaction** Example:`cheqd_keys::sign(wallet_handle, key_alias, tx)`. 4. **Broadcast the signed transaction** Example: `cheqd_pool::broadcast_tx_commit(pool_alias, signed)`. #### Response format @@ -197,7 +197,7 @@ Holder -> Issuer: Accept ## References -* [Hyperledger Aries RFC 0036: Issue Credential Protocol 1.0 ](https://github.com/hyperledger/aries-rfcs/blob/main/features/0036-issue-credential/README.md) +* [Hyperledger Aries RFC 0036: Issue Credential Protocol 1.0](https://github.com/hyperledger/aries-rfcs/blob/main/features/0036-issue-credential/README.md) * [Hyperledger Aries RFC 0075: Payment Decorators](https://github.com/hyperledger/aries-rfcs/blob/main/features/0075-payment-decorators/README.md) * [Evernym VDR Tools cheqd network payments ADR](https://gitlab.com/evernym/verity/vdr-tools/-/tree/cheqd/docs/design/014-bank-transactions) diff --git a/architecture/adr-list/adr-003-cli-tools.md b/architecture/adr-list/adr-003-cli-tools.md index eea396ca8..4efd88612 100644 --- a/architecture/adr-list/adr-003-cli-tools.md +++ b/architecture/adr-list/adr-003-cli-tools.md @@ -13,7 +13,7 @@ Due to the nature of the cheqd project merging concepts from the [Cosmos blockchain framework](https://github.com/cosmos/cosmos-sdk) and self-sovereign identity \(SSI\), there are two potential options for creating Command Line Interface \(CLI\) tools for developers to use: -1. **Cosmos-based CLI:** Most likely route for Cosmos projects for their node application. Most existing Cosmos node validators will be familiar with this method of managing their node. +1. **Cosmos-based CLI:** Most likely route for Cosmos projects for their node application. Most existing Cosmos node validators will be familiar with this method of managing their node. 2. **VDR CLI**: Traditionally, a lot of SSI networks have used [Hyperledger Indy](https://github.com/hyperledger/indy-node) and therefore the Indy CLI tool for managing and interacting with the ledger. This has now been renamed to [Verifiable Data Registry \(VDR\) Tools CLI](https://gitlab.com/evernym/verity/vdr-tools) and is the tool that most existing SSI node operators \("stewards"\) would be familiar with. Ideally, the `cheqd-node` project would provide a consistent set of CLI tools rather than two separate tools with varying feature sets between them. @@ -41,7 +41,7 @@ This ADR will focus on the CLI tool architecture choice for `cheqd-node`. ### Options considered -#### 1. Keep both Cosmos CLI and VDR Tools CLI, but use them for different purposes. +#### 1. Keep both Cosmos CLI and VDR Tools CLI, but use them for different purposes **Pros:** diff --git a/architecture/adr-list/adr-005-genesis-parameters.md b/architecture/adr-list/adr-005-genesis-parameters.md index a2fa633da..c1bb901f6 100644 --- a/architecture/adr-list/adr-005-genesis-parameters.md +++ b/architecture/adr-list/adr-005-genesis-parameters.md @@ -125,16 +125,16 @@ Cosmos application is divided [into a list of modules](https://docs.cosmos.netwo * Amount of unbound/redelegate entries to store * `bond_denom` = `ncheq` * Denomination used in staking -* **`ibc`** - * `max_expected_time_per_block` = `30000000000` (expressed in nanoseconds, ~ 30 seconds) - * Maximum expected time per block, used to enforce block delay. This parameter should reflect the largest amount of time that the chain might reasonably take to produce the next block under normal operating conditions. A safe choice is 3-5x the expected time per block. - * `allowed_clients` = `[ "06-solomachine", "07-tendermint" ]` - * Defines the list of allowed client state types. We allow connections from other chains using the [Tendermint client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/07-tendermint), and with light clients using the [Solo Machine client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/06-solomachine). - * **`ibc-transfer`** - * `send_enabled` = `true` - * Enables or disables all cross-chain token transfers from this chain - * `receive_enabled` = `true` - * Enables or disables all cross-chain token transfers to this chain +* **`ibc`** + * `max_expected_time_per_block` = `30000000000` (expressed in nanoseconds, ~ 30 seconds) + * Maximum expected time per block, used to enforce block delay. This parameter should reflect the largest amount of time that the chain might reasonably take to produce the next block under normal operating conditions. A safe choice is 3-5x the expected time per block. + * `allowed_clients` = `[ "06-solomachine", "07-tendermint" ]` + * Defines the list of allowed client state types. We allow connections from other chains using the [Tendermint client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/07-tendermint), and with light clients using the [Solo Machine client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/06-solomachine). +* **`ibc-transfer`** + * `send_enabled` = `true` + * Enables or disables all cross-chain token transfers from this chain + * `receive_enabled` = `true` + * Enables or disables all cross-chain token transfers to this chain ## Decision diff --git a/architecture/adr-list/adr-008-identity-resources.md b/architecture/adr-list/adr-008-identity-resources.md index 06d3457b0..6bccd306e 100644 --- a/architecture/adr-list/adr-008-identity-resources.md +++ b/architecture/adr-list/adr-008-identity-resources.md @@ -74,7 +74,7 @@ Schema URL: `did:cheqd:mainnet-1:N22KY2Dyvmuu2PyyqSFKue` Schema Entity URL: `did:cheqd:mainnet-1:N22KY2Dyvmuu2PyyqSFKue?service=CL-Schema` -[TODO: add language about resolving the DID (and getting the DID Doc) vs +[TODO: add language about resolving the DID (and getting the DID Doc) vs dereferencing the DID (and getting the schema)] `SCHEMA` DID Document transaction format: @@ -103,7 +103,7 @@ dereferencing the DID (and getting the schema)] #### Credential Definition -[TODO: explain that a Cred Def is simply an additional property inside of +[TODO: explain that a Cred Def is simply an additional property inside of the Issuer's DID Doc] Adds a Credential Definition (in particular, public key), which is created by an @@ -156,6 +156,7 @@ CredDef URL: `did:cheqd:mainnet-1:N22KY2Dyvmuu2PyyqSFKue` CredDef Entity URL: `did:cheqd:mainnet-1:N22KY2Dyvmuu2PyyqSFKue?service=CL-CredDef` `CRED_DEF` DID Document transaction format: + ```jsonc { "id": "did:cheqd:mainnet-1:N22KY2Dyvmuu2PyyqSFKue", @@ -294,9 +295,9 @@ CredDef URL: `did:cheqd:mainnet-1:N22KY2Dyvmuu2PyyqSFKue#` ###### Negative -- Credential Definition name means that it contains more than just a key and `value` field +- Credential Definition name means that it contains more than just a key and `value` field provides this flexibility. -- Adding all Cred Defs to Issuer's DIDDoc makes it too large. For every DIDDoc or Cred Def request +- Adding all Cred Defs to Issuer's DIDDoc makes it too large. For every DIDDoc or Cred Def request a client will receive the whole list of Issuer's Cred Defs. - Impossible to put a few controllers for Cred Def. - In theory, we need to make Credential Definitions mutable. diff --git a/architecture/adr-list/adr-template.md b/architecture/adr-list/adr-template.md index 432c06db1..568e338ad 100644 --- a/architecture/adr-list/adr-template.md +++ b/architecture/adr-list/adr-template.md @@ -53,4 +53,4 @@ What is the change that we're proposing and/or doing? ## Unresolved questions -{list of questions or action items} \ No newline at end of file +{list of questions or action items} diff --git a/docs/build-and-networks/build-and-networks.md b/docs/build-and-networks/build-and-networks.md index cc386c3cd..ee191162c 100644 --- a/docs/build-and-networks/build-and-networks.md +++ b/docs/build-and-networks/build-and-networks.md @@ -4,6 +4,8 @@ This document describes in details how to configure a genesis network with any amount of participants. +### Requirements + #### Hardware requirements Minimal: diff --git a/docs/build-and-networks/docker-compose.md b/docs/build-and-networks/docker-compose.md index 7fed27eaa..eedffddcf 100644 --- a/docs/build-and-networks/docker-compose.md +++ b/docs/build-and-networks/docker-compose.md @@ -13,21 +13,21 @@ The set of scripts to generate configurations for a network of four nodes and ru 1. Build docker image: - See [the instruction](local-docker-network.md). + See [the instruction](local-docker-network.md). 2. Build cheqd-node: -```bash -starport chain build -``` + ```bash + starport chain build + ``` 3. Generate node configurations: - Run: `gen_node_configs.sh`. + Run: `gen_node_configs.sh`. 4. Run docker-compose: - Run: `run_docker.sh`. + Run: `run_docker.sh`. ## Result diff --git a/docs/identity-api/README.md b/docs/identity-api/README.md index 63e7653da..2a27873e4 100644 --- a/docs/identity-api/README.md +++ b/docs/identity-api/README.md @@ -11,7 +11,7 @@ Details on how identity transactions are defined is available in [ADR 002: Ident 1. **Build a request** _Example_: `build_create_did_request(id, verkey, alias)` 2. **Sign the request using DID key** _Example_: `indy_crypto_sign(did, verkey)` 3. **Build a transaction with the request from previous step** _Example_: `build_tx(pool_alias, pub_key, builded_request, account_number, account_sequence, max_gas, max_coin_amount, denom, timeout_height, memo)` -4. **Sign the transaction** _Example_: `cheqd_keys_sign(wallet_handle, key_alias, tx)`. +4. **Sign the transaction** _Example_: `cheqd_keys_sign(wallet_handle, key_alias, tx)`. 5. **Broadcast a signed transaction** _Example_: `broadcast_tx_commit(pool_alias, signed)`. #### Response format @@ -325,7 +325,7 @@ CreateSchemaResponse { #### Response validation * A SCHEMA transaction with DID from `owner` field must already be in a ledger created by `CreateDidRequest` -* `CreateSchemaRequest` must be signed by DID from `owner` field. +* `CreateSchemaRequest` must be signed by DID from `owner` field. ### Get Schema @@ -352,7 +352,7 @@ Request * `path`: Path for RPC Endpoint for cheqd pool * `data`: Query with an entity key from a state. String `schema:::` encoded to bytes * `height`: Ledger height \(size\). `None` for auto calculation; -* `prove`: Boolean value. `True` for getting state proof in a pool response. +* `prove`: Boolean value. `True` for getting state proof in a pool response. #### Response format @@ -413,7 +413,7 @@ CreateCredDefResponse { #### Response validation * A CRED\_DEF transaction with DID from `owner` field must already be in a ledger created by `CreateDidRequest` -* `CreateCredDefRequest` must be signed by DID from `owner` field. +* `CreateCredDefRequest` must be signed by DID from `owner` field. ### Get Credential Definition diff --git a/docs/identity-api/identity-api-error-messages.md b/docs/identity-api/identity-api-error-messages.md index 067f4a5ee..1bef87e91 100644 --- a/docs/identity-api/identity-api-error-messages.md +++ b/docs/identity-api/identity-api-error-messages.md @@ -2,7 +2,7 @@ ## Overview -| Name | Code | Description | +| Name | Code | Description | |---|---|---| | ErrBadRequest | 1000 | The request the client made is incorrect or corrupt | | ErrBadRequestIsRequired | 1001 | The request does not contain required property | @@ -14,7 +14,7 @@ | ErrDidDocExists | 1200 | An attempt to create a DID Doc that exists in the ledger detected | | ErrDidDocNotFound | 1201 | The DID Doc not found in the ledger | | ErrVerificationMethodNotFound | 1202 | The DID Doc does not contain the requested verification method | -| ErrUnexpectedDidVersion | 1203 | Replay protected failed. An attempt to update DID Doc with wrong version detected | +| ErrUnexpectedDidVersion | 1203 | Replay protected failed. An attempt to update DID Doc with wrong version detected | | ErrInvalidPublicKey | 1204 | Unable to decode public key | | ErrInvalidDidStateValue | 1300 | Unable to unmarshall stored document | | ErrSetToState | 1304 | Unable to set value into the ledger | diff --git a/docs/identity-api/swagger.yaml b/docs/identity-api/swagger.yaml index a46e3828f..b116757c6 100644 --- a/docs/identity-api/swagger.yaml +++ b/docs/identity-api/swagger.yaml @@ -22,7 +22,7 @@ paths: required: true type: string responses: - 200: + "200": description: DID Document schema: $ref: '#/definitions/StateValue' @@ -47,7 +47,7 @@ paths: schema: $ref: '#/definitions/MsgCreateDid' responses: - 201: + "201": description: DID created schema: $ref: '#/definitions/MsgCreateDidResponse' @@ -94,7 +94,7 @@ paths: schema: $ref: '#/definitions/MsgUpdateDid' responses: - 201: + "201": description: DID Document updated schema: $ref: '#/definitions/MsgUpdateDidResponse' diff --git a/docs/setup-and-configure/configure-new-validator.md b/docs/setup-and-configure/configure-new-validator.md index bca0164e9..46f208771 100644 --- a/docs/setup-and-configure/configure-new-validator.md +++ b/docs/setup-and-configure/configure-new-validator.md @@ -108,7 +108,7 @@ If you need help or support, join our [**cheqd Community Slack**](http://cheqd.l * **`commission-rate`**: Validator's commission rate * **`commission-max-rate`**: Validator's maximum commission rate, expressed as a number with up to two decimal points. The value for this cannot be changed later. * **`commission-max-change-rate`**: Maximum rate of change of a validator's commission rate per day, expressed as a number with up to two decimal points. The value for this cannot be changed later. - * **`chain-id`**: Unique identifier for the chain. + * **`chain-id`**: Unique identifier for the chain. * For cheqd's current mainnet, this is `cheqd-mainnet-1` * For cheqd's current testnet, this is `cheqd-testnet-2` * **`gas`**: Maximum gas to use for *this specific* transaction. Using `auto` uses Cosmos's auto-calculation mechanism, but can also be specified manually as an integer value. @@ -155,15 +155,17 @@ To import the key first plug in the device and enter the device pin. Once you ha To add the key use the following command: -``` +```bash cheqd-noded keys add --ledger ``` + Note The `--ledger` flag tells the command line tool to talk to the ledger device and the `--index` flag selects which HD index should be used. When running this command, the Ledger device will prompt you to verify the genereated address. Once you have done this you will get an output in the following form: -``` + +```bash $ cheqd-noded keys add test --ledger - name: test type: ledger diff --git a/docs/setup-and-configure/debian/deb-package-install.md b/docs/setup-and-configure/debian/deb-package-install.md index b4d6ce6a2..a3123ee8b 100644 --- a/docs/setup-and-configure/debian/deb-package-install.md +++ b/docs/setup-and-configure/debian/deb-package-install.md @@ -121,7 +121,7 @@ This document provides guidance on how to install and configure a node for the c cheqd-noded configure create-empty-blocks false ``` -9. **Define the external peer-to-peer address** +9. **Define the external peer-to-peer address** Unless you are running a node in a sentry/validator two-tier architecture, your node should be reachable on its peer-to-peer (P2P) port by other other nodes. This can be defined by setting the `external-address` property which defines the externally reachable address. This can be defined using either IP address or DNS name followed by the P2P port (Default: 26656). @@ -133,30 +133,30 @@ This document provides guidance on how to install and configure a node for the c This is especially important if the node has no public IP address, e.g., if it's in a private subnet with traffic routed via a load balancer or proxy. Without the `external-address` property, the node will report a private IP address from its own host network interface as its `remote_ip`, which will be unreachable from the outside world. The node still works in this configuration, but only with limited unidirectional connectivity. -11. **Make the RPC endpoint available externally** \(optional\) +10. **Make the RPC endpoint available externally** \(optional\) - This step is necessary only if you want to allow incoming client application connections to your node. Otherwise, the node will be accessible only locally. Further details about the RPC endpoints is available in the [cheqd node setup guide](../README.md). + This step is necessary only if you want to allow incoming client application connections to your node. Otherwise, the node will be accessible only locally. Further details about the RPC endpoints is available in the [cheqd node setup guide](../README.md). - ```bash - cheqd-noded configure rpc-laddr "tcp:\/\/0.0.0.0:26657" - ``` + ```bash + cheqd-noded configure rpc-laddr "tcp:\/\/0.0.0.0:26657" + ``` -12. **Enable and start the `cheqd-noded` system service** +11. **Enable and start the `cheqd-noded` system service** - If you are prompted for a password for the `cheqd` user, type `exit` to logout and then attempt to execute this as a privileged user \(with `sudo` privileges or as root user, if necessary\). + If you are prompted for a password for the `cheqd` user, type `exit` to logout and then attempt to execute this as a privileged user \(with `sudo` privileges or as root user, if necessary\). - ```bash - $ systemctl enable cheqd-noded - Created symlink /etc/systemd/system/multi-user.target.wants/cheqd-noded.service → /lib/systemd/system/cheqd-noded.service. + ```bash + $ systemctl enable cheqd-noded + Created symlink /etc/systemd/system/multi-user.target.wants/cheqd-noded.service → /lib/systemd/system/cheqd-noded.service. - $ systemctl start cheqd-noded - ``` + $ systemctl start cheqd-noded + ``` - Check that the `cheqd-noded` service is running. If successfully started, the status output should return `Active: active (running)` + Check that the `cheqd-noded` service is running. If successfully started, the status output should return `Active: active (running)` - ```bash - systemctl status cheqd-noded - ``` + ```bash + systemctl status cheqd-noded + ``` ## Post-installation checks diff --git a/docs/setup-and-configure/debian/deb-package-upgrade.md b/docs/setup-and-configure/debian/deb-package-upgrade.md index af3474fa9..845d541c9 100644 --- a/docs/setup-and-configure/debian/deb-package-upgrade.md +++ b/docs/setup-and-configure/debian/deb-package-upgrade.md @@ -83,39 +83,53 @@ An alternative method to check a node's status is via the RPC interface, if it h * Remotely via the RPC interface: `cheqd-noded status --node ` * By opening the JSONRPC over HTTP status page through a web browser: `/status` -## Upgrade from `0.2.3` to `0.3.1`. +## Upgrade from `0.2.3` to `0.3.1` + According to debian package usage on AWS instances and recovering after crashes we introduced new storage and mount points approach. For now, `$HOME` directory excepts to be `/home/cheqd` by default or it can be changed while `.deb` package install, like: + ```bash sudo CHEQD_HOME_DIR=/path/to/home/directory dpkg -i cheqd-node_0.3.1_amd64.deb ``` + In general, it's not required and up to system administrators how to ensure safe revocring after crashes. If you have `0.2.3` version installed and you want to follow the new `$HOME` directory approach the next steps can help with it: + * Please define the mount point for `cheqd` root directory where all the configs and data will be placed. For example, let it be `/cheqd`. * Stop `cheqd-noded` service by running: -```bash -$ sudo systemctl stop cheqd-noded -``` + + ```bash + sudo systemctl stop cheqd-noded + ``` + * Install `.deb` package for `0.3.1` version: -```bash -sudo CHEQD_HOME_DIR=/cheqd dpkg -i cheqd-node_0.3.1_amd64.deb -``` + + ```bash + sudo CHEQD_HOME_DIR=/cheqd dpkg -i cheqd-node_0.3.1_amd64.deb + ``` + * After that the next directory tree is expected: -```bash -/cheqd/.cheqdnode/data -/cheqd/.cheqdnode/config -/cheqd/.cheqdnode/log -``` + + ```bash + /cheqd/.cheqdnode/data + /cheqd/.cheqdnode/config + /cheqd/.cheqdnode/log + ``` + * After that you should move all the configs from previous location into the new one `/cheqd/.cheqdnode/config`, data into `/cheqd/.cheqdnode/data`. It's assumed that root directory `/cheqd` will be stored and mounted as external resource and will not be removed after potential instance crashing. * For logs symlink can be created by using command: -```bash -ln -s /cheqd/.cheqdnode/log /var/log/cheqd-node -``` + + ```bash + ln -s /cheqd/.cheqdnode/log /var/log/cheqd-node + ``` + * Start `cheqd-noded` service by running: -```bash -$ sudo systemctl start cheqd-noded -``` + + ```bash + sudo systemctl start cheqd-noded + ``` + and check the service status or just check RPC endpoint. ## Next steps diff --git a/docs/setup-and-configure/upgrade/README.md b/docs/setup-and-configure/upgrade/README.md index 787734653..918a8bd31 100644 --- a/docs/setup-and-configure/upgrade/README.md +++ b/docs/setup-and-configure/upgrade/README.md @@ -29,6 +29,7 @@ cheqd-noded tx gov submit-proposal software-upgrade upgrade_to_0.3 --title "Upgr ``` The main parameters here are: + - `upgrade_to_0.3` - name of proposal which will be used in `UpgradeHandler` in the new application, - `--upgrade-height` - height when upgrade process will be occurred, - `--from` - alias of a key which will be used for signing proposal, @@ -55,10 +56,13 @@ Expected result for this state is `PROPOSAL_STATUS_DEPOSIT_PERIOD`, It means, th Since getting proposal, the `DEPOSIT` should be set to the pool.It will be return after finishing voting_preiod. For setting deposit the next command is used: -``` + +```bash cheqd-noded tx gov deposit 10000000ncheq --from --chain-id ``` + Parameters: + - `` - proposal identifier from [step](#Command for sending proposal) In this example, amount of deposit is equal to current `min-deposit` value. diff --git a/tests/networks/docker_compose.md b/tests/networks/docker_compose.md index 5ae60b7b3..104b8f627 100644 --- a/tests/networks/docker_compose.md +++ b/tests/networks/docker_compose.md @@ -6,7 +6,7 @@ The set of scripts to generate configurations for a network of four nodes and ru ## Prerequisites -* [Starport](https://docs.starport.network/guide/install.html) +* [Starport](https://docs.starport.network/guide/install.html) * docker-compose ## How to run @@ -61,7 +61,6 @@ Also, there will be 4 keys generated and corresponding genesis accounts created When connecting using CLI, point path to home directory: `--home node_configs/client`. -## CLI commands: +## CLI commands See [the reference](../../docs/cheqd-cli/README.md) to learn about the most common CLI flows. - diff --git a/tests/networks/local_node.md b/tests/networks/local_node.md index edbda2687..254d4995f 100644 --- a/tests/networks/local_node.md +++ b/tests/networks/local_node.md @@ -8,7 +8,7 @@ The script to generate configuration for a network of one node and run it locall ## Prerequisites -* [Starport](https://docs.starport.network/guide/install.html) +* [Starport](https://docs.starport.network/guide/install.html) ## How to run @@ -22,7 +22,7 @@ The script to generate configuration for a network of one node and run it locall Run: `gen_node_config.sh`. -4. Run single node network: +3. Run single node network: Run: `cheqd-noded start`. @@ -43,6 +43,6 @@ Also, there will be 1 key generated and corresponding genesis accounts created f * node_operator; -## CLI commands: +## CLI commands See [the reference](https://github.com/cheqd/cheqd-node/blob/main/docs/cheqd-cli/README.md) to learn about the most common CLI flows.