LumiWave Protocol

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.

GroupDescription
walletCreate new wallets, restore from mnemonic, and validate mnemonic format
balanceQuery all token balances or specific denomination balances for an address
txSend tokens, query/search transactions, simulate gas costs, and broadcast signed transactions
chainQuery 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 create

2. 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 ulwp

4. 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 ulwp

5. 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 2s

7. 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 status

Subcommands

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.

SubcommandDescription
createCreate a new mnemonic-based wallet (generates 24-word mnemonic)
from-mnemonicRestore a wallet from an existing mnemonic (derives address and keys)
validateValidate 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).

SubcommandDescription
allQuery all balances for an address (LWP, Token Factory, IBC tokens)
denomQuery balance for a specific denomination only
go run ./examples/go-client balance denom --address lumi1... --denom ulwp

tx

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.

SubcommandDescription
sendSend tokens using mnemonic (builds, signs, and broadcasts in one step)
send-privkeySend tokens using hex-encoded private key
getQuery a single transaction by hash (returns result, gas, events)
searchSearch transactions by event query (e.g., by sender address)
simulateSimulate base64-encoded tx bytes to estimate gas without executing
broadcastBroadcast 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 sync

chain

Chain-level queries for monitoring node status, fetching block data, and inspecting on-chain accounts and module parameters.

SubcommandDescription
statusQuery node sync status, latest block height, and network info
blockQuery a specific block by height or fetch the latest block
watchContinuously poll and print newly detected blocks (real-time monitoring)
accountQuery account details including sequence number and account type
module-paramsQuery 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-params

Tests

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/...

On this page