Example catalogue
120 examples: 75 fixtures from the CLI’s test suite, 14 captured from the binary, 31 authored for this book. Every one validates against the generated schema of its command (scripts/validate_examples.py).
Files are in examples/, one envelope per file, exactly as printed on stdout. examples/index.json adds the command line, exit code, title and source of each.
- fixture: a contract case of the CLI repository (
specs/*/contracts/examples.json), reproduced by its tests. Synthetic values. - captured: real output of mostro-cli 0.16.3, run offline.
- authored: written for this book from the contract and validated against the schema; synthetic values.
By command
| Example | Command | Status | Code | Exit | Source |
|---|---|---|---|---|---|
bond.add-invoice/invoice_accepted — Payout invoice for a slashed bond accepted | bond.add-invoice | ok | 0 | fixture | |
bond.add-invoice/no_share_reported — Accepted; the node did not report the share amount | bond.add-invoice | ok | 0 | authored | |
bond.add-invoice/node_refused — Refused with reason invalid_invoice | bond.add-invoice | error | node_refused | 1 | fixture |
bond.add-invoice/order_unknown — No local row for this order | bond.add-invoice | error | order_unknown | 1 | fixture |
bond.add-invoice/reply_timeout_uncertain — No answer: wait for the payout before sending again | bond.add-invoice | uncertain | reply_timeout | 1 | fixture |
general/output_not_supported_dispute_list — Another legacy command asked for JSON | dispute.list | error | output_not_supported | 2 | captured |
general/output_not_supported_secret — A legacy command asked for JSON: rejected before it runs | account.trade-key | error | output_not_supported | 2 | fixture |
general/unknown_command — An unknown command: command is null | None | error | invalid_arguments | 2 | captured |
message.list/identity_missing — No local identity | message.list | error | identity_missing | 1 | fixture |
message.list/identity_unreadable — The database holds no valid mnemonic | message.list | error | identity_unreadable | 1 | authored |
message.list/messages_of_a_trade — Four messages of one trade, oldest first | message.list | ok | 0 | fixture | |
message.list/no_messages — An empty window is a success | message.list | ok | 0 | fixture | |
message.list/one_order — –order reads only that order’s stored key; trade_index is null when it is not among the newest 200 | message.list | ok | 0 | authored | |
message.list/order_unknown — –order names an order the store does not know | message.list | error | order_unknown | 1 | fixture |
message.list/payload_kinds — A tour of the payload kinds: payment_request, peer, other, none, cant_do, bond_payout_request and a new-order to a fresh key | message.list | ok | 0 | authored | |
message.list/read_timeout — The relays did not finish in time | message.list | error | read_timeout | 1 | fixture |
message.list/relay_connection_failed — No relay could be connected | message.list | error | relay_connection_failed | 1 | fixture |
message.list/removed_getdm — The removed getdm spelling | None | error | invalid_arguments | 2 | fixture |
message.list/store_unreadable — The local database cannot be read | message.list | error | store_unreadable | 1 | fixture |
message.list/truncated_and_keys_limited — More keys and messages than were read: truncated with a warning | message.list | ok | 0 | fixture | |
message.list/window_out_of_range — –since above 10080 minutes | message.list | error | invalid_arguments | 2 | fixture |
order.add-invoice/invoice_updated — A replacement invoice (for example after a failed payment) was stored | order.add-invoice | ok | 0 | fixture | |
order.add-invoice/node_refused — Refused with reason invalid_peer | order.add-invoice | error | node_refused | 1 | fixture |
order.add-invoice/order_declined — Declined at the human prompt | order.add-invoice | error | order_declined | 1 | fixture |
order.add-invoice/order_unknown — No local row for this order: nothing was sent | order.add-invoice | error | order_unknown | 1 | fixture |
order.add-invoice/payment_accepted — Invoice accepted and the seller had already paid: the order is active | order.add-invoice | ok | 0 | fixture | |
order.add-invoice/relay_read_failed_uncertain — A Lightning address sent; the relays dropped the wait afterwards | order.add-invoice | uncertain | relay_read_failed | 1 | authored |
order.add-invoice/removed_spelling — The removed addinvoice spelling | None | error | invalid_arguments | 2 | fixture |
order.add-invoice/reply_malformed_uncertain — An answer that could not be used | order.add-invoice | uncertain | reply_malformed | 1 | fixture |
order.add-invoice/reply_timeout_uncertain — No answer: the node may hold the invoice | order.add-invoice | uncertain | reply_timeout | 1 | fixture |
order.add-invoice/stale_status — Accepted, but the local status could not be updated: ok with a warning | order.add-invoice | ok | 0 | fixture | |
order.add-invoice/waiting_seller_payment — Invoice accepted; the seller has not paid yet | order.add-invoice | ok | 0 | fixture | |
order.add-invoice/yes_required — JSON mode without –yes | order.add-invoice | error | invalid_arguments | 2 | fixture |
order.cancel/cancel_accepted — The counterparty had requested a cancel: now canceled by both | order.cancel | ok | 0 | fixture | |
order.cancel/cancel_requested — In an active trade: a cooperative cancel was started | order.cancel | ok | 0 | fixture | |
order.cancel/canceled — A pending order canceled | order.cancel | ok | 0 | fixture | |
order.cancel/node_refused — Refused with reason order_already_canceled | order.cancel | error | node_refused | 1 | fixture |
order.cancel/order_declined — Declined at the human prompt | order.cancel | error | order_declined | 1 | fixture |
order.cancel/reply_malformed_uncertain — An unusable answer: the cancel may have happened | order.cancel | uncertain | reply_malformed | 1 | fixture |
order.cancel/store_unwritable — Local store not writable: nothing sent | order.cancel | error | store_unwritable | 1 | authored |
order.cancel/yes_required — JSON mode without –yes | order.cancel | error | invalid_arguments | 2 | captured |
order.fiat-sent/fiat_sent — The buyer confirmed the fiat payment | order.fiat-sent | ok | 0 | fixture | |
order.fiat-sent/node_refused — Refused with reason invalid_pubkey | order.fiat-sent | error | node_refused | 1 | fixture |
order.fiat-sent/range_key_sent — Maker of a buy range order: the step carried the next trade key (index 4) | order.fiat-sent | ok | 0 | fixture | |
order.fiat-sent/removed_spelling — The removed fiatsent spelling | None | error | invalid_arguments | 2 | fixture |
order.fiat-sent/trade_index_not_recorded — Range maker: accepted, but the reserved index 4 could not be recorded | order.fiat-sent | ok | 0 | authored | |
order.fiat-sent/yes_required — JSON mode without –yes | order.fiat-sent | error | invalid_arguments | 2 | fixture |
order.info/identity_missing — No local identity: nothing was sent | order.info | error | identity_missing | 1 | fixture |
order.info/identity_missing_captured — Identity checked before any network access | order.info | error | identity_missing | 1 | captured |
order.info/invalid_arguments — An –order value that is not a UUID | order.info | error | invalid_arguments | 2 | fixture |
order.info/node_refused — The node refused with reason too_many_requests | order.info | error | node_refused | 1 | fixture |
order.info/not_found_success — The node knows none of the ids: still ok, with a warning | order.info | ok | 0 | fixture | |
order.info/own_trade_in_progress — One of your own orders mid-trade, with both trade keys known | order.info | ok | 0 | authored | |
order.info/pow_required — The node asks for more proof of work than –pow / POW | order.info | error | pow_required | 1 | authored |
order.info/protocol_unsupported — The node advertises protocol v1 (gift wrap): nothing is published | order.info | error | protocol_unsupported | 1 | authored |
order.info/removed_spelling — The removed ordersinfo spelling: unresolved command, command is null | None | error | invalid_arguments | 2 | fixture |
order.info/reply_malformed — A correlated answer with an unusable payload | order.info | error | reply_malformed | 1 | authored |
order.info/reply_timeout — Published, no answer within 15 s: an error (a read is safe to repeat) | order.info | error | reply_timeout | 1 | fixture |
order.info/request_rejected_ambiguous — No relay confirmed the event and one failed ambiguously: publication unknown (still an error, a read is safe to repeat) | order.info | error | request_rejected | 1 | authored |
order.info/subset_success — Two of three orders returned; the third is listed in not_returned | order.info | ok | 0 | fixture | |
order.list/active_with_cleanup_warning — Status filter active; relay cleanup overran its 1 s budget, which is only a warning | order.list | ok | 0 | authored | |
order.list/configuration_invalid — An unparsable node key | order.list | error | configuration_invalid | 1 | captured |
order.list/configuration_missing — Neither MOSTRO_PUBKEY nor RELAYS set | order.list | error | configuration_missing | 1 | captured |
order.list/empty_success — An empty book is a success with an empty array | order.list | ok | 0 | fixture | |
order.list/invalid_side — An invalid –side value | order.list | error | invalid_arguments | 2 | fixture |
order.list/large_amount_success — Sell orders in USD; the sats amount is above 2^53, which is why amounts are strings | order.list | ok | 0 | fixture | |
order.list/mixed_book — A fixed sell order, a buy range order at market price and an order with an unrepresentable timestamp | order.list | ok | 0 | authored | |
order.list/read_limit_exceeded — More than 10000 unique events: rejected rather than truncated | order.list | error | read_limit_exceeded | 1 | authored |
order.list/read_timeout — One of two relays did not finish: an error, never partial data | order.list | error | read_timeout | 1 | fixture |
order.list/relay_connection_failed — The only relay refuses connections | order.list | error | relay_connection_failed | 1 | captured |
order.list/relay_read_failed — A relay closed the subscription before EOSE: no partial data | order.list | error | relay_read_failed | 1 | authored |
order.list/terminator_keeps_json — Tokens after – are not options; JSON stays selected and the stray tokens are an argument error | order.list | error | invalid_arguments | 2 | captured |
order.new/bond_to_pay — A bonded node asks the maker to pay a bond first | order.new | ok | 0 | fixture | |
order.new/created — A market-price sell order created and saved | order.new | ok | 0 | fixture | |
order.new/fixed_buy_with_invoice — A fixed-price buy order with the buyer’s invoice attached | order.new | ok | 0 | authored | |
order.new/identity_missing — No local identity: nothing was sent | order.new | error | identity_missing | 1 | fixture |
order.new/identity_missing_captured — Write-command stages on a local failure | order.new | error | identity_missing | 1 | captured |
order.new/node_refused — The node refused with reason invalid_amount | order.new | error | node_refused | 1 | fixture |
order.new/order_declined — The outcome of answering n at the human prompt; a JSON caller never sees it because JSON requires –yes | order.new | error | order_declined | 1 | fixture |
order.new/order_not_saved_uncertain — The node created the order but the local row could not be written; data is present | order.new | uncertain | order_not_saved | 1 | fixture |
order.new/pow_required — Not enough proof of work configured: nothing sent | order.new | error | pow_required | 1 | authored |
order.new/range_created — A range order 100-300 USD | order.new | ok | 0 | fixture | |
order.new/relay_read_failed_uncertain — Published, then the relays dropped the wait; recording the spent index also failed | order.new | uncertain | relay_read_failed | 1 | authored |
order.new/removed_spelling — The removed neworder spelling | None | error | invalid_arguments | 2 | fixture |
order.new/reply_timeout_uncertain — Published, no answer: the order may exist; the trade index was spent | order.new | uncertain | reply_timeout | 1 | fixture |
order.new/request_rejected_error — Every relay explicitly rejected the event: provably nothing sent, a plain error | order.new | error | request_rejected | 1 | authored |
order.new/request_rejected_uncertain — Relays answered ambiguously: the event may be out there; the index was spent | order.new | uncertain | request_rejected | 1 | authored |
order.new/store_unwritable — The database is read-only, so the index cannot be reserved: nothing sent | order.new | error | store_unwritable | 1 | authored |
order.new/yes_required — JSON mode without –yes is an argument error; nothing is done | order.new | error | invalid_arguments | 2 | fixture |
order.release/node_refused — Refused with reason invalid_peer | order.release | error | node_refused | 1 | fixture |
order.release/order_unknown — No local row for this order | order.release | error | order_unknown | 1 | fixture |
order.release/range_continued — Maker of a sell range order released; the node creates a child order: run order sync | order.release | ok | 0 | fixture | |
order.release/relay_read_failed_uncertain_range — Range maker released, the wait failed; the index reserved for the child was recorded | order.release | uncertain | relay_read_failed | 1 | authored |
order.release/released — The seller released the sats | order.release | ok | 0 | fixture | |
order.release/reply_timeout_uncertain — No answer: the sats may have been released. Do not resend blindly | order.release | uncertain | reply_timeout | 1 | fixture |
order.release/stale_status — Released, local status not updated: ok with local_status_stale | order.release | ok | 0 | fixture | |
order.sync/adopted_child — After a range release: the child order announced to trade key 4 gets a local row | order.sync | ok | 0 | authored | |
order.sync/identity_missing — No local identity | order.sync | error | identity_missing | 1 | captured |
order.sync/nothing_to_adopt — Nothing new: idempotent second run, nothing written | order.sync | ok | 0 | authored | |
order.sync/order_not_saved_uncertain — One row saved, the next failed: data lists what was saved | order.sync | uncertain | order_not_saved | 1 | authored |
order.sync/since_out_of_range — –since must be 1..10080 | order.sync | error | invalid_arguments | 2 | captured |
order.sync/store_unwritable — A child was due but the store cannot be written | order.sync | error | store_unwritable | 1 | authored |
order.take-buy/identity_missing — No local identity | order.take-buy | error | identity_missing | 1 | fixture |
order.take-buy/invalid_uuid — –order is not a UUID | order.take-buy | error | invalid_arguments | 2 | captured |
order.take-buy/order_not_saved_uncertain — Accepted by the node, local row not written; data still carries the hold invoice | order.take-buy | uncertain | order_not_saved | 1 | fixture |
order.take-buy/pay_bond_invoice — A bonded node asks the taker for a bond before the hold invoice | order.take-buy | ok | 0 | authored | |
order.take-buy/pay_hold_invoice — Took a buy order: as the seller, pay the hold invoice | order.take-buy | ok | 0 | fixture | |
order.take-buy/reply_timeout_uncertain — Published, no answer: the take may have happened | order.take-buy | uncertain | reply_timeout | 1 | fixture |
order.take-buy/request_rejected_uncertain — Ambiguous relay answers; recording the spent index failed too | order.take-buy | uncertain | request_rejected | 1 | authored |
order.take-sell/add_invoice — Took a sell order without an invoice: the node asks for one next | order.take-sell | ok | 0 | fixture | |
order.take-sell/node_refused — The order is no longer pending: invalid_order_status | order.take-sell | error | node_refused | 1 | fixture |
order.take-sell/order_declined — Declined at the human prompt (not reachable in JSON mode) | order.take-sell | error | order_declined | 1 | fixture |
order.take-sell/pay_bond_invoice — A bonded node asks the taker for a bond first | order.take-sell | ok | 0 | fixture | |
order.take-sell/range_amount — Took 50 USD out of a 10-100 USD sell range order; the node asks for an invoice | order.take-sell | ok | 0 | authored | |
order.take-sell/removed_spelling — The removed takesell spelling | None | error | invalid_arguments | 2 | fixture |
order.take-sell/reply_malformed_uncertain — An answer the CLI cannot use (for example a Cashu escrow): the take may stand | order.take-sell | uncertain | reply_malformed | 1 | authored |
order.take-sell/waiting_for_seller — Took a sell order with an invoice: wait for the seller to pay | order.take-sell | ok | 0 | fixture | |
order.take-sell/yes_required — JSON mode without –yes | order.take-sell | error | invalid_arguments | 2 | fixture |
schema/discovery — The full discovery document (all commands, inputs, outputs) | schema | ok | 0 | captured | |
schema/invalid_arguments — schema takes no options | schema | error | invalid_arguments | 2 | captured |
General
Another legacy command asked for JSON
general/output_not_supported_dispute_list · status error · output_not_supported · exit 2 · captured
mostro-cli --output json listdisputes
{
"schema_version": "1",
"command": "dispute.list",
"status": "error",
"data": null,
"error": {
"code": "output_not_supported",
"message": "This command does not support JSON output."
},
"warnings": [],
"meta": {
"publication": "not_attempted",
"daemon_acceptance": "unknown",
"persistence": "not_attempted",
"snapshot": null
}
}
A legacy command asked for JSON: rejected before it runs
general/output_not_supported_secret · status error · output_not_supported · exit 2 · fixture
mostro-cli --output json getlasttradeprivkey
{
"schema_version": "1",
"command": "account.trade-key",
"status": "error",
"data": null,
"error": {
"code": "output_not_supported",
"message": "This command does not support JSON output."
},
"warnings": [],
"meta": {
"publication": "not_attempted",
"daemon_acceptance": "unknown",
"persistence": "not_attempted",
"snapshot": null
}
}
An unknown command: command is null
general/unknown_command · status error · invalid_arguments · exit 2 · captured
mostro-cli --output json unknowncmd
{
"schema_version": "1",
"command": null,
"status": "error",
"data": null,
"error": {
"code": "invalid_arguments",
"message": "The command arguments are invalid."
},
"warnings": [],
"meta": {
"publication": "not_attempted",
"daemon_acceptance": "unknown",
"persistence": "not_attempted",
"snapshot": null
}
}