Add Ipfs-DagSize and/or Ipfs-DataSize to gateway responses

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

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
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Lĩnh vực
api, networking

Hướng nghiên cứu

Bắt đầu bằng việc chuyển các yêu cầu đã nêu về Ipfs-DagSize và Ipfs-DataSize thành một đặc tả, sau đó so sánh các cách tiếp cận được đề xuất là HTTP header và custom content type. Xác định rõ phạm vi liên quan đến UnixFS, single-block dag-cbor, các phản hồi HEAD và ngữ nghĩa về kích thước. Công việc được xem là hoàn tất khi đã thống nhất API và kế hoạch triển khai cho các client gateway.

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

Mô tả

This is a placeholder issue for writing spec and tracking implementation.

The need is to expose equivalent of ipfs files stat's Size and CumulativeSize on HTTP gateway somehow, allowing light clients to understand how big is the DAG before fetching it as a CAR etc.

  • Ipfs-DagSize total size of the DAG (user data + DAG metadata, IPLD envelopes etc)
  • Ipfs-DataSize total size of the raw data (without DAG metadata, IPLD envelopes etc)

We don't want expensive equivalent of ipfs dag stat for Unixfs, we want to leverage hints from UnixFS. It could be limited to formats like UnixFS, or single-block dag-cbor etc, which include total sizes in the root blocks, removing the need for expensive ipfs dag stat of entire DAG.

Implementation options
  • 🟢 HTTP Headers
    • Ipfs-DagSize and Ipfs-DataSize headers with value in bytes
    • pro: simple and easy to implement, JS apps already use Content-Type for this (because without compression it matches payload size), we should not break them without giving a replacement header
    • 💡 caveat: unnecessary work on every request, unless we limit them to HEAD responses
  • ⛔ Custom content type that returns useful metadata
    • would be opt-in Accept HTTP header or format URL arg)
    • pro: could be leveraged for things other than size info
    • con: complexity, need to decide on JSON schema, harder for gateways and clients to adopt

cc @vasco-santos I know you needed something like this a while ago

Ngôn ngữ chính
HTML
Star
1.2k
Fork
250
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 ipfs/specs

Tất cả issue của ipfs/specs

Issue tương tự

Thêm issue về Backend & API Design

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.