8

You can send files to Infura's IPFS servers but I don't know about the limits.

How long is it stored for?

What's the size limit?

7
  • I see some people voted to close this question. I am wondering what is the reason for it Commented Apr 25, 2018 at 9:27
  • I checked and it seems to be offtopic, however there are tags specifically for "infura" and "ipfs" so does that mean the tags are offtopic also? Commented Apr 25, 2018 at 9:52
  • I voted to close the question - Infura and IPFS are third-party products. If you had asked how to use them with Ethereum or something like that it would've been ok. Well, this is just my opinion, that's why these are being voted on. I'd also say the tags are ok if used in a scenario which I just described. Commented Apr 25, 2018 at 12:30
  • When I post about IPFS I am told it is off-topic. Double standards are great. Commented May 8, 2018 at 6:40
  • 1
    @TrevorOakley I read the comment and I agree it makes sense. Infura is a 3rd party and probably the question should be removed. However Infura and IPFS are very often used with Ethereum and while the question is not about Ethereum specifically, it is very closely related to it. Commented May 8, 2018 at 8:11

4 Answers 4

5

Got a reply from an Infura member.

At the moment if you pin objects on their nodes they won't be removed. Unpinned objects are garbage collected when the data store needs to reclaim space.

File size is not explicitly limited but you might encounter gateway timeout for very large files.

3

While developing a dApp using the infura gateway to ipfs we noticed that files are being removed after ~2 weeks.

I also just did some research there and am pretty sure that I read exactly that somewhere but I can't seem to find the resource anymore...

To overcome the issue of files being removed you can just regularly pin them on a local node to keep them up.

Unfortunately I have no info about file sizes.

3
  • 1
    If you pin your file at Infura's IPFS endpoint, it won't be removed.
    – Maurycy
    Commented May 25, 2018 at 7:22
  • Maybe I am doing something wrong - but for us Files unfortunately disappear Commented May 25, 2018 at 7:25
  • In that case, please file a ticket infura.io/support/ticket
    – Maurycy
    Commented May 25, 2018 at 8:30
1

Just adding more to the answer by @kai-kälberer.

I recommend using the ipfs-mini javascript library when writing to ipfs. They have automatic pinning built in, which will allow your ipfs files to persist longer.

Here is a code example of Reading and Writing to IPFS supported by Infura.

import IPFS from 'ipfs-mini'
import isString from 'lodash/fp/isString'

const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' })

export async function ipfsGetData (multihash) {
  if (!isString(multihash)) {
    return new Error('multihash must be String')
  } else if (!multihash.startsWith('Qm')) {
    return new Error('multihash must start with "Qm"')
  }

  return new Promise((resolve, reject) => {
    ipfs.catJSON(multihash, (err, result) => {
      if (err) reject(new Error(err))
      resolve(result)
    })
  })
}

export async function ipfsAddObject (obj) {
  const CID = await new Promise((resolve, reject) => {
    ipfs.addJSON(obj, (err, result) => {
      if (err) reject(new Error(err))
      resolve(result)
    })
  })
  console.log('CID:', CID)
  return CID
}
1

According to this recent post by Infura on September 23, 2020: https://blog.infura.io/part-2-getting-started-with-ipfs-on-infura/

Data is currently pinned until it’s been 6 months since it was last used, so as long as you’re accessing your data within that time frame, it’ll be there for you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.