KuChain
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Kratos Validator Handbook - Kratos [source code](https://github.com/KuChainNetwork/Kratos) - Release version number v0.5.3 [Release Kratos v0.5.3-RC Release](https://github.com/KuChainNetwork/Kratos/releases/tag/v0.5.3) - Block explorer: [KuChain Explorer](https://explorer.kuchain.network/) - Recommended hardware configuration: - Linux Ubuntu 18.04 lts - 4 cores 16G memory - CPU frequency 3.1 or higher - Bandwidth 5M - 500GB hard drive ## Deployment Script Follow this script to build a Kratos synchronization node quickly. ## Operation Steps 1. Install related tools, download kratos source code to local and compile it. 2. Download the genesis file, update the configuration, then start up the node. 3. Generate a wallet and create a user name on the chain (user name must conform to the format: 12 characters). 4. Transfer money to the user name and register as a validator. 5. Stake for your node (validator account). ## 1. Install related tools, download kratos source code to local and compile it ``` #!/usr/bin/env bash # Install related tools sudo apt-get update sudo apt-get upgrade -y sudo apt-get install git -y sudo apt-get install build-essential -y sudo apt-get install curl -y curl -O https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz sudo tar -xvf go1.14.4.linux-amd64.tar.gz -C /opt/ rm go1.14.4.linux-amd64.tar.gz # Configure `$PATH` environment variable sudo mkdir /opt/gopath sudo chmod 0777 /opt/gopath echo "export GOROOT=/opt/go" >> ~/.profile echo "export GOPATH=/opt/gopath" >> ~/.profile echo "export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin" >> ~/.profile source ~/.profile # Download kratos source code from Github to local git clone https://github.com/KuChainNetwork/kratos.git # Locate to the kratos folder cd kratos git pull # Switch to the current kratos release branch git checkout v0.5.3 # Compile source code make all -e CORE_SYMBOL=kts -e MAIN_SYMBOL=kratos ``` ## 2. Download the genesis file, update the configuration, then start up the node ``` # Initialize the node information - moniker is the node name kucd init --chain-id=kratos <moniker> # Download the genesis file and overwrite the default genesis configuration curl -O https://gist.githubusercontent.com/cain42/962c3f265cc258bc4f39aa594b517f1f/raw/a62c539f4ced3c70cef58b5d3afae37afb766935/genesis.json mv genesis.json ~/.kucd/config/ # Update the seed configuration information in config file sed -i "s/seeds = \"\"/seeds = \"3192fada5783c4094c5f1e34998d22c28ae17b3c@54.250.252.137:26656,035ec954c47f0b40c02491fc9abd4ce398bfec70@39.99.233.130:26656,31fc3d7e406c4869af4d008746a2f72180e92c7b@39.99.154.141:26656,0f4d7149fbe35d7114630a17d545d584915ec856@147.139.31.48:26656,5434d9687037f732720cb3e607c8ab4eab192ae4@47.254.66.202:26656,72861902a218d37407891e2aaff75ce79ed8d1bd@47.252.75.40:26656\"/g" "${HOME}/.kucd/config/config.toml" #Start up your node kucd start # or start with nohup nohup kucd start & ``` You could check the node record by the log file after the node started. ``` tail -f ./log/node.log ``` > Note: The script will initialize the node's private key at ~/.kucd/config/priv_validator_key.json, please backup your private key. ### Validator Handbook ##### Note for validators Kratos restructured the asset and account modules, and the dividend receiving module has also been restructured accordingly. The validator node needs to understand some basic operating commands to complete the regular operations such as account registration, node mortgage, dividend receiving, and asset confirmation. ##### Account and Address In Kratos, the account is the basic unit of authority management, and its ownership is confirmed through Auth. Once you generate the private key, you will get a unique address. At this time, to become a validator, you need to register a username(an account which is parallel to the address accounting) on the blockchain. That is to say, the account information of the username is isolated from the balance of the Auth-bound address. If there are 10 KTSt under the address kratosxxx, the account name accountnamexxxx bound to this address(kratosxxx) doesn't own the 10 KTSt. Similarly, as the payee, the assets received by the account accountnamexxxx will not exist under kratosxxx, but will under the account book. ##### The format of username - 12 bits - The letters a-z (only lower case) - Numbers 0-9 - Support symbols `@` and `.`, `@` is the account separator so it can only appear one time In `Kratos`, `@` is regarded as the account separator. The account name with `@` can be separated into the first identification name and the following organization name. If the organization name is the account with the chain master symbol, it is reserved for the system which is used as a system mechanism. Accounts including system accounts or root accounts cannot actively create system accounts. ## 3. Generate a wallet and create a user name on the chain ``` # localkey is a locally managed private key alias, remember to back up your address and mnemonic after running kucli keys add localkey --chain-id Kratos --keyring-backend test # Create the username <address of localkey> localkey address / testvalidaor is the username / The second <address of localkey> is the address bound by Auth kucli tx account create <address of localkey> testvalidaor <address of localkey> --fee-payer <address of localkey> --from localkey --chain-id kratos --keyring-backend test ``` ## 4. Transfer money to the user name and register as a validator #### Transfer money to the validator account ``` # <address of localkey> is the address of localkey,testvalidaor is the account name,the second <address of localkey>is the address bound by Auth ./kucli tx asset transfer <address of localkey> testvalidaor 1000000000Kratos/kts --fee-payer <address of localkey> --from localkey --chain-id Kratos --keyring-backend test ``` #### Query account ``` # Query account information kucli query account get testvalidaor # Query the account which is bound to Auth kucli query account auth <address of localkey> # Query the account balance, the user name here can also be replaced with the address, but the account information you got is different kucli query asset coins testvalidaor ``` > The account authority (Auth) points to an address, multiple accounts can have the same address authority, but these accounts are logically unrelated and the assets are independent. #### Register as a validator In Kratos network, if you want to be a validator, firstly you need a node to synchronize the block information. This node can also provide the public key which could verify whether the signature of a certain block belongs to the node. Secondly, you need to have an account registered on Kratos as the operator of the node. Then there are two conventional parameters you need to have: moniker and commission-rate, moniker is the name of the node, commission-rate is the commission ratio. You could modify the two parameters after creating the node. ``` kucli tx kustaking create-validator testvalidaor\ --pubkey=$(./kucd tendermint show-validator) \ --moniker="secode test" \ --from=localkey \ # Alias of local wallet --commission-rate="0.10" # 10% --chain-id Kratos --keyring-backend test ``` - pubkey is the public key of the node, which could be obtained by the command: `./kucd tendermint show-validator` - testvalidaor is the on-chain account we registered before - moniker is the name of the node which cannot exceed 70 characters - commission-rate is the commission ratio which should be between 0 to 1 - from is the parameter used by kucli to call the wallet to sign, here we use the private key of the localkey in the wallet to sign - The default parameter is fee-payer, here the localkey account is used for payment by default ##### Query validator ``` kucli query kustaking validator testvalidaor { "operator_account": "testvalidaor", "consensus_pubkey": "Kratosvalconspubxxxxxx", "status": 1, "tokens": "0", "delegator_shares": "0.000000000000000000", "description": { "moniker": "secode test" }, "unbonding_time": "1970-01-01T00:00:00Z", "commission": { "commission_rates": { "rate": "0.100000000000000000", "max_rate": "1.000000000000000000", "max_change_rate": "1.000000000000000000" }, "update_time": "2020-09-15T03:23:07.823072717Z" }, "min_self_delegation": "1" } ``` The meaning of the `status` field is as follows: - 1 represents the unbonding state which refers to the state of a candidate node. Generally, when the mortgage on a node is not enough to make it a validator, the node will be in the unbonding state. - 2 represents the unbonded state. The bonded state of a validator will be set to the unbonded when it is punished by the chain for some reason. - 3 represents the bonded state, which is the state of the validator In addition to the `status` field, another important status field for validator is`Jailed`. This is a bool type field, true means being punished, false means not being punished. - The validator being punished will not become a valid validator regardless of the amount of mortgage - Validators not being punished can run for valid validators based on their mortgage amount ## 5. Stake for your node (validator account). ``` kucli tx kustaking delegate delegator testvalidaor 98760540321Kratos/kts --from localkey ``` - delegator is the user name mortgaged on the chain - testvalidaor is the account of the validator - amount is the mortgage amount. The value here needs to be accompanied by precision information. The precision in Kratos is 18 digits. ** 1 token on Kratos is 100000000000000000kratos/kts** - -from is used to determine which local private key will be used to sign ##### Redeem mortgage ``` kucli tx kustaking unbond delegator testvalidaor 100Kratos/kts --from localkey ``` - delegator is the name of the on-chain validator - testvalidaor is the operation account of validators - amount is the amount which need to be redeemed. If it is greater than the amount of the mortgage, txmsg will report an error - -from is used to determine which local private key will be used to sign ##### The punishment of validators Kratos will punish validators when the following situations occur: - When the validator is double-signed. - When the validator misses more than 50 blocks in 100 consecutive blocks. ##### The punishment situation - When a validator is double-signed, Kratos will set the validator's `Jailed` status to true, then remove it from the valid validator queue, and deduct 5% of the total mortgage amount on the validator. The validator can set the status of `Jailed` to False through the `unjail` operation after 14 days, then continue to compete for valid validators. - When the validator misses more than 50 blocks in 100 consecutive blocks, Kratos will set the validator's `Jailed` status to true, kick it from the valid validator queue, and deduct 0.01% of the total mortgage amount of the validator. The validator can set the `Jailed` status to False through the `unjail` operation after 10 minutes, then continue to compete for valid validators. The block generation and punishment situation of a validator can be queried through the kuslashing module ``` kucli query kuslashing signing-info [validator-conspub] [flags] { "address": "Kratosvalconsxxxxx", "start_height": "7192", "index_offset": "2", "jailed_until": "2020-09-15T08:32:16.653850079Z", "missed_blocks_counter": "2" } ``` - validator-conspub is the public key of the validator - flags is a common parameter Here is the query result after the testvalidaor missing more than 50 blocks. The `jailed_until` parameter above is a time node which shows the time that nodes can be removed from punishment through the unjail operation. The following are the relevant parameters of the unjail command. ##### Restore penalized node ``` kucli tx kuslashing unjail testvalidaor --from localkey --keyring-backend test --chain-id Kratos ``` - testvalidaor refers to the account of the penalized validator's operator - -from is used to determine which local private key will be used to sign ##### Receive Node Revenue [Kratos Incentive System](https://hackmd.io/@KuChain/distribution) ##### Coinpower In order to support programmable assets, Kratos defines Coinpower, which can be converted into assets, but assets cannot be actively converted into Coinpower. When users have Coinpower, they can obtain coins through `exercise` confirmation: Firstly confirm the Coinpower: ``` ./build/kucli query asset coinpowers validator1 - denom: kratos/kts amount: "8123569779369697717424050" ``` Claim Coinpower ``` ./kucli tx asset exercise testvalidator Kratos/kts --from localkey --chain-id Kratos --keyring-backend test --fee-payer testvalidator ``` Now users can obtain coins.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully