{"id":19892060,"url":"https://github.com/k0yote/migrate-metadata","last_synced_at":"2026-04-24T12:03:10.282Z","repository":{"id":183669211,"uuid":"670394502","full_name":"k0yote/migrate-metadata","owner":"k0yote","description":"Migrate from a centralized nft metadata distribution to an ipfs with thirdweb library","archived":false,"fork":false,"pushed_at":"2023-07-25T10:03:34.000Z","size":6560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T05:26:46.793Z","etag":null,"topics":["golang","ipfs","metadata","nft","thirdweb"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k0yote.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-25T00:55:01.000Z","updated_at":"2023-07-25T09:46:15.000Z","dependencies_parsed_at":"2023-07-25T11:45:11.466Z","dependency_job_id":null,"html_url":"https://github.com/k0yote/migrate-metadata","commit_stats":null,"previous_names":["k0yote/migrate-metadata"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/k0yote/migrate-metadata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0yote%2Fmigrate-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0yote%2Fmigrate-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0yote%2Fmigrate-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0yote%2Fmigrate-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0yote","download_url":"https://codeload.github.com/k0yote/migrate-metadata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0yote%2Fmigrate-metadata/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260424782,"owners_count":23007044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","ipfs","metadata","nft","thirdweb"],"created_at":"2024-11-12T18:21:12.091Z","updated_at":"2026-04-24T12:03:05.251Z","avatar_url":"https://github.com/k0yote.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migrate Metadata\nクラウドストレージにあるNFTメタデータを分散ストレージへ移行\n\n## Prerequisites\n- [Nodejs](https://nodejs.org/ja)\n- [thirdweb API Key](https://portal.thirdweb.com/api-keys)\n\n## マイグレーションを行う。\n1. メタ情報とイメージをローカルにダウンロードする\n（メタデータ中に定義されているimageのURLからダウンロード）\n```json\n{\n  \"description\": \"Friendly OpenSea Creature that enjoys long swims in the ocean.\", \n  \"external_url\": \"https://openseacreatures.io/3\", \n  \"image\": \"https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png\", \n  \"name\": \"Dave Starbelly\",\n  \"attributes\": [ ... ]\n}\n```\n2. ダウンロードしたイメージをIPFSストレージにアップロードする\n※今回はthirdwebが提供している以下の２つライブラリーを用いて行いました。\n\n- `https://www.npmjs.com/package/thirdweb`\n- `go get github.com/thirdweb-dev/go-sdk/v2/thirdweb`\n\n## Help\n```shell\n./bin/meta-converter -h                                                                                                                                \nflag needs an argument: -h\nUsage of ./bin/meta-converter:\n  -eTokenID int\n    \tfinish to NFT TokenID (default 1)\n  -h string\n    \tMetadata API Base URL (default \"https://metadata.baseUrl/xxxxx/\")\n  -image-outdir string\n    \tImages output folder name (default \"images\")\n  -meta-outdir string\n    \tMetadata output folder name (default \"metadata\")\n  -sTokenID int\n    \tstart from NFT TokenID (default 1)\n\n```\n\n\n## 実行\n0. npm install\n1. 以下を実行し、メタデータとイメージをダウンロードする\n    ```shell\n    ./bin/meta-converter -h {メタが取れるAPIベースURL} -sTokenID 開始トークンID -eTokenID 終了トークンID\n    ```\n\n    ```shell\n    ## 実行ログからipfsのcid確認ができる\n    ipfs response : {Image:ipfs://jiorjoiiojgojdfogjdf/0}\n    ipfs response : {Image:ipfs://jiorjoiiojgojdfogjdf/0}\n    ipfs response : {Image:ipfs://jiorjoiiojgojdfogjdf/0}\n    ipfs response : {Image:ipfs://jiorjoiiojgojdfogjdf/0}\n    ipfs response : {Image:ipfs://jiorjoiiojgojdfogjdf/0}\n    ```\n2. 1.を実行するとmetadata / imagesフォルダにそれぞれメタデータjsonファイルと画像がダウンロードされていてる\n3. メタデータのimageが既にipfsのURLに書きかわってる\n4. 最後メタデータをアップロードする\n    ```shell\n    ## thirdwebのAPIシークレットキーを要求されるので事前にAPIキーを生成しておく\n    npx thirdweb@latest upload metadata\n    ```\n\n    ```shell\n    ## 正常に実行された例\n    ✔ Successfully uploaded directory to IPFS\n    ✔ Files stored at the following IPFS URI: ipfs://joewiurefdjasf\n    ✔ Open this link to view your upload: https://{client-id}.ipfscdn.io/ipfs/joewiurefdjasf/\n    ```\n \n 5. 4.取得したURLだとthirdweb側の制限があるのでパブリックでは確認できないため、public gatewayに変更して`https://ipfs.io/ipfs/joewiurefdjasf/`をスマートコントラクトのベーストークンURIを更新\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0yote%2Fmigrate-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0yote%2Fmigrate-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0yote%2Fmigrate-metadata/lists"}