# Commands

This section describes the commands available from osmosisd, the command line interface that connects a running osmosisd process.

# add-genesis-account

Adds a genesis account to genesis.json.

Syntax

osmosisd add-genesis-account <address-or-key-name> '<amount><coin-denominator>,<amount><coin-denominator>'
1

Example

osmosisd add-genesis-account acc1 '200000000uOsmo,550000ukrw'
1

# collect-gentxs

Collects genesis transactions and outputs them to genesis.json.

Syntax

osmosisd collect-gentxs
1

# debug

Helps debug the application. For a list of syntax and subcommands, see the debug subcommands.

# export

Exports the state to JSON.

Syntax

osmosisd export
1

# gentx

Adds a genesis transaction to genesis.json.

Syntax

osmosisd gentx <key-name> <amount><coin-denominator>
1

Example

osmosisd gentx myKey 1000000uOsmo --home=/path/to/home/dir --keyring-backend=os --chain-id=test-chain-1 \
    --moniker="myValidator" \
    --commission-max-change-rate=0.01 \
    --commission-max-rate=1.0 \
    --commission-rate=0.07 \
    --details="..." \
    --security-contact="..." \
    --website="..."
1
2
3
4
5
6
7
8

# help

Shows help information.

Syntax

osmosisd help
1

# init

Initializes the configuration files for a validator and a node.

Syntax

osmosisd init <moniker>
1

Example

osmosisd init myNode
1

# keys

Manages Keyring commands. For a list of syntax and subcommands, see the keys subcommands.

# migrate

Migrates the source genesis into the target version and prints to STDOUT.

Syntax

osmosisd migrate <path-to-genesis-file>
1

Example

osmosisd migrate /genesis.json --chain-id=testnet --genesis-time=2020-04-19T17:00:00Z --initial-height=4000
1

# query

Manages queries. For a list of syntax and subcommands, see the query subcommands.

# rosetta

Creates a Rosetta server.

Syntax

osmosisd rosetta
1

# start

Runs the full node application with Tendermint in or out of process. By default, the application runs with Tendermint in process.

Syntax

osmosisd start
1

# status

Displays the status of a remote node.

Syntax

osmosisd status
1

# tendermint

Manages the Tendermint protocol. For a list of subcommands, see

# testnet

Creates a testnet with the specified number of directories and populates each directory with the necessary files.

Syntax

osmosisd testnet
1

Example

osmosisd testnet --v 6 --output-dir ./output --starting-ip-address 192.168.10.2
1

# tx

Retrieves a transaction by its hash, account sequence, or signature. For a list of full syntax and subcommands, see the tx subcommands.

Syntax to query by hash

osmosisd query tx <hash>
1

Syntax to query by account sequence

osmosisd query tx --type=acc_seq <address>:<sequence>
1

Syntax to query by signature

osmosisd query tx --type=signature <sig1_base64,sig2_base64...>
1

# txs

Retrieves transactions that match the specified events where results are paginated.

Syntax

osmosisd query txs --events '<event>' --page <page-number> --limit <number-of-results>
1

Example

osmosisd query txs --events 'message.sender=cosmos1...&message.action=withdraw_delegator_reward' --page 1 --limit 30
1

# unsafe-reset-all

Resets the blockchain database, removes address book files, and resets data/priv_validator_state.json to the genesis state.

Syntax

osmosisd unsafe-reset-all
1

# validate-genesis

Validates the genesis file at the default location or at the location specified.

Syntax

osmosisd validate-genesis </path-to-file>
1

Example

osmosisd validate-genesis </genesis.json>
1

# version

Returns the version of Osmosis you're running.

Syntax

osmosisd version
1