diff --git a/server.py b/server.py
index 2f8792b..78f7ba2 100644
--- a/server.py
+++ b/server.py
@@ -2116,6 +2116,10 @@ async def ui_publish_cache(content_hash: str, request: Request):
if not origin or "type" not in origin:
return '
Set origin before publishing
'
+ # Get IPFS CID from cache item
+ cache_item = await database.get_cache_item(content_hash)
+ ipfs_cid = cache_item.get("ipfs_cid") if cache_item else None
+
# Call the L2 server from user's context
l2_server = ctx.l2_server
try:
@@ -2124,6 +2128,7 @@ async def ui_publish_cache(content_hash: str, request: Request):
headers={"Authorization": f"Bearer {token}"},
json={
"content_hash": content_hash,
+ "ipfs_cid": ipfs_cid,
"asset_name": asset_name,
"asset_type": asset_type,
"origin": origin,
@@ -2793,6 +2798,10 @@ async def publish_cache_to_l2(
if not origin or "type" not in origin:
raise HTTPException(400, "Origin must be set before publishing. Use --origin self or --origin-url ")
+ # Get IPFS CID from cache item
+ cache_item = await database.get_cache_item(content_hash)
+ ipfs_cid = cache_item.get("ipfs_cid") if cache_item else None
+
# Get auth token to pass to L2
token = request.cookies.get("auth_token")
if not token:
@@ -2812,6 +2821,7 @@ async def publish_cache_to_l2(
headers={"Authorization": f"Bearer {token}"},
json={
"content_hash": content_hash,
+ "ipfs_cid": ipfs_cid,
"asset_name": req.asset_name,
"asset_type": req.asset_type,
"origin": origin,