How to setup ipfs on node or in anular app using aws ec2 instance kubo setup

28 Views Asked by At

I setup ipfs on AWS-ec2 using kubo v25, now I used ipfs-mini on nodejs to access the AWS ec2 and I added the our AWS ec2 public API and also opened the security groups 5001 and 8080, it didn'work shows connection refused? on aws Daemon is up and running

import IPFS from "ipfs-mini";

const ipfs = new IPFS({ host: 'aws-public-ip', port: 5001, protocol: 'http'})

ipfs.add("fileBuffer", (err, result) => {
    if (err) {
      console.error('Error uploading file to IPFS:', err);
    } else {
      const cid = result;
      console.log('File uploaded to IPFS with CID:', cid);
      // You can use this CID to retrieve the file or share it with others
    }
  });

error: Error uploading file to IPFS: Error: [ipfs-mini] status 0: Error: connect ECONNREFUSED aws-public-ip:5001

0

There are 0 best solutions below