Skip to content

feat(solana-relay): host launched coin images and metadata on Audius - #90

Open
dylanjeffers wants to merge 1 commit into
mainfrom
feat/coin-images-to-audius
Open

feat(solana-relay): host launched coin images and metadata on Audius#90
dylanjeffers wants to merge 1 commit into
mainfrom
feat/coin-images-to-audius

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

The Irys → Audius coin migration (#eng thread). This is the piece that changes what new coins point at.

Before

launch_coin uploaded the logo to Irys/Arweave and the Metaplex metadata JSON alongside it. That meant a permanent Arweave dependency, a umi/Irys uploader per fee payer, a 5-minute SOL top-up loop, and metadata frozen at mint.

After

  • Logo uploads to an Audius content node. Mediorum's POST /uploads takes img_square with no signature, and stores image uploads synchronously — the response already carries the CID with status: done, so unlike audio there's nothing to poll for.
  • Metadata JSON is served by feat(api): serve Metaplex coin metadata from /v1/coins/:mint/metadata api#1030 at GET /v1/coins/:mint/metadata, built from the artist_coins row. Mediorum has no JSON template, so it couldn't be content-addressed without a go-openaudio release and a 24h fleet roll.

Drops @metaplex-foundation/umi, umi-bundle-defaults and umi-uploader-irys, the umi setup that existed only to drive Irys, and the top-up interval.

Existing coins

Untouched here. Their on-chain metadata stays on Arweave — it's immutable, which is the caveat Ray signed off on in the thread ("we basically do that for description anyway"). Their artist_coins.logo_uri is re-hosted by a script in artist-coins-scripts so the product renders from Audius.

Two things to look at

The metadata URL has a 404 window. artist_coins is written by the client's createCoin after confirmLaunchCoin, so the URL doesn't resolve until a few seconds after the pool lands. Worse, that call sits in a non-blocking try/catch — if it fails, the URL 404s forever. That failure already made a coin invisible in our product so it isn't a new failure mode, but it now also breaks wallet metadata. Probably worth retrying createCoin or moving it ahead of the pool tx, as a follow-up.

Lockfile is edited by hand. Running npm install rewrote all 50k lines (this repo is on lockfileVersion: 2, local npm is 11 and emits v3), so I removed just the three dependency entries from the apps/solana-relay workspace node. The transitive node_modules/@metaplex-foundation/* entries are still in the lock — harmless install bloat that a normal npm install on the team's npm version will prune.

Ordering

Needs AudiusProject/api#1030 live and AudiusProject/audius-k8s#519 applied before this image rolls. Without the k8s change the relay falls back to dev defaults and would bake an unroutable URL into permanent on-chain data.

Testing

5 tests on the upload helper: CID extraction, the results-map fallback, failover to the next host, upload-level errors, and all-hosts-failed. Typecheck and lint clean.

🤖 Generated with Claude Code

Coin logos went to Irys/Arweave and the Metaplex metadata JSON went with
them, which meant a permanent Arweave dependency, a SOL top-up loop per fee
payer, and metadata frozen at mint. Both now point at Audius:

- the logo uploads to a content node (mediorum accepts img_square uploads
  unsigned, and stores them synchronously, so there's nothing to poll for)
- the on-chain `uri` points at GET /v1/coins/:mint/metadata on the Audius
  API, which builds the document from the artist_coins row

Drops the Irys uploader, the umi setup that only existed to drive it, and
the 5-minute balance top-up interval.

Existing coins keep their Arweave on-chain metadata - that's immutable.
Their artist_coins.logo_uri is re-hosted separately by a backfill script.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant