js-ipfs icon indicating copy to clipboard operation
js-ipfs copied to clipboard

The CID obtained by the ipfs.add(data, [options]) function got "504 Gateway Time-out"

Open LouisLiu00 opened this issue 2 years ago • 1 comments

  • Version: "ipfs-core": "^0.15.4",
  • Platform: Windows10 + Chrome + Node.js + Vue3.x
  • Subsystem: ipfs-core

Severity: High

Description: I'm learning ipfs-core API. I get a CID via ipfs.add(data, [options]) but I get "504 Gateway Time-out" in browser access. How can I create the json data at the same time and put it in the specified directory?

Below is my code:

let ipfs = await this.$ipfs.create(); let metadata = { "description": "Hello IPFS, I'm Louis from China.", "image": "ipfs://QmTh7cULTdCrPQkzKBMXzLuZwjQFXp4c3TAJ6dAxR64PJP", "name": "Louis", "collection": "Louis's Album" }

const param = { path: '/myfile/1', content: JSON.stringify(metadata), }

const result = await ipfs.add(param);

console.info(result) console.info(result.cid) console.info(result.cid.path) console.info(result.cid.toString())

if(ipfs.isOnline()) { ipfs.stop(); }

Steps to reproduce the error:

LouisLiu00 avatar Aug 29 '22 09:08 LouisLiu00

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

welcome[bot] avatar Aug 29 '22 09:08 welcome[bot]

js-IPFS is in the process of being deprecated, the replacement is Helia - please see the State of IPFS in JS post for a bit of background and the migration guide for how to port your app over.

In order for the gateway to show data from your node it must be dialable from the public internet.

Are you able to use the https://ipfs-check.on.fleek.co/ website to confirm your node is routable from outside of your network?

achingbrain avatar May 22 '23 15:05 achingbrain