Go Client
CLI tool for interacting with LumiWave chain over gRPC
The Go client is a CLI tool that interacts with the LumiWave chain over gRPC. It provides wallet management, balance queries, transaction sending, and chain status monitoring — all from the command line. This is useful for testing, automation, and building backend services that need direct chain interaction without relying on REST API.
Run From Project Root
All commands are executed from the project root (lumiwave-protocol). The Go client is located in the examples/go-client/ directory.
go run ./examples/go-client <command> <subcommand> [flags]The default gRPC endpoint is localhost:9090. Most commands support overriding it with --grpc-endpoint.
Command Groups
The Go client is organized into 4 command groups, each handling a specific area of chain interaction.
| Group | Description |
|---|---|
wallet | Create new wallets, restore from mnemonic, and validate mnemonic format |
balance | Query all token balances or specific denomination balances for an address |
tx | Send tokens, query/search transactions, simulate gas costs, and broadcast signed transactions |
chain | Query node sync status, fetch blocks, look up accounts, view module parameters, and watch new blocks in real-time |
Quick Start
Below are the most common operations to get started. Each command connects to the local gRPC endpoint (localhost:9090) by default.
1. Create a Wallet
Generate a new wallet with a BIP-39 mnemonic phrase. The mnemonic is the only way to recover the wallet, so store it securely.
go run ./examples/go-client wallet create2. Query All Balances
Query all token balances (LWP, Token Factory tokens, IBC tokens) held by an address.
go run ./examples/go-client balance all --address lumi1...3. Send Tokens (with Mnemonic)
Send tokens using a mnemonic phrase for signing. The transaction is built, signed, and broadcast in a single step. Amount is specified in the base denomination (ulwp).
go run ./examples/go-client tx send \
--from-mnemonic "<MNEMONIC>" \
--to-address lumi1... \
--amount 1000 \
--denom ulwp4. Send Tokens (with Private Key)
Alternative method using a hex-encoded private key instead of a mnemonic. Useful for automated scripts where the private key is stored in environment variables.
go run ./examples/go-client tx send-privkey \
--from-private-key-hex <HEX> \
--to-address lumi1... \
--amount 1000 \
--denom ulwp5. Get Transaction by Hash
Look up a transaction's execution result, gas usage, and event logs by its hash.
go run ./examples/go-client tx get --hash ABCDEF...6. Watch Latest Blocks
Continuously poll and display new blocks as they are produced. Useful for monitoring chain activity in real-time. The --interval flag controls the polling frequency.
go run ./examples/go-client chain watch --interval 2s7. Query Chain Status
Check the node's sync status, latest block height, and network information. This is the first command to run to verify your node connection is working.
go run ./examples/go-client chain statusSubcommands
Detailed reference for each command group and their subcommands.
wallet
Wallet management commands for creating and restoring wallets. All wallets use the BIP-44 derivation path standard (m/44'/118'/0'/0/0) compatible with Cosmos SDK chains.
| Subcommand | Description |
|---|---|
create | Create a new mnemonic-based wallet (generates 24-word mnemonic) |
from-mnemonic | Restore a wallet from an existing mnemonic (derives address and keys) |
validate | Validate mnemonic format (checks word count and checksum) |
go run ./examples/go-client wallet from-mnemonic --mnemonic "<MNEMONIC>"
go run ./examples/go-client wallet validate --mnemonic "<MNEMONIC>"balance
Query token balances for any address on the chain. Supports both querying all denominations at once and filtering by a specific denom (e.g., ulwp or Token Factory tokens).
| Subcommand | Description |
|---|---|
all | Query all balances for an address (LWP, Token Factory, IBC tokens) |
denom | Query balance for a specific denomination only |
go run ./examples/go-client balance denom --address lumi1... --denom ulwptx
Transaction commands for sending tokens, querying past transactions, and advanced operations like simulation and manual broadcasting. The simulate command is useful for estimating gas costs before sending.
| Subcommand | Description |
|---|---|
send | Send tokens using mnemonic (builds, signs, and broadcasts in one step) |
send-privkey | Send tokens using hex-encoded private key |
get | Query a single transaction by hash (returns result, gas, events) |
search | Search transactions by event query (e.g., by sender address) |
simulate | Simulate base64-encoded tx bytes to estimate gas without executing |
broadcast | Broadcast pre-signed base64-encoded tx bytes to the network |
go run ./examples/go-client tx search --sender lumi1...
go run ./examples/go-client tx broadcast --tx-bytes-base64 "<BASE64_TX_BYTES>" --mode syncchain
Chain-level queries for monitoring node status, fetching block data, and inspecting on-chain accounts and module parameters.
| Subcommand | Description |
|---|---|
status | Query node sync status, latest block height, and network info |
block | Query a specific block by height or fetch the latest block |
watch | Continuously poll and print newly detected blocks (real-time monitoring) |
account | Query account details including sequence number and account type |
module-params | Query lumiwaveprotocol module parameters (chain-specific config) |
go run ./examples/go-client chain block --height 123
go run ./examples/go-client chain account --address lumi1...
go run ./examples/go-client chain module-paramsTests
Run the test suite to verify the Go client works correctly with your environment. Tests cover wallet creation, balance queries, and transaction building.
go test ./examples/go-client/...