5

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?

  • I see some people voted to close this question. I am wondering what is the reason for it – cleanunicorn Apr 25 '18 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? – cleanunicorn Apr 25 '18 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. – Lauri Peltonen Apr 25 '18 at 12:30
  • When I post about IPFS I am told it is off-topic. Double standards are great. – Trevor Oakley May 8 '18 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. – cleanunicorn May 8 '18 at 8:11
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.

  • If you pin your file at Infura's IPFS endpoint, it won't be removed. – Maurycy May 25 '18 at 7:22
  • Maybe I am doing something wrong - but for us Files unfortunately disappear – Kai Kälberer May 25 '18 at 7:25
  • In that case, please file a ticket infura.io/support/ticket – Maurycy May 25 '18 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
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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