Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: dual-pin IPFS content to oven seeder for faster gateway propagation

After pinning to local IPFS on lith, fire-and-forget pin to oven's IPFS
node (2400+ peers) for much better public gateway discoverability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+11 -1
+11 -1
system/netlify/functions/keep-prepare-background.mjs
··· 367 367 && piece?.ipfsMedia?.sourceHash === hashSource(piece.source); 368 368 } 369 369 370 - // ─── IPFS Upload (self-hosted Kubo node on lith) ───────────────────────────── 370 + // ─── IPFS Upload (self-hosted Kubo node on lith + oven seeder) ─────────────── 371 371 const IPFS_API = process.env.IPFS_API_URL || "http://localhost:5001"; 372 + const IPFS_SEEDER_URL = process.env.IPFS_SEEDER_URL || "http://137.184.237.166:5001"; 373 + 374 + // Seed content to the oven IPFS node (fire-and-forget for faster gateway propagation) 375 + function seedToSecondaryNode(hash) { 376 + fetch(`${IPFS_SEEDER_URL}/api/v0/pin/add?arg=${hash}`, { method: "POST", signal: AbortSignal.timeout(120000) }) 377 + .then(r => r.ok ? console.log(`🌱 Seeded ${hash.slice(0, 12)}... to oven`) : null) 378 + .catch(() => {}); // Best-effort, don't block pipeline 379 + } 372 380 373 381 async function uploadToIPFS(content, filename, mimeType, timeoutMs = 90000) { 374 382 const formData = new FormData(); ··· 384 392 clearTimeout(timeout); 385 393 if (!res.ok) throw new Error(`IPFS upload failed: ${res.status}`); 386 394 const result = await res.json(); 395 + seedToSecondaryNode(result.Hash); 387 396 return formatIpfsUri(result.Hash); 388 397 } catch (err) { 389 398 clearTimeout(timeout); ··· 407 416 clearTimeout(timeout); 408 417 if (!res.ok) throw new Error(`Metadata upload failed: ${res.status}`); 409 418 const result = await res.json(); 419 + seedToSecondaryNode(result.Hash); 410 420 return formatIpfsUri(result.Hash); 411 421 } catch (err) { 412 422 clearTimeout(timeout);