Files
sonr/docs/reference/queries/query-dwn-ipfs-content-by-cid.mdx
T

51 lines
1.1 KiB
Plaintext
Raw Normal View History

2025-10-03 14:45:52 -04:00
---
title: Retrieve IPFS Content
description: Fetch distributed content using its Content Identifier
2026-09-02 16:53:38 -04:00
seo:
title: "IPFS Content Retrieval"
2025-10-03 14:45:52 -04:00
---
2026-09-02 16:53:38 -04:00
:::info
Content Identifiers (CIDs) are cryptographic hashes that uniquely identify content in IPFS.
:::
2025-10-03 14:45:52 -04:00
## CID Resolution
### Resolution Process
1. Query local IPFS node cache
2. Search connected peers
3. Fetch from distributed network
4. Return raw content data
### CID Formats
- **CIDv0**: Legacy format (starts with 'Qm')
- **CIDv1**: Modern format (starts with 'bafy')
Example CIDs:
```
CIDv0: QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
CIDv1: bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
```
## Performance Considerations
2026-09-02 16:53:38 -04:00
:::tip
Pin frequently accessed content to your local IPFS node for faster retrieval.
:::
2025-10-03 14:45:52 -04:00
### Caching Strategy
- Hot data: Keep pinned locally
- Warm data: Cache with TTL
- Cold data: Fetch on demand
2026-09-02 16:53:38 -04:00
:::warning
Large files may take time to retrieve if not cached locally or on nearby peers.
:::
2025-10-03 14:45:52 -04:00
## Error Handling
Common errors:
- **404**: CID not found in network
- **408**: Timeout fetching content
- **507**: Local storage full