rainbow icon indicating copy to clipboard operation
rainbow copied to clipboard

feat: accept X-PIN-ORIGINS peer hint for content retrieval

Open acejam opened this issue 5 months ago • 0 comments

This PR implements "origins" hinting for Rainbow’s HTTP gateway, aligned with the IPFS Pinning Service API.

Clients can now specify an optional X-PIN-ORIGINS HTTP header along with their gateway request. The header value should be a comma-separated list of peer multiaddresses. Values are parsed, de-duplicated, and each is connected to in parallel with a short timeout to speed up Bitswap retrieval. This feature is helpful in scenarios where a pin origin is known, but the content has not been advertised via DHT/IPNI for various reasons.

Example:

curl -H 'X-PIN-ORIGINS: /ip4/203.0.113.10/tcp/4001/p2p/12D3K..., /dns4/peer.example.com/tcp/4001/p2p/12D3K...' \
  http://localhost:8090/ipfs/<CID>

acejam avatar Nov 18 '25 03:11 acejam