(this is an off-repo issue -> will move to its own repo probably)
Bazaar uses IPFS to distribute shop metadata and images. The chain only stores one IPFS hash per Shop/Article. Content is usually created on mobile where it can't be hosted because mobile devices go offline and have limited battery capacity.
System components:
mobile phone running encointer wallet app and publishing/querying content
centralized web interface for browsing Bazaar. read only (scans chain for Shops/Articles and fetches content from IPFS)
pinning service
centralized, (content publishers must have account with i.e. https://pinata.cloud)
unpermissioned/unmetered:
mobile phone runs full IPFS node and publishes locally (temporarily and with possible interruptions)
a Bazaar-Pinner listens to Shop/Article updates onchain and pins all IPFS content linked within (recursively: json and links within json, i.e. images)
community-run, not incentivized to store content (assumed to be paid for by onchain fees to register Shops/Articles)
BazaarPinner
use substrate-api-client to write a Rust service reading ShopRegistry and ArticleRegistry and listening to events for new entries
run an IPFS node and use api with rust-ipfs to fetch/pin all IPFS hashes that are registered onchain (=> json files).
parse all json metadata files and fetch/pin all IPFS hashes mentioned within (up to a configurable max size and max number of files ...mitigate attack vector)
optional: expose API for app to publish content to IPFS (attack vector!)
temporarily cache such content for a few minutes. only pin permanently if registered onchain within a specified delay.
optional: garbage collection: unpin content that is removed from chain or has outlived its time-to-live.
(this is an off-repo issue -> will move to its own repo probably)
Bazaar uses IPFS to distribute shop metadata and images. The chain only stores one IPFS hash per Shop/Article. Content is usually created on mobile where it can't be hosted because mobile devices go offline and have limited battery capacity.
System components:
BazaarPinner