Skip to content

Conversation

@Patrick-Ehimen
Copy link

Summary

  • Add opt-in /badge endpoint that generates shields.io-style SVG badges showing real-time IPFS provider availability
  • Color-coded badges: green (2+ providers), yellow (1 provider), red (0 providers), gray (error/pending)
  • Shows provider count and last 6 characters of CID (e.g., "2 providers ...5fbzdi")
  • Non-blocking background checks with "checking..." badge returned immediately
  • In-memory cache with configurable TTL (default 24 hours)
  • Configurable via --enable-badges flag and IPFS_CHECK_ENABLE_BADGES environment variable

Test plan

  • Unit tests added for all badge functions (32 test cases)
  • Manual testing verified badge states: checking → cached result
  • Verified color coding: green/yellow/red/gray
  • Verified HTTP headers: Content-Type, CORS, Cache-Control
  • All existing tests pass

Closes #118

Add an opt-in badge endpoint that generates shields.io-style SVG badges
showing real-time IPFS provider availability for a given CID.

Features:
- Color-coded badges: green (2+ providers), yellow (1), red (0), gray (error/pending)
- Shows provider count and last 6 characters of CID
- Background checks with non-blocking "checking..." badge
- In-memory cache with configurable TTL (default 24h)
- Configurable via --enable-badges flag and environment variables

Closes ipfs#118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live IPFS reachability badge

1 participant