Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda