API: Make it easier to determine a batch and an on-chain txid given an order
まだ誰も着手していません。
評価
調査の方向性
まず list_sidecars と list_orders の API 実装を読み、その後、例で使用されている既存の leases と batch_snapshots のデータを追跡します。一致する order または sidecar が batch ID と transaction ID をどのように公開するかを定義し、呼び出し元が他のコレクションを反復処理せずに両方を取得できることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
I would like to easily correlate a given order, to a given batch and txid of that batch. Currently I need to iterate over a lot of data in order to finally obtain all of this information.
Describe the solution you'd like
Ideally: when calling list_sidecars or list_orders if the order/sidecar has been matched, it should show the txid and batch id in this API
Describe alternatives you've considered
Currently I am achieving this like so:
# First start with a sidecar id. I got this one by listing the sidecars and finding one that was in the completed state
sidecar_id = b"\3405\254(B\300\225\231"
sidecar_nonce = pool.list_sidecars(sidecar_id).tickets[0].order_bid_nonce
# Obtain the order, associated with the sidecar
# it would be understandable if I could stop here, and get the information I want from the order object
# but I must continue...
for i in pool.list_orders(active_only=False).bids:
if i.details.order_nonce == sidecar_nonce:
order = i
# get the lease txid by matching nonces
target_lease = None
for i in pool.leases(batch_ids=[],accounts=[]).leases:
if i.order_nonce == sidecar_nonce:
target_lease = i
break
lease_txid = target_lease.channel_point.txid[::-1].hex()
# finally get the batch_id by matching batch_txid with the above txid
bs = pool.batch_snapshots(b"", 50)
lease_batch = None
for b in bs.batches:
if b.batch_tx_id == lease_txid:
lease_batch = b.batch_id
break
This is kind of tedious, and also if the database of leases/orders/sidecars is really large, could be very inefficient.
- 主要言語
- Go
- スター
- 256
- フォーク
- 53
- 平均マージ
- 20時間 22分
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lightninglabs/pool のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
lightninglabs/pool#536 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
lightninglabs/pool#514 · コメント 16 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
lightninglabs/pool#478 · コメント 3 件 ·
-
batch batch execution optimization
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
lightninglabs/pool#456 ·
-
add pool-client initiated pings再び着手できるかも @positiveblue が 1278 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
lightninglabs/pool#455 · 担当者 1 名 ·
lightninglabs/pool の issue をすべて見る
似ている issue
-
cmd/fix, x/tools/go/analysis/passes/modernize: mapsloop moves comments out of the range operand対応中かも @muratmirgun が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Cojekt/LibreDental#258 ·
メンテナーはふだん 1 日以内に返信
-
go good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensro-dev/opensro#4949 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信