HashLips / hashlips_art_engine

HashLips Art Engine is a tool used to create multiple different instances of artworks based on provided layers.
MIT License
7.17k stars 4.3k forks source link

Not able to update IPFS cid into Metadata #736

Open ArtistanVillage opened 2 years ago

ArtistanVillage commented 2 years ago

Hello, I am using hashlips_art_engine-1.1.2_patch_v5, I have sucessfully generated the art and Metadata as well, Uploaded Images on the IPFS through Pinata. Got CID. As per this version I am giving command as node utils/update_info.js, The command result throws no error, It get successful but CID is not reflecting in Json file. When I investigated deeper into the issue then I found that in main.js row 136 is file_url: ${baseUri}/${_edition}.png and in _metadata.json after name and description instead of image it's showing as "file_url" and problem lies here. When downloaded the src file then in main.js it was showing as image: ${baseUri}/${_edition}.png, how come it got changed to file_url.

Also after giving command node utils/update_info.js , file_url: ${baseUri}/${_edition}.png after name and description is not getting changed but something is getting added in metadata at the very end of image json file it's showing as image: ipfs://xxxxxxxxx (Real cid number which I changed in config.js)

Also after giving command utils/update_info.js an extra unwanted metadata json file name undefined.json is getting created and in _metdata.json file instead of showing the individual json file name, against each image undefined file name is reflecting.

I am not sure if I am able to put forward the question correctly. But this is what is happening. Please help.

Also does this makes any difference whether IPFS cid is updated under image or file_url ?

Cem802 commented 2 years ago

Hey, I had the same problem. I also changed file_url to image, but it still didn't update. After a long time doing research, looking more detailed into the code, I think I found the problem. You need to change in update_info.js ${item.edition} with ${item.custom_fields.edition}. This worked for me. Hope I was helpful and you understood what I mean.

ebonylady commented 2 years ago

Hello, I am using hashlips_art_engine-1.1.2_patch_v5, I have sucessfully generated the art and Metadata as well, Uploaded Images on the IPFS through Pinata. Got CID. As per this version I am giving command as node utils/update_info.js, The command result throws no error, It get successful but CID is not reflecting in Json file. When I investigated deeper into the issue then I found that in main.js row 136 is file_url: ${baseUri}/${_edition}.png and in _metadata.json after name and description instead of image it's showing as "file_url" and problem lies here. When downloaded the src file then in main.js it was showing as image: ${baseUri}/${_edition}.png, how come it got changed to file_url.

Also after giving command node utils/update_info.js , file_url: ${baseUri}/${_edition}.png after name and description is not getting changed but something is getting added in metadata at the very end of image json file it's showing as image: ipfs://xxxxxxxxx (Real cid number which I changed in config.js)

Also after giving command utils/update_info.js an extra unwanted metadata json file name undefined.json is getting created and in _metdata.json file instead of showing the individual json file name, against each image undefined file name is reflecting.

I am not sure if I am able to put forward the question correctly. But this is what is happening. Please help.

Also does this makes any difference whether IPFS cid is updated under image or file_url ?

please have you been able to correct this am having the same issue and cant seems to get past it.

ArtistanVillage commented 2 years ago

I tried all the methods, It's not working :-(

ArtistanVillage commented 2 years ago

Hello, I am using hashlips_art_engine-1.1.2_patch_v5, I have sucessfully generated the art and Metadata as well, Uploaded Images on the IPFS through Pinata. Got CID. As per this version I am giving command as node utils/update_info.js, The command result throws no error, It get successful but CID is not reflecting in Json file. When I investigated deeper into the issue then I found that in main.js row 136 is file_url: ${baseUri}/${_edition}.png and in _metadata.json after name and description instead of image it's showing as "file_url" and problem lies here. When downloaded the src file then in main.js it was showing as image: ${baseUri}/${_edition}.png, how come it got changed to file_url. Also after giving command node utils/update_info.js , file_url: ${baseUri}/${_edition}.png after name and description is not getting changed but something is getting added in metadata at the very end of image json file it's showing as image: ipfs://xxxxxxxxx (Real cid number which I changed in config.js) Also after giving command utils/update_info.js an extra unwanted metadata json file name undefined.json is getting created and in _metdata.json file instead of showing the individual json file name, against each image undefined file name is reflecting. I am not sure if I am able to put forward the question correctly. But this is what is happening. Please help. Also does this makes any difference whether IPFS cid is updated under image or file_url ?

please have you been able to correct this am having the same issue and cant seems to get past it.

I tried all the methods, It's not working :-(

cryptocraig-nft commented 2 years ago

Hi, I've been having the same issue. I have no idea but maybe this info could give someone with more coding knowledge a clue? I thought I'd try an earlier version, I ran a test and it worked. When I then produce my own artwork this is when the problem occurs. This makes me think it's not an issue with (main.js row 136 is file_url: ${baseUri}/${_edition}.png).

I believe it's when generating your own artwork, this is somehow causing the issue.

Someone please find the answer! ;)

Eluwsive commented 2 years ago

@Cem802 That worked but it replaced everything but the "file_url"

jone3fingers commented 2 years ago

I have the same issue, but last time I did any coding was almost 35 years ago. The issue is with "edition" the edition is put into all of the original metadata, but it is not being retrieved when called under the item loop. If you can figure out how to get that part working changing file url is easy just change this line item.image = ${baseUri}/${item.edition}.png; item.file_url ='${baseUri}/${item.edition}.png';

bolshoytoster commented 2 years ago

@jone3fingers

just change this line item.image = `${baseUri}/${item.edition}.png`; item.file_url ='${baseUri}/${item.edition}.png';

Using backticks means the variables will be inserted within the ${}s. Using normal quotes means it's interpretedas a literal string.

I don't think this is the solution.

jone3fingers commented 2 years ago

I did this as a workaround. It makes a 0.json but 1.json is a duplicate. not sure how to fix that but deleting a file is an easy fix

var itemnumber = 0

data.forEach((item) => { item.name = ${namePrefix} #${itemnumber}; item.description = description; item.file_url = ${baseUri}/${itemnumber}.png; item.image = ${baseUri}/${itemnumber}.png; fs.writeFileSync(${basePath}/build/json/${itemnumber}.json,JSON.stringify(item, null, 2)); itemnumber++; });

The _metadata was off with it at set at 0. so after running at 0 I ran it again starting at 1 and then deleted 0.json

@bolshoytoster I am not sure where the quotes came from I just copied and pasted from one of the codes

jone3fingers commented 2 years ago

just doubled checked my working code it does have quotes what I pasted above doesnt show the quotes but they are name file_url, and image also on the fs write

ArtistanVillage commented 2 years ago

I have found the key issue, most of us are not coders. That's number one, Other thing is we are using Hashlips art engine but somehow botched up because of few modifications suggested by Codestack and here the problem lies. Now the simple solution is without wasting much of our time we should deleted all the previous versions from our system, start a fresh by downloading the latest version of art engine and follow simple steps suggested by hashlips. It will certainly work.

jone3fingers commented 2 years ago

That is how I started. It didn’t work. It never updated the URL correctly on json files

jone3fingers commented 2 years ago

Run in the same issue on making preview. The code even has note not to trust edition I added index+1 instead of edition and it works

await loadImage(${buildDir}/images/${index+1}.png).then((image) => {

ASLE90 commented 1 month ago

مرحبًا، أنا أستخدم hashlips_art_engine-1.1.2_patch_v5، وقد نجحت في إنشاء الأعمال الفنية والبيانات الوصفية أيضًا، وحملت الصور على IPFS من خلال Pinata. حصلت على CID. وفقًا لهذا الإصدار، أعطي الأمر كـ node utils/update_info.js، ولا تظهر نتيجة الأمر أي خطأ، لقد نجح الأمر ولكن CID لا ينعكس في ملف Json. عندما بحثت بعمق في المشكلة، وجدت أنه في main.js الصف 136 هو file_url: ${baseUri}/${_edition}.pngوفي _metadata.json بعد الاسم والوصف بدلاً من الصورة، يظهر على أنه "file_url" وتكمن المشكلة هنا. عند تنزيل ملف src ثم في main.js كان يظهر على أنه image: ${baseUri}/${_edition}.png، كيف تم تغييره إلى file_url.

أيضًا بعد إعطاء الأمر node utils/update_info.js، file_url: ${baseUri}/${_edition}.pngبعد عدم تغيير الاسم والوصف، ولكن تتم إضافة شيء ما في البيانات الوصفية في نهاية ملف json للصورة، حيث يتم عرضه كصورة: ipfs://xxxxxxxxx (رقم cid الحقيقي الذي غيرته في config.js)

أيضًا بعد إعطاء الأمر utils/update_info.js يتم إنشاء ملف بيانات تعريفية غير مرغوب فيه إضافي باسم json undefined.json وفي ملف _metdata.json بدلاً من عرض اسم ملف json الفردي، يتم عكس اسم الملف غير المحدد مقابل كل صورة.

لست متأكدًا من قدرتي على طرح السؤال بشكل صحيح. لكن هذا ما يحدث. الرجاء المساعدة.

هل يحدث هذا أيضًا أي فرق سواء تم تحديث IPFS cid ضمن image أو file_url؟ https://github.com/HashLips/hashlips_art_engine/issues/736#issue-1134647702