LogoLogo
WebDiscordTelegramBlog
  • Source Protocol
    • Introduction
    • Vision
    • Business Solutions
    • DeFi-as-a-Service
    • Ecosystem Overview
    • JOIN SOURCE
  • SOURCE - $SOURCE
    • Tokenomics
    • Features Part 1
    • Features Part 2
    • Why Guardian Nodes?
    • Source Swap
    • Airdrop
    • Claim Source-Drop
    • How to IBC Transfer
    • Community
  • SourceSwap - On Chain DEX
    • Connect and Deposit
    • Swap
    • Manage Liquidity
  • Governance
    • Before Submitting a Proposal
    • Submitting a Proposal (CLI)
  • COMMAND-LINE INTERFACE (CLI)
    • Introduction
    • Useful CLI Commands
  • SMART CONTRACTS & SOURCED DEVELOPMENT
    • Sourced Local Dev Setup
    • Source Chain Testnet Setup
      • Testnet Links
    • Smart Contracts with COSMWASM
    • CW-20/ERC-20 Tutorial
      • Installation
      • Download, Compile, Store
      • Initialize the Contract
      • Query and run commands
    • CW1 Tutorial
      • Installation
      • Download, Compile, Store
      • Initialize the Contract
      • Query commands
      • Execute commands
  • Nodes & Validators
    • Mainnet: Sourced Installation and Setup
    • Setting up Cosmovisor
    • Mainnet Setup and Tooling
    • Joining Mainnet
    • Mainnet Upgrades
    • Mainnet Resources
    • Block, Height & State-Sync Source with KSYNC
  • PLANQ | SOURCE Bridge
    • Bridging SRCX from BNB Chain to SOURCE Chain
  • SOURCE MARKET DOCUMENTATION
    • Source Market
    • Introduction
    • sTokens
    • Unitroller
    • USX Controller
    • Governance
  • BRANDING & RESOURCES
    • Social, Resources & Updates
    • Branding
    • Videos
    • How to: MetaMask
    • How to: Keplr
  • Gaming
    • Moochkin's Metarun
      • Rewards and Tournaments
  • LEGAL
    • Disclaimer
    • Privacy Policy
Powered by GitBook
On this page
  1. COMMAND-LINE INTERFACE (CLI)

Useful CLI Commands

Get standard debug info from the source daemon:

sourced status

Check if your node is catching up:

# Query via the RPC (default port: 26657)
curl http://localhost:26657/status | jq .result.sync_info.catching_up

Get your node ID:

sourced tendermint show-node-id

Your peer address will be the result of this plus host and port, i.e. <id>@<host>:26656 if you are using the default port.

Check if you are jailed or tombstoned:

sourced query slashing signing-info $(sourced tendermint show-validator)

Set the default chain for commands to use:

sourced config chain-id source-1

Get your valoper address:

sourced keys show <your-key-name> -a --bech val

See keys on the current box:

sourced keys list

Import a key from a mnemonic:

sourced keys add <new-key-name> --recover

Export a private key (warning: don't do this unless you know what you're doing!)

sourced keys export <your-key-name> --unsafe --unarmored-hex

Withdraw rewards (including validator commission), where sourcevaloper1... is the validator address:

sourced tx distribution withdraw-rewards <sourcevaloper1...> --from <your-key>  --commission

Stake:

sourced tx staking delegate <sourcevaloper1...> <AMOUNT>usource --from <your-key>

Find out what the JSON for a command would be using --generate-only:

sourced tx bank send $(sourced keys show <your-key-name> -a) <recipient addr> <AMOUNT>usource --generate-only

Add Funds to Community Pool

sourced tx distribution fund-community-pool <AMOUNT>usource --from $(sourced keys show <your-key-name> -a) --chain-id source-1

Delegate to Gov proposal

sourced query gov deposit <proposal-id> <AMOUNT>usource --from <your-key> --chain-id source-1

Vote on Proposal

sourced tx gov vote <proposal-id> <Option,yes/no/etc> --from <your-key> --chain-id source-1

Query the results of a gov vote that has ended, from a remote RPC (NB - you have to specify a height before the vote ended):

 sourced q gov votes 1 --height <height-before-vote-ended> --node https://testnet.sourceprotocol.io:26657/

Query the validator set (and jailed status) via CLI:

sourced query staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, (.tokens|tonumber / pow(10; 6)), .description.moniker, .jail, .status] | @csv' | column -t -s"," | sort -k2 -n -r | nl

Query Staking Delegations

sourced query staking delegations-to <sourcevaloper1...> --chain-id source-1

Unjail Validator

sourced tx slashing unjail --from=source-user --chain-id=source-1

Get contract state:

sourced q wasm contract-state all <contract-address>
PreviousIntroductionNextSourced Local Dev Setup

Last updated 1 year ago