Interacting with Xion Chain using Xion Daemon
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 Installation Prerequisites guide.
To verify your installation, run:
If installed correctly, you should see the following output:
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:
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:
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.
Faucet Web Page: Visit the XION Faucet and follow the instructions to receive testnet tokens.
For more details on accessing testnet tokens, see our Faucet Page.
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
You can find the chain IDs for all Xion chains, along with available public RPC nodes, in the Public Endpoints and Resources section of the documentation.
Executing Transactions
To interact with a different Xion blockchain for sending transactions, you need to explicitly set:
The chain ID using the
--chain-id
flagThe node URL using the
--node
flag
Example: Sending tokens to an account
Replace
<target-chain-id>
with the appropriate chain ID.Replace
<node-url>
with the RPC endpoint of the target chain.
Possible Output
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
Possible Output
Last updated
Was this helpful?