From aea2c17665513583f1a860182c3ebb6f8b93643a Mon Sep 17 00:00:00 2001 From: Yondon Fu Date: Tue, 13 Dec 2022 15:52:31 -0500 Subject: [PATCH 1/2] task/upload: Remove IPFS prefix handling Let Catalyst handle ipfs:// URLs --- task/upload.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/task/upload.go b/task/upload.go index 8ace3c15..59ba7ed0 100644 --- a/task/upload.go +++ b/task/upload.go @@ -121,13 +121,6 @@ func getFileUrl(os *api.ObjectStore, cfg ImportTaskConfig, params api.UploadTask return "", fmt.Errorf("no URL or uploaded object key specified") } - if strings.HasPrefix(params.URL, IPFS_PREFIX) { - cid := strings.TrimPrefix(params.URL, IPFS_PREFIX) - if len(cfg.ImportIPFSGatewayURLs) == 0 { - return "", fmt.Errorf("no IPFS gateways configured") - } - return cfg.ImportIPFSGatewayURLs[0].JoinPath(cid).String(), nil - } if strings.HasPrefix(params.URL, ARWEAVE_PREFIX) { txID := strings.TrimPrefix(params.URL, ARWEAVE_PREFIX) // arweave.net is the main gateway for Arweave right now From cc66a738050883d06ebed9f7fbca0539974f84ab Mon Sep 17 00:00:00 2001 From: Yondon Fu Date: Tue, 13 Dec 2022 15:52:56 -0500 Subject: [PATCH 2/2] cmd/task-runner: Add deprecation comment for import IPFS --- cmd/task-runner/task-runner.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/task-runner/task-runner.go b/cmd/task-runner/task-runner.go index 521b539c..0ea5ed92 100644 --- a/cmd/task-runner/task-runner.go +++ b/cmd/task-runner/task-runner.go @@ -100,6 +100,7 @@ func parseFlags(build BuildFlags) cliFlags { fs.StringVar(&cli.runnerOpts.PinataAccessToken, "pinata-access-token", "", "JWT access token for the PiƱata API") URLVarFlag(fs, &cli.runnerOpts.PlayerImmutableURL, "player-immutable-url", "ipfs://bafybeihcqgu4rmsrlkqvavkzsnu7h5n66jopckes6u5zrhs3kcffqvylge/", "Base URL for an immutable version of the Livepeer Player to be included in NFTs metadata") URLVarFlag(fs, &cli.runnerOpts.PlayerExternalURL, "player-external-url", "https://lvpr.tv/", "Base URL for the updateable version of the Livepeer Player to be included in NFTs external URL") + // TODO(yondonfu): Deprecate once the import task is no longer used because Catalyst will handle import from IPFS URLSliceVarFlag(fs, &cli.runnerOpts.ImportIPFSGatewayURLs, "import-ipfs-gateway-urls", "https://w3s.link/ipfs/,https://ipfs.io/ipfs/,https://cloudflare-ipfs.com/ipfs/", "Comma delimited ordered list of IPFS gateways (includes /ipfs/ suffix) to import assets from") // Server options