Decentralized Module Update Service Rev1
Motivation
Since https://github.com/filecoin-station/core/pull/316, Station Core is keeping its Zinnia module sources up to date by fetching most current versions on a fixed loop. It does this by asking the GitHub API for the latest tag of the module, and then fetching the release tarball if its newer than the last seen latest tag.
Operators have since complained in #station on Filecoin slack, that GitHub is inaccessible in certain locations, and they would need an update solution that doesn’t rely on GitHub.
Centralized suggestion
The first idea was to create a new service, that sits in front of the GitHub API, refreshes its state periodically, and serves the tarballs. In order not to get rate limiting problems, Cloudflare sits in front of the service and caches responses indefinitely.
This has drawbacks:
- The update service becomes a single point of failure
- The team needs to pay for hosting, Cloudflare
- The team needs to perform DevOps
Decentralized approach
Instead, use IPNS for tracking references (CIDs) to the last version of a module, and store module sources on IPFS. IPNS will initially be provided by w3name and IPFS by web3.storage.
Publish
sequenceDiagram
participant a as GitHub Action
participant w as web3.storage
participant n as w3name
a ->> w: upload module CAR
w ->> a: return CID
a ->> n: update IPNS (module -> CID)Update / Get Latest Version
sequenceDiagram
participant s as Station Core
participant n as w3name
participant w as web3.storage
s ->> n: get CID for module
s ->> w: download source from CIDComponents
GitHub Action
- configured secrets:
W3NAME_SIGNING_KEY
WEB3_STORAGE_*
- activates when a new git tag is created
- downloads release tarball
- uploads release tarball to
web3.storageusing their JS API
- remembers the returned CID
- publishes a new
moduleversion tow3name, with the CID as the value
Station Core
- Uses https://github.com/web3-storage/w3name/blob/main/packages/client/README.md to get latest CID for every module registered
- If the returned CID is different from the last seen one, update using the
web3.storagepublic gateway (with validation)