Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
IPFS .cat() method doesn’t return the content

I work with JavaScript and Browserify tool in Windows 10. With Browserify, One can require NodeJS modules on browser side. I required ipfs module for my JavaScript code in a .js file then browserfied that. In my application, IPFS gets the content and adds it with .add() method in browser side. After that, It gives me the related CID. I try to get the main content from server side via NodeJS. So, I try .cat() method on a .js file and run NodeJS by PowerShell. Problem is here. By this way, No content returned to me. I don’t know why.

The JavaScript code that browserified by Browserify:

const IPFS=require(“ipfs”);
.
.
.
const peer=await IPFS.create({host:“localhost”,port:5001,protocol:“http”});
peer.add().then(function(data){
window.alert(data.path)";
});

I copied the alerted result and pasted that on .cat() method that is below:

async function getFromIPFS(){
    const peer=await IPFS.create({host:“localhost”,port:5001,protocol:“http”});
    const flow=peer.cat();
    let mainContent="";
    for await(const chunk of flow){
    mainContent+=chunk.toString();
    }
    console.log(mainContent);
}

This function called in NodeJS. When I run the NodeJS, The below result emerges on PowerShell:

enter image description here

As you can see, No content returned. What is the problem? How can fix it?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda