'use strict';
const ipfsClient = require('ipfs-http-client')
const ipfs = ipfsClient.create({host:'172.29.3.95' , port:'5001', protocol:'http'});



const uploadFile =async (file)=>{
  console.log("submit file to ipfs")
  const  fileadded=await ipfs.add(file)
  //const fileadded = await client.add(file)
  if(fileadded.path!='')
  return fileadded.path
  else
  console.log("could not upload the file to ipfs")

}