Mina CLI Reference
The Mina CLI (Command Line Interface) is the primary way for users to interact with the Mina network. It provides standard client functionality to create accounts, send transactions, and participate in consensus. There are also advanced client and daemon commands for power users.
The Mina CLI is installed when you install Mina.
tip
Mina APIs are always improving. See mina help for the most up-to-date version.
Mina Accounts
$ mina accounts help
Client commands concerning account management
  mina accounts SUBCOMMAND
=== subcommands ===
  list    List all owned accounts
  create  Create new account
  import  Import a password protected private key to be tracked by the daemon.
          Set MINA_PRIVKEY_PASS environment variable to use non-interactively
          (key will be imported using the same password).
  export  Export a tracked account so that it can be saved or transferred
          between machines.
          Set MINA_PRIVKEY_PASS environment variable to use non-interactively
          (key will be exported using the same password).
  unlock  Unlock a tracked account
  lock    Lock a tracked account
  help    explain a given subcommand (perhaps recursively)
Mina Client
$ mina client help
Lightweight client commands
  mina client SUBCOMMAND
=== subcommands ===
  get-balance         Get balance associated with a public key
  get-tokens          Get all token IDs that a public key has accounts for
  send-payment        Send payment to an address
  delegate-stake      Delegate your stake to another public key
  cancel-transaction  Cancel a transaction -- this submits a replacement
                      transaction with a fee larger than the cancelled
                      transaction.
  set-snark-worker    Set key you wish to snark work with or disable snark
                      working
  set-snark-work-fee  Set fee reward for doing transaction snark work
  export-logs         Export daemon logs to tar archive
  export-local-logs   Export local logs (no daemon) to tar archive
  stop-daemon         Stop the daemon
  status              Get running daemon status
  help                explain a given subcommand (perhaps recursively)
Mina Daemon
$ mina daemon -help
Mina daemon
  mina daemon 
=== flags ===
  --libp2p-keypair KEYFILE                             Keypair (generated from
                                                       `mina libp2p
                                                       generate-keypair`) to use
                                                       with libp2p discovery
                                                       (alias: -libp2p-keypair)
  [--all-peers-seen-metric true|false]                 whether to track the set
                                                       of all peers ever seen
                                                       for the all_peers metric
                                                       (default: false)
                                                       (alias:
                                                       -all-peers-seen-metric)
  [--archive-address HOST:PORT/LOCALHOST-PORT]         Daemon to archive process
                                                       communication. If HOST is
                                                       omitted, then localhost
                                                       is assumed to be HOST.
                                                       (examples: 3086,
                                                       154.97.53.97:3086)
                                                       (alias: -archive-address)
  [--archive-rocksdb]                                  Stores all the blocks
                                                       heard in RocksDB
                                                       (alias: -archive-rocksdb)
  [--background]                                       Run process on the
                                                       background
                                                       (alias: -background)
  [--bind-ip IP]                                       IP of network interface
                                                       to use for peer
                                                       connections
                                                       (alias: -bind-ip)
  [--block-producer-key KEYFILE]                       Private key file for the
                                                       block producer. You
                                                       cannot provide both
                                                       `block-producer-key` and
                                                       `block-producer-pubkey`.
                                                       (default: don't produce
                                                       blocks). Warning: If the
                                                       key is from a zkApp
                                                       account, the account's
                                                       receive permission must
                                                       be None.
                                                       (alias:
                                                       -block-producer-key)
  [--block-producer-password PASSWORD]                 Password associated with
                                                       the block-producer key.
                                                       Setting this is
                                                       equivalent to setting the
                                                       MINA_PRIVKEY_PASS
                                                       environment variable. Be
                                                       careful when setting it
                                                       in the commandline as it
                                                       will likely get tracked
                                                       in your history. Mainly
                                                       to be used from the
                                                       daemon.json config file
                                                       (alias:
                                                       -block-producer-password)
  [--block-producer-pubkey PUBLICKEY]                  Public key for the
                                                       associated private key
                                                       that is being tracked by
                                                       this daemon. You cannot
                                                       provide both
                                                       `block-producer-key` and
                                                       `block-producer-pubkey`.
                                                       (default: don't produce
                                                       blocks). Warning: If the
                                                       key is from a zkApp
                                                       account, the account's
                                                       receive permission must
                                                       be None.
                                                       (alias:
                                                       -block-producer-pubkey)
  [--client-port PORT]                                 local RPC-server for
                                                       clients to interact with
                                                       the daemon (default:
                                                       8301)
                                                       (alias: -client-port)
  [--coinbase-receiver PUBLICKEY]                      Address to send coinbase
                                                       rewards to (if this node
                                                       is producing blocks). If
                                                       not provided, coinbase
                                                       rewards will be sent to
                                                       the producer of a block.
                                                       Warning: If the key is
                                                       from a zkApp account, the
                                                       account's receive
                                                       permission must be None.
                                                       (alias:
                                                       -coinbase-receiver)
  [--config-directory DIR]                             Configuration directory
                                                       (alias:
                                                       -config-directory)
  [--config-file PATH] ...                             path to a configuration
                                                       file (overrides
                                                       MINA_CONFIG_FILE,
                                                       default:
                                                       <config_dir>/daemon.json).
                                                       Pass multiple times to
                                                       override fields from
                                                       earlier config files
                                                       (alias: -config-file)
  [--contact-info contact]                             info used in node error
                                                       report service (it could
                                                       be either email address
                                                       or discord username), it
                                                       should be less than 200
                                                       characters
                                                       (alias: -contact-info)
  [--demo-mode]                                        Run the daemon in
                                                       demo-mode -- assume we're
                                                       "synced" to the network
                                                       instantly
                                                       (alias: -demo-mode)
  [--direct-peer /ip4/IPADDR/tcp/PORT/p2p/PEERID] ...  Peers to always send new
                                                       messages to/from. These
                                                       peers should also have
                                                       you configured as a
                                                       direct peer, the
                                                       relationship is intended
                                                       to be symmetric
                                                       (alias: -direct-peer)
  [--disable-node-status]                              Disable reporting node
                                                       status to other nodes
                                                       (default: enabled)
                                                       (alias:
                                                       -disable-node-status)
  [--enable-flooding true|false]                       Publish our own
                                                       blocks/transactions to
                                                       every peer we can find
                                                       (default: false)
                                                       (alias: -enable-flooding)
  [--enable-peer-exchange true|false]                  Help keep the mesh
                                                       connected when closing
                                                       connections (default:
                                                       false)
                                                       (alias:
                                                       -enable-peer-exchange)
  [--external-ip IP]                                   External IP address for
                                                       other nodes to connect
                                                       to. You only need to set
                                                       this if auto-discovery
                                                       fails for some reason.
                                                       (alias: -external-ip)
  [--external-port PORT]                               Port to use for all
                                                       libp2p communications
                                                       (gossip and RPC)
                                                       (default: 8302)
                                                       (alias: -external-port)
  [--file-log-level LEVEL]                             Set log level for the log
                                                       file
                                                       (Internal|Spam|Trace|Debug|Info|Warn|Error|Faulty_peer|Fatal,
                                                       default: Trace)
                                                       (alias: -file-log-level)
  [--file-log-rotations Number]                        of file log rotations
                                                       before overwriting old
                                                       logs (default: 50)
  [--gc-stat-interval INTERVAL]                        in mins for collecting GC
                                                       stats for metrics
                                                       (Default: 15.000000)
                                                       (alias:
                                                       -gc-stat-interval)
  [--generate-genesis-proof true|false]                Deprecated. Passing this
                                                       flag has no effect
                                                       (alias:
                                                       -generate-genesis-proof)
  [--genesis-ledger-dir DIR]                           Directory that contains
                                                       the genesis ledger and
                                                       the genesis blockchain
                                                       proof (default:
                                                       <config-dir>)
                                                       (alias:
                                                       -genesis-ledger-dir)
  [--insecure-rest-server]                             Have REST server listen
                                                       on all addresses, not
                                                       just localhost (this is
                                                       INSECURE, make sure your
                                                       firewall is configured
                                                       correctly!)
                                                       (alias:
                                                       -insecure-rest-server)
  [--internal-tracing]                                 Enables internal tracing
                                                       into
                                                       $config-directory/internal-tracing/internal-trace.jsonl
                                                       (alias:
                                                       -internal-tracing)
  [--isolate-network true|false]                       Only allow connections to
                                                       the peers passed on the
                                                       command line or
                                                       configured through
                                                       GraphQL. (default: false)
                                                       (alias: -isolate-network)
  [--itn-graphql-port PORT]                            GraphQL-server for
                                                       incentivized testnet
                                                       interaction
                                                       (alias:
                                                       -itn-graphql-port)
  [--itn-keys PUBLICKEYS]                              A comma-delimited list of
                                                       Ed25519 public keys that
                                                       are permitted to send
                                                       signed requests to the
                                                       incentivized testnet
                                                       GraphQL server
                                                       (alias: -itn-keys)
  [--itn-max-logs NN]                                  Maximum number of logs to
                                                       store to be made
                                                       available via GraphQL for
                                                       incentivized testnet
                                                       (alias: -itn-max-logs)
  [--libp2p-metrics-port PORT]                         libp2p metrics server for
                                                       scraping via Prometheus
                                                       (default no
                                                       libp2p-metrics-server)
                                                       (alias:
                                                       -libp2p-metrics-port)
  [--limited-graphql-port PORT]                        GraphQL-server for
                                                       limited daemon
                                                       interaction
                                                       (alias:
                                                       -limited-graphql-port)
  [--log-block-creation true|false]                    Log the steps involved in
                                                       including transactions
                                                       and snark work in a block
                                                       (default: true)
                                                       (alias:
                                                       -log-block-creation)
  [--log-json]                                         Print log output as JSON
                                                       (default: plain text)
                                                       (alias: -log-json)
  [--log-level LEVEL]                                  Set log level
                                                       (Internal|Spam|Trace|Debug|Info|Warn|Error|Faulty_peer|Fatal,
                                                       default: Info)
                                                       (alias: -log-level)
  [--log-precomputed-blocks true|false]                Include precomputed
                                                       blocks in the log
                                                       (default: false)
                                                       (alias:
                                                       -log-precomputed-blocks)
  [--log-snark-work-gossip true|false]                 Log snark-pool diff
                                                       received from peers
                                                       (default: false)
                                                       (alias:
                                                       -log-snark-work-gossip)
  [--log-txn-pool-gossip true|false]                   Log transaction-pool diff
                                                       received from peers
                                                       (default: false)
                                                       (alias:
                                                       -log-txn-pool-gossip)
  [--max-connections NN]                               max number of connections
                                                       that this peer will have
                                                       to neighbors in the
                                                       gossip network. Tuning
                                                       this higher will
                                                       strengthen your
                                                       connection to the network
                                                       in exchange for using
                                                       more RAM (default: 50)
                                                       (alias: -max-connections)
  [--metrics-port PORT]                                metrics server for
                                                       scraping via Prometheus
                                                       (default no
                                                       metrics-server)
                                                       (alias: -metrics-port)
  [--min-connections NN]                               min number of connections
                                                       that this peer will have
                                                       to neighbors in the
                                                       gossip network (default:
                                                       20)
                                                       (alias: -min-connections)
  [--minimum-block-reward AMOUNT]                      Minimum reward a block
                                                       produced by the node
                                                       should have. Empty blocks
                                                       are created if the
                                                       rewards are lower than
                                                       the specified threshold
                                                       (default: No threshold,
                                                       transactions and coinbase
                                                       will be included as long
                                                       as the required snark
                                                       work is available and can
                                                       be paid for)
                                                       (alias:
                                                       -minimum-block-reward)
  [--no-super-catchup]                                 Don't use super-catchup
                                                       (alias:
                                                       -no-super-catchup)
  [--node-error-url URL]                               of the node error
                                                       collection service
                                                       (alias: -node-error-url)
  [--node-status-url URL]                              of the node status
                                                       collection service
                                                       (alias: -node-status-url)
  [--open-limited-graphql-port]                        Have the limited GraphQL
                                                       server listen on all
                                                       addresses, not just
                                                       localhost (this is
                                                       INSECURE, make sure your
                                                       firewall is configured
                                                       correctly!)
                                                       (alias:
                                                       -open-limited-graphql-port)
  [--peer /ip4/IPADDR/tcp/PORT/p2p/PEERID] ...         initial "bootstrap" peers
                                                       for discovery
                                                       (alias: -peer)
  [--peer-list-file PATH]                              path to a file containing
                                                       "bootstrap" peers for
                                                       discovery, one
                                                       multiaddress per line
                                                       (alias: -peer-list-file)
  [--peer-list-url URL]                                URL of seed peer list
                                                       file. Will be polled
                                                       periodically.
                                                       (alias: -peer-list-url)
  [--peer-protection-rate float]                       Proportion of peers to be
                                                       marked as protected
                                                       (default: 0.2)
                                                       (alias:
                                                       -peer-protection-rate)
  [--precomputed-blocks-file PATH]                     Path to write precomputed
                                                       blocks to, for replay or
                                                       archiving
                                                       (alias:
                                                       -precomputed-blocks-file)
  [--proof-level full|check|none]                      Internal, for testing.
                                                       Start or connect to a
                                                       network with full proving
                                                       (full), snark-testing
                                                       with dummy proofs
                                                       (check), or dummy proofs
                                                       (none)
                                                       (alias: -proof-level)
  [--proposed-protocol-version NN.NN.NN]               Proposed protocol version
                                                       to signal other nodes
                                                       (alias:
                                                       -proposed-protocol-version)
  [--rest-port PORT]                                   local REST-server for
                                                       daemon interaction
                                                       (default: 3085)
                                                       (alias: -rest-port)
  [--run-snark-coordinator PUBLICKEY]                  Run a SNARK coordinator
                                                       with this public key
                                                       (ignored if the
                                                       run-snark-worker is set).
                                                       Warning: If the key is
                                                       from a zkApp account, the
                                                       account's receive
                                                       permission must be None.
                                                       (alias:
                                                       -run-snark-coordinator)
  [--run-snark-worker PUBLICKEY]                       Run the SNARK worker with
                                                       this public key. Warning:
                                                       If the key is from a
                                                       zkApp account, the
                                                       account's receive
                                                       permission must be None.
                                                       (alias:
                                                       -run-snark-worker)
  [--seed]                                             Start the node as a seed
                                                       node
                                                       (alias: -seed)
  [--snark-worker-fee FEE]                             Amount a worker wants to
                                                       get compensated for
                                                       generating a snark proof
                                                       (default: 100000000)
                                                       (alias:
                                                       -snark-worker-fee)
  [--snark-worker-parallelism NUM]                     Run the SNARK worker
                                                       using this many threads.
                                                       Equivalent to setting
                                                       OMP_NUM_THREADS, but
                                                       doesn't affect block
                                                       production.
                                                       (alias:
                                                       -snark-worker-parallelism)
  [--stop-time UPTIME]                                 in hours after which the
                                                       daemon stops itself (only
                                                       if there were no slots
                                                       won within an hour after
                                                       the stop time) (Default:
                                                       168)
                                                       (alias: -stop-time)
  [--tracing]                                          Trace into
                                                       $config-directory/trace/$pid.trace
                                                       (alias: -tracing)
  [--upload-blocks-to-gcloud true|false]               upload blocks to gcloud
                                                       storage. Requires the
                                                       environment variables
                                                       GCLOUD_KEYFILE,
                                                       NETWORK_NAME, and
                                                       GCLOUD_BLOCK_UPLOAD_BUCKET
                                                       (alias:
                                                       -upload-blocks-to-gcloud)
  [--uptime-send-node-commit-sha]                      true|false Whether to
                                                       send the commit SHA used
                                                       to build the node to the
                                                       uptime service. (default:
                                                       false)
                                                       (alias:
                                                       -uptime-send-node-commit-sha)
  [--uptime-submitter-key KEYFILE]                     Private key file for the
                                                       uptime submitter. You
                                                       cannot provide both
                                                       `uptime-submitter-key`
                                                       and
                                                       `uptime-submitter-pubkey`.
                                                       (alias:
                                                       -uptime-submitter-key)
  [--uptime-submitter-pubkey PUBLICKEY]                Public key of the
                                                       submitter to the Mina
                                                       delegation program, for
                                                       the associated private
                                                       key that is being tracked
                                                       by this daemon. You
                                                       cannot provide both
                                                       `uptime-submitter-key`
                                                       and
                                                       `uptime-submitter-pubkey`.
                                                       (alias:
                                                       -uptime-submitter-pubkey)
  [--uptime-url URL]                                   URL of the uptime service
                                                       of the Mina delegation
                                                       program
                                                       (alias: -uptime-url)
  [--validation-queue-size NN]                         size of the validation
                                                       queue in the p2p network
                                                       used to buffer messages
                                                       (like blocks and
                                                       transactions received on
                                                       the gossip network) while
                                                       validation is pending. If
                                                       a transaction, for
                                                       example, is invalid, we
                                                       don't forward the message
                                                       on the gossip net. If
                                                       this queue is too small,
                                                       we will drop messages
                                                       without validating them.
                                                       If it is too large, we
                                                       are susceptible to DoS
                                                       attacks on memory.
                                                       (default: 150)
                                                       (alias:
                                                       -validation-queue-size)
  [--work-reassignment-wait WAIT-TIME]                 in ms before a snark-work
                                                       is reassigned (default:
                                                       420000ms)
                                                       (alias:
                                                       -work-reassignment-wait)
  [--work-selection seq|rand]                          Choose work sequentially
                                                       (seq) or randomly (rand)
                                                       (default: rand)
                                                       (alias: -work-selection)
  [--working-dir PATH]                                 path to chdir into before
                                                       starting (useful for
                                                       background mode, defaults
                                                       to cwd, or / if
                                                       -background)
                                                       (alias: -working-dir)
  [-help]                                              print this help text and
                                                       exit
                                                       (alias: -?)
Mina Advanced
$ mina advanced help
Advanced client commands
  mina advanced SUBCOMMAND
=== subcommands ===
  add-peers                   Add peers to the daemon
                              Addresses take the format
                              /ip4/IPADDR/tcp/PORT/p2p/PEERID
  archive-blocks              Archive a block from a file.
                              If an archive address is given, this process will
                              communicate with the archive node directly;
                              otherwise it will communicate through the daemon
                              over the rest-server
  batch-send-payments         Send multiple payments from a file
  chain-id-inputs             Print the inputs that yield the current chain id
  client-trustlist            Client trustlist management
  compile-time-constants      Print a JSON map of the compile-time consensus
                              parameters
  compute-receipt-chain-hash  Compute the next receipt chain hash from the
                              previous hash and transaction ID
  constraint-system-digests   Print MD5 digest of each SNARK constraint
  dump-keypair                Print out a keypair from a private key file
  generate-keypair            Generate a new public, private keypair
  get-nonce                   Get the current nonce for an account
  get-peers                   List the peers currently connected to the daemon
  get-public-keys             Get public keys
  get-trust-status            Get the trust status associated with an IP address
  get-trust-status-all        Get trust statuses for all peers known to the
                              trust system
  hash-transaction            Compute the hash of a transaction from its
                              transaction ID
  itn-create-accounts         Fund new accounts for incentivized testnet
  node-status                 Get node statuses for a set of peers
  object-lifetime-statistics  Dump internal object lifetime statistics to JSON
  pending-snark-work          List of snark works in JSON format that are not
                              available in the pool yet
  pooled-user-commands        Retrieve all the user commands that are pending
                              inclusion
  pooled-zkapp-commands       Retrieve all the zkApp commands that are pending
                              inclusion
  reset-trust-status          Reset the trust status associated with an IP
                              address
  runtime-config              Compute the runtime configuration used by a
                              running daemon
  send-rosetta-transactions   Dispatch one or more transactions, provided to
                              stdin in rosetta format
  set-coinbase-receiver       Set the coinbase receiver
  snark-job-list              List of snark jobs in JSON format that are yet to
                              be included in the blocks
  snark-pool-list             List of snark works in the snark pool in JSON
                              format
  start-internal-tracing      Start internal tracing to
                              $config-directory/internal-tracing/internal-trace.jsonl
  start-tracing               Start async tracing to
                              $config-directory/trace/$pid.trace
  status-clear-hist           Clear histograms reported in status
  stop-internal-tracing       Stop internal tracing
  stop-tracing                Stop async tracing
  thread-graph                Return a Graphviz Dot graph representation of the
                              internal thread hierarchy
  time-offset                 Get the time offset in seconds used by the daemon
                              to convert real time into blockchain time
  validate-keypair            Validate a public, private keypair
  validate-transaction        Validate the signature on one or more
                              transactions, provided to stdin in rosetta format
  verify-receipt              Verify a receipt of a sent payment
  visualization               Visualize data structures special to Mina
  vrf                         Commands for vrf evaluations
  wrap-key                    Wrap a private key into a private key file
  help                        explain a given subcommand (perhaps recursively)
Mina Generate Keypair
$ mina-generate-keypair -help
Generate a new public, private keypair
  mina-generate-keypair 
=== flags ===
  --privkey-path FILE  File to write private key into (public key will be
                       FILE.pub)
                       (alias: -privkey-path)
  [-build-info]        print info about this build and exit
  [-version]           print the version of this build and exit
  [-help]              print this help text and exit
                       (alias: -?)
MIna Validate Keypair
$ mina-validate-keypair -help
Validate a public, private keypair
  mina-validate-keypair 
=== flags ===
  --privkey-path FILE  File to write private key into (public key will be
                       FILE.pub)
                       (alias: -privkey-path)
  [-build-info]        print info about this build and exit
  [-version]           print the version of this build and exit
  [-help]              print this help text and exit
                       (alias: -?)