XION
DiscordGithub
  • Welcome to XION
  • XION'S Core
    • Concepts
      • Generalized Chain Abstraction
      • Intro to Account Abstraction
      • XION's Meta Accounts
      • Meta Accounts Design
      • Architecture & Tech Glossary
      • Use Cases
  • developers
    • Xion Quick Start
      • Zero to Dapp in 5 Minutes
        • Launch a User Map Dapp on XION in 5 Minutes
        • React Native Mobile Dapp on XION in 5 Minutes
    • Mobile dapp Development on XION
      • Set up your XION Mobile Development Environment
      • Create Mobile Dapp and Integrate Meta Account Authentication
    • Getting Started (Advanced)
      • Set Up Local Environment
        • Setting up your Local Smart Contract Development Environment for XION
          • Setting up your XION Smart Contract Development Environment on Windows (WSL2 + Ubuntu)
        • Set Up an Integrated Development Environment (IDE)
        • Interacting with Xion Chain using Xion Daemon
      • Your First Contract
        • Deploying Your First Smart Contract on XION
      • Gasless UX & Permission Grants
        • Enabling Gasless Transactions with Treasury Contracts
      • Dapp Development
        • Account Abstraction with Gasless Transactions
        • Interact with XION via your Backend Service
    • Re-using Existing Contracts
      • Deployed Contracts on XION
      • Non-Fungible Tokens (NFTs)
      • Fungible Tokens
      • Marketplace
      • Multisig
      • Proxy Contracts
      • Membership Management
    • Web3 for Web2 Developers
      • Web2 vs Web3 App Architecture: A Comparison
      • Misconceptions and Misapplied Web2 Patterns
      • Recommended Architecture for Dapps on XION
    • Building for Mainnet
      • Xion Testnet: Your Development Playground
      • Building with Audited & Battle-Tested Contracts
      • Community Engagement: Building Support for Your dApp
      • Deploying to Xion Mainnet
        • Smart Contract Audits: Process, Costs & Support
        • Governance Process to Deploying Smart Contracts to Mainnet
    • Learn & Build
      • Token Factory
        • Creating, Minting, and Interacting with a Token Factory Token
        • Building a React dApp to Interact with Token Factory Tokens
        • Integrating a Token Factory Token in a Smart Contract
      • Websockets
        • WebSockets with Xion: Real-Time Communication
      • Mobile Development
        • Building a React Native Mobile App with Abstraxion (Xion.js)
      • Oracles
        • Creating a Smart Contract with Pyth Oracle Integration
      • Indexers: Optimized Data Retrieval
        • SubQuery
      • Use Cases
        • Building a Per-User Data Storage Dapp
    • Reference and Resources
      • Requesting XION Testnet Tokens
      • Public Endpoints & Resources
      • Block Explorers
      • Governance
        • Deploying Smart Contracts to Mainnet
      • Developer Tools: Abstract
      • IBC Denoms on XION Networks
      • Frequently Asked Questions
      • XION Token Contract Addresses on EVM Chains
  • Nodes & Validators
    • Run a Node
      • System Specifications
      • Build the Xion Daemon
      • Download the Xion Daemon
      • Configure the Xion Daemon
        • app.toml
        • client.toml
        • config.toml
      • Join the XION Network
        • xion-testnet-1
      • Confirm node is running
    • Become a Validator
      • Initial Setup
      • Obtain a XION Wallet Address
      • Obtain Funds
        • Testnet
      • Create Validator
    • IBC Relayers and Tokens
  • Others
    • Resources
Powered by GitBook
On this page
  • Prerequisites
  • Generate an account
  • Generate an Account Key Pair
  • Fund Your Account
  • Connecting to Different Xion Chain Instances
  • Finding Chain IDs and Public Nodes
  • Executing Transactions
  • Executing Queries

Was this helpful?

Edit on GitHub
  1. developers
  2. Getting Started (Advanced)
  3. Set Up Local Environment

Interacting with Xion Chain using Xion Daemon

PreviousSet Up an Integrated Development Environment (IDE)NextYour First Contract

Last updated 1 month ago

Was this helpful?

xiond is the command-line interface (CLI) daemon for interacting with the Xion blockchain. It allows users to manage accounts, send transactions, query blockchain data, and operate validator nodes.

Prerequisites

Before proceeding with this guide, ensure that xiond is installed on your system. Follow the installation steps outlined in the guide.

To verify your installation, run:

xiond

If installed correctly, you should see the following output:

xion daemon (server)

Usage:
  xiond [command]

Available Commands:
  comet                 CometBFT subcommands
  completion            Generate the autocompletion script for the specified shell
  config                Utilities for managing application configuration
  debug                 Tool for helping with debugging your application
  export                Export state to JSON
  genesis               Application's genesis-related subcommands
  help                  Help about any command
  init                  Initialize private validator, p2p, genesis, and application configuration files
  keys                  Manage your application's keys
  module-hash-by-height Get module hashes at a given height
  prune                 Prune app history states by keeping the recent heights and deleting old heights
  query                 Querying subcommands
  rollback              rollback Cosmos SDK and CometBFT state by one height
  rosetta               spin up a rosetta server
  snapshots             Manage local snapshots
  start                 Run the full node
  status                Query remote node for status
  tx                    Transactions subcommands
  version               Print the application binary version information

Flags:
  -h, --help                help for xiond
      --home string         directory for config and data (default "/Users/adrianthompson/.xiond")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info")
      --log_no_color        Disable colored logs
      --trace               print out full stack trace on errors

Use "xiond [command] --help" for more information about a command.

This output displays the available commands within xiond. Each command may include additional subcommands. To get more details about a specific command, use the --help flag.

Generate an account

To execute transactions on-chain, you need at least one funded account. This section will guide you through the process of creating and funding an account using xiond.

Generate an Account Key Pair

To interact with the XION blockchain, you need a cryptographic key pair, consisting of a public key and a private key. The public key is used to derive your address, while the private key is required to sign transactions.

Generate a New Key Pair

Use the following command to create a new key pair and add it to your local key store:

xiond keys add <keyname>

Replace <keyname> with a name of your choice for easy reference.

Retrieve Public Key

If you have already generated a key pair and need to retrieve its public key, use the following command:

xiond keys show <keyname>

Replace <keyname> with the name of your key to display its public key.

Fund Your Account

Your account is not fully registered on-chain until it is involved in a transaction. The easiest way to achieve this is by funding your account, which allows it to interact with the network.

Request Testnet Tokens

You can obtain testnet tokens through one of the following methods:

  • Discord Faucet: Request tokens by using the faucet bot in the XION Discord.

Mainnet Tokens

If you’re deploying contracts on XION Mainnet, you can acquire XION tokens through various decentralized and centralized exchanges.

Connecting to Different Xion Chain Instances

By default, xiond uses a local network node for executing transactions and queries. However, if you need to connect to a different chain, such as a public testnet or mainnet, you must specify the appropriate chain ID and node URL.

Finding Chain IDs and Public Nodes

Executing Transactions

To interact with a different Xion blockchain for sending transactions, you need to explicitly set:

  • The chain ID using the --chain-id flag

  • The node URL using the --node flag

Example: Sending tokens to an account

xiond tx bank send <your-wallet> <recipient-address> <amount>uxion \
  --chain-id <target-chain-id> \
  --node <node-url> \
  --from <your-wallet> \
  --gas-prices 0.025uxion \
  --gas auto \
  --gas-adjustment 1.3 \
  -y
  • Replace <target-chain-id> with the appropriate chain ID.

  • Replace <node-url> with the RPC endpoint of the target chain.

Possible Output

gas estimate: 70320
code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: ""
timestamp: ""
tx: null
txhash: 20511E66575DCECF23EBFF7D848DA75DA88A474CD17089C5225C1D04C9561A57

Executing Queries

For queries, you only need to set the --node flag, as queries do not require the --chain-id parameter.

Example: Querying Account Balance

xiond query bank balances <wallet-address> --node <node-url>

Possible Output

balances:
- amount: "1223782"
  denom: uxion
pagination:
  total: "1"

Faucet Web Page: Visit the and follow the instructions to receive testnet tokens.

For more details on accessing testnet tokens, see our .

You can find the chain IDs for all Xion chains, along with available public RPC nodes, in the section of the documentation.

Installation Prerequisites
XION Faucet
Faucet Page
Public Endpoints and Resources