Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[FR] - Balance existing transaction

Đang mở
#867 19 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
haskell
Lĩnh vực
blockchain, cli

Hướng nghiên cứu

Bắt đầu bằng cách xem xét workflow cardano-cli transaction build hiện có và cách các transaction envelope, redeemer và signing key được xử lý. Công việc được xem là hoàn thành khi một giao dịch được soạn thảo bên ngoài được cân bằng bằng cách tính chi phí script và phí, chọn các input trả phí, thêm tiền thừa, rồi ghi kết quả vào đĩa hoặc stdout bằng dữ liệu node.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs investigation Stale

Internal (anyone could benefit though)

Area
Transaction building

Describe the feature you'd like

I would like to use the cardano-cli to balance a transaction that was drafted by another application. Assuming we have a transaction already built with body and witnesses (redeemers) by a DApp in a transaction envelope tx.json and some signing key wallet.sk which owns ADA to pay fees:

 cardano-cli transaction balance \
   --socket-path ... \ #
   --testnet-magic 2 \
   --unbalanced-tx tx.json \
   --cardano-signing-key wallet.sk \
   --out-file tx.json

Would connect to the cardano-node as usual to fetch various information (utxo owned by user, protocol parameters, system start and era history) and balance the transaction. That is:

  • (Re-)calculate script costs using redeemers from the tx
  • Estimate fees
  • Find and add input to cover fees
  • Add a change output
  • Write the balanced transaction to disk (or stdout)

Alternative with slightly smaller scope: Take only an input to use for paying fees and change address, very much like transaction build.

Describe alternatives you've considered
Obvious alternative is to do all this in the DApp itself, but balancing a transaction is a generic process and not application-specific. Also, this would tie the transaction creating code very much to the "source" of where UTxO, protocol parameters etc. are fetched from. Having it in the cardano-cli, a dedicated client to the cardano-node, would keep it separated from e.g. an alternative workflow that uses blockfrost.

Additional context / screenshots
We encountered this while designing a command line tool to create certain smart contract transactions in the Hydra protocol. More details here: https://github.com/cardano-scaling/hydra/issues/1574

Ngôn ngữ chính
Haskell
Star
72
Fork
25
Merge trung bình
3 ngày
Pull request đã merge (30 ngày)
19

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của IntersectMBO/cardano-cli

Tất cả issue của IntersectMBO/cardano-cli

Issue tương tự

Thêm issue về Haskell

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.