Cronos POS Chain Docs
  • Getting Started
    • 📑Cronos POS Chain Introduction
    • 🔰Architecture
  • For USERS
    • 🌟New brand and domains
    • 💰Wallets
      • chain-maind
      • Ledger Hardware Wallets with chain-maind
      • Crypto.com DeFi Desktop Wallet
      • Conducting IBC Transfer with Keplr Wallet
      • Using Ledger Device with Keplr Wallet
      • Mainnet Address Generation
      • Mainnet Address Verification
      • Multisig Account
      • Delegation Guide
      • Key Principles for Wallet Security
    • 🛠️Token Migration Web Tool
    • 🚰Croeseid Testnet Faucet
  • For Node Hosts
    • ⛓️Running Nodes
      • Public Node Sync
      • Quicksync
      • Cronos POS Chain Mainnet: Running a Full Node
        • Upgrade Guide
          • The "V5" upgrade guide (v4.* to v5.0.1) :
          • The "V4" upgrade guide (v3.* to v4.2.2) :
          • The "DRACO II" upgrade guide (v2.* to v3.3.2) :
          • The "Canis Major" upgrade guide (v1.* to v2.0.1) at block height 922,363:
          • Running "Canis Major" network upgrade with cosmovisor
      • Cronos POS Chain Mainnet: Running a Validator
      • Cronos POS Chain Mainnet Validator Security Checklist
      • Croeseid Testnet: Running Nodes
      • Mainnet/Testnet: Running Nodes using AWS 1-click Deployment
      • Mainnet/Testnet: Running Nodes using Azure 1-click Deployment
      • Croeseid Testnet: Running Nodes With Nix
      • Devnet: Running Latest Development Node
    • 🔄Advanced TMKMS Integration
    • 💫Notes on Performance
    • 🔃Notes on Production Deployment
  • Block Explorers
    • 📊Cronos POS Chain Mainnet Explorer
    • 📊Croeseid Testnet Explorer
  • Cronos PoS Chain Protocol
    • ⛓️Chain Details
      • Genesis
      • Protocol Documentation
      • Chain ID, Address Format and Signatures
      • Create the IBC-enabled tokens on the Cronos POS Chain with Solo Machine
      • List of parameters
      • Proposal Process
      • Technical glossary
    • 🎛️Modules
      • module_supply
      • module_slashing
      • module_authz
      • module_bank
      • module_mint
      • module_gov
      • module_staking
      • module_distribution
      • module_nft
  • Cronos PoS Integration
    • 🔄Integration documentation
    • 🛂Node Setup and RPC node
    • 🔲Blocks and Transactions
Powered by GitBook
On this page
  • Node minimum setup
  • Enable API and gRPC server
  • Start the node
  • Access RPC server
  • Tendermint (Local access only)
  • gRPC
  • Tricks on creating a validator on testnet
  1. Cronos PoS Integration

Node Setup and RPC node

Node minimum setup

Here we will be using a local chain-maind folder as the home directory. By default chain data are stored in your home directory ~/.chain-maind. For example, when joining the testnet testnet-croeseid-4:

./chain-maind init mynode --chain-id testnet-croeseid-4 --home ./chain-maind

sed -i.bak -E 's#^(persistent_peers[[:space:]]+=[[:space:]]+).*$#\1"b2a4c8db43b815e1ed83ab4723a6af84ccb8e3e4@13.213.110.242:26656,c76d7d28141daf037bec919268d0f38e64fd8389@3.1.240.30:26656"#' ~/.chain-maind/config/config.toml
sed -i.bak -E 's#^(create_empty_blocks_interval[[:space:]]+=[[:space:]]+).*$#\1"5s"#' ~/.chain-maind/config/config.toml
sed -i.bak -E 's#^(timeout_commit[[:space:]]+=[[:space:]]+).*$#\1"2s"#' ~/.chain-maind/config/config.toml  

Enable API and gRPC server

Edit ./chain-main/config/app.toml and update the following section

[api]

# Enable defines if the API server should be enabled.
enable = true

# Swagger defines if swagger documentation should automatically be registered.
swagger = true

# Address defines the API server to listen on.
address = "tcp://0.0.0.0:1317"

...

[grpc]

# Enable defines if the gRPC server should be enabled.
enable = true

# Address defines the gRPC server address to bind to.
address = "0.0.0.0:9090"

Start the node

Afterward, you should be able to start you node by running

./chain-maind start --home ./chain-maind/

where the blockchain data, keys will be stored at the folder <current_path>/chain-maind/

Access RPC server

Tendermint (Local access only)

You can access Tendermint Swagger UI here: https://docs.tendermint.com/master/rpc/#/

Switch the servers to localhost in the dropdown and you can interact with the Swagger UI.

gRPC

There are a few clients our team has used before

BloomRPC

  • https://github.com/uw-labs/bloomrpc

  • GUI client for GRPC services

grpcurl

  • https://github.com/fullstorydev/grpcurl

  • Like curl, but for gRPC

  • Install grpcurl (Mac)

    brew install grpcurl

    for other OSs please refer to GitHub

  • Query gRPC API

    grpcurl -plaintext localhost:9090 list
    
    cd grpc/proto
    grpcurl -proto ./cosmos/staking/v1beta1/query.proto -plaintext localhost:9090 cosmos.staking.v1beta1.Query.Validators

    The reason we have to go to the grpc/proto directory is that gRPC will look for proto files dependency, and they expect that to be under the path you are currently at. To avoid this limitation, we can specify the proto import path.

    grpcurl -import-path ./grpc/proto -proto ./grpc/proto/cosmos/staking/v1beta1/query.proto -plaintext localhost:9090 cosmos.staking.v1beta1.Query.Validators
  • More query examples

    grpcurl -d ' {"validator_addr": "tcrocncl1l74wnswzx4zsmv674tl99h3h3fgj3al2tdzne7"}' -import-path ./grpc/proto -proto ./grpc/proto/cosmos/staking/v1beta1/query.proto -plaintext localhost:9090 cosmos.staking.v1beta1.Query.Validator

Tricks on creating a validator on testnet

  1. Make sure your node is fully synced before you join as a validator.

  2. Gas price error

    Sometimes the create-valiator may fail because of the gas. You can use the following command instead (notice we have provided --gas and --gas-price)

    $ ./chain-maind tx staking create-validator \
    --from=[name_of_your_key] \
    --amount=500000tcro \
    --pubkey='{"@type":"/cosmos.crypto.ed25519.PubKey","key":"PUBLIC_KEY"}'  \
    --moniker="[The_id_of_your_node]" \
    --security-contact="[security contact email/contact method]" \
    --chain-id="testnet-croeseid-4" \
    --commission-rate="0.10" \
    --commission-max-rate="0.20" \
    --commission-max-change-rate="0.01" \
    --min-self-delegation="1" \
    --gas="auto" \
    --gas-price="0.1basetcro"
PreviousIntegration documentationNextBlocks and Transactions

Last updated 5 months ago

🛂