Skip to content

CLI Commands

limsandy edited this page Nov 14, 2022 · 35 revisions

To use the CLI:

cd mmx-node
source ./activate.sh

For Windows: Use the shortcut in the start menu or manually run mmx_cmd.cmd from a terminal/command prompt.

To run any mmx commands (except mmx wallet create), the node needs to be running. See Getting Started to read on how to start it.

Node CLI

To check on the node: mmx node info

To check on the peers: mmx node peers

To check on a transaction: mmx node tx <txid>

To show current node height: mmx node get height

To dump a transaction: mmx node get tx <txid>

To dump a contract: mmx node get contract <address>

To get balance for an address: mmx node get balance <address> <options>

-x <currency>

To get raw balance for an address: mmx node get amount <address> <options>

-x <currency>

To dump a block: mmx node get block <height>

To dump a block header: mmx node get header <height>

To show connected peers: mmx node get peers

To show estimated netspace: mmx node get netspace

To show circulating coin supply: mmx node get supply

To call a smart contract const function: mmx node call

To show smart contract state variables: mmx node read

To dump all storage of a smart contract: mmx node dump

To dump assembly code of a smart contract: mmx node dump_code

To fetch a block from a peer: mmx node fetch block <peer> <height>

To fetch a block header from a peer: mmx node fetch header <peer> <height>

To check the balance of an address: mmx node balance <address>

To check the history of an address since a particlar block height: mmx node history <address> <block_height>

To show all offers: mmx node offers [open | closed]

To force a re-sync: mmx node sync

To replay/revert to an earlier block height: mmx node revert <height>

Wallet CLI

To show everything in a wallet: mmx wallet show

To show wallet balances: mmx wallet show balance

To show wallet contracts: mmx wallet show contracts

To show wallet offers: mmx wallet show offers

To get a specific wallet address: mmx wallet get address

To get a specific wallet balance: mmx wallet get balance

To get a specific raw wallet balance: mmx wallet get amount

To get a list of all contract addresses: mmx wallet get contracts

To get the mnemonic seed words of a wallet: mmx wallet get seed

To show wallet activity for last N heights: mmx wallet log -N

To transfer funds: mmx wallet send <options>

	-a <amount to send, 1.23>
	-r <tx fee multiplier>
	-t <destination address>
	-x <currency>

To withdraw funds from a contract: mmx wallet send_from

	-s <source address>

To transfer an NFT, same as sending with one satoshi: mmx wallet transfer

To create an offer on the chain: mmx wallet offer

	(-x / -z default MMX)
	-a <bid amount> -b <ask amount>
	-x <bid currency> -z <ask currency>

To accept an offer: mmx wallet accept <address>

To mint tokens: mmx wallet mint

	-a <amount>
	-t <destination>
	-x <currency>

To deploy a contract: mmx wallet deploy <file>

To mutate a contract: mmx wallet mutate <function> <args>

	-x <contract>

To execute a smart contract function: mmx wallet exec <function> <args>

	-x <contract>

To create a new wallet: mmx wallet create -f [file_name]

To restore a wallet from a seed hash: mmx wallet create [seed hash]

To restore a wallet from a set of 24 mnemonic words: mmx wallet create --mnemonic [word1 word2 word3....]

To show all wallets and their index: mmx wallet accounts

To get farmer / pool keys for plotting: mmx wallet keys

To lock a wallet if passphase enabled: mmx wallet lock

To unlock a wallet with passphrase: mmx wallet unlock

To use a non-default wallet, specify -j <index> in combination with the above commands. <index> start at 0, which is the default.

Farmer CLI

To check on the farm: mmx farm info

To get total space in bytes: mmx farm get space

To show plot directories: mmx farm get dirs

To add plot directories: mmx farm add <dir>

To remove plot directories: mmx farm remove <dir>

To reload plots: mmx farm reload

Harvester CLI

To check on the harvester: mmx harvester info

To get harvester space in bytes: mmx harvester get space

To show plot directories: mmx harvester get dirs

To add plot directories: mmx harvester add <dir>

To remove plot directories: mmx harvester remove <dir>

To reload plots: mmx harvester reload

Clone this wiki locally