Record each order's node in the local store and report it in order mine

オープン
#272 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
cli, database

調査の方向性

Start with the local order store and the code behind order mine, order new, order take-sell/order take-buy and order sync, then the store's migration path. Decide the open question first: whether rows with an unknown node are listed without a filter. Done means the node's public key is stored on each of those paths, order mine reports node_pubkey (null for old rows), --node accepts hex or npub, old stores open after migration, and docs/commands.md is updated.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Problem

The local order store does not record which Mostro node an order belongs to. At 0.17.1, an order mine row carries id, side, status, trade_index and trade_pubkey, and nothing about the node the order was made, taken or adopted on.

An identity can trade on several nodes, since MOSTRO_PUBKEY is just configuration. A client therefore cannot tell which orders a node change would strand. MostroP2P/mcp#11 lets an agent switch between the trusted nodes, and has to refuse the switch while any order in the store is not finished, on any node. The consequences:

  • An open order on node A blocks a switch from node B to C, even though it has nothing to do with B.
  • An order the node already closed, whose local status is stale, blocks every switch.
  • Order-scoped commands (order info, order watch, order chat, the trade steps) always use the configured node. A client cannot follow a trade on node A while configured for node B.

Proposal

  1. Record the node. Store the node's public key (lowercase hex) with each order when it is created (order new), taken (order take-sell / order take-buy) or adopted (order sync).
  2. Report it. Add node_pubkey to each order mine row in the JSON output (and to the human table). Rows written before this change have no node: report null, never a guess.
  3. Filter by it. Add order mine --node=<hex|npub> to list only one node's orders (rows with an unknown node are listed under no filter only, or with an explicit option; the spec should decide).

A follow-up, not in this issue: order-scoped commands could use the order's recorded node when it differs from the configured one, so a trade can be followed after a node change.

Acceptance criteria

  • New orders from order new, both take commands and order sync store the node's public key; a test covers each path.
  • order mine JSON rows include node_pubkey (null for older rows), and the output schema in mostro-cli --output json schema says so.
  • order mine --node=… returns only that node's orders and accepts hex or npub.
  • Existing stores open without error, through a migration that adds the column with no value for old rows.
  • docs/commands.md and the mostro-cli book document the field and the filter.
主要言語
Rust
スター
39
フォーク
16
平均マージ
6時間
マージ済み PR(30日)
50

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MostroP2P/mostro-cli のほかの issue

MostroP2P/mostro-cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。