Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
1.7 KiB
1.7 KiB
| sidebar_position | title | slug |
|---|---|---|
| 4 | Chain Command Runner (chaincmd/runner) | /packages/chaincmdrunner |
Chain Command Runner (chaincmd/runner)
The chaincmdrunner package wraps chain binary commands into typed, higher-level operations (accounts, genesis setup, tx queries, node control).
For full API details, see the
chaincmdrunner Go package documentation.
When to use
- Execute chain lifecycle commands without manually assembling CLI arguments.
- Manage accounts and genesis setup from automation/test flows.
- Query transaction events using typed selectors instead of raw command output parsing.
Key APIs
New(ctx context.Context, chainCmd chaincmd.ChainCmd, options ...Option) (Runner, error)(Runner) Init(ctx context.Context, moniker string, args ...string) error(Runner) Start(ctx context.Context, args ...string) error(Runner) AddAccount(ctx context.Context, name, mnemonic, coinType, accountNumber, addressIndex string) (Account, error)(Runner) AddGenesisAccount(ctx context.Context, address, coins string) error(Runner) QueryTxByEvents(ctx context.Context, selectors ...EventSelector) ([]Event, error)(Runner) WaitTx(ctx context.Context, txHash string, retryDelay time.Duration, maxRetry int) error
Common Tasks
- Build a
Runnerfrom a configuredchaincmd.ChainCmdand then callInit/Startfor local node workflows. - Use
AddAccount,ListAccounts, andShowAccountto manage keyring state in scripted flows. - Query and filter tx events with
NewEventSelectorplusQueryTxByEvents.
Basic import
import chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner"