I'm trying to create an IPFS peer to peer chat app using Node.JS.
The app starts up fine and prints the swarm listening message below.
generating Ed25519 keypair...
to get started, enter:
jsipfs cat /ipfs/QmRaaUwTNfwgFZpeUy8qrZwrp2dY4kCKmmB5xEqvH3vtD1/readme
Swarm listening on /ip4/127.0.0.1/tcp/4001/p2p/12D3KooWHhYJfffDFDLkeAhorvmtActm7YZoSn85xFATjkJ1MvVu
Swarm listening on /ip4/172.31.192.1/tcp/4001/p2p/12D3KooWHhYJfffDFDLkeAhorvmtActm7YZoSn85xFATjkJ1MvVu
However, when I try to run the command jsipfs cat /ipfs/QmRaaUwTNfwgFZpeUy8qrZwrp2dY4kCKmmB5xEqvH3vtD1/readme, as instructed, I get the message.
ENOENT: no such file or directory, open 'C:\Users\hp\.jsipfs\blocks\LD\CIQDAJDJUBQWF7DOSHH3BQCDZTRVMK2ZSBADNOTKYLZHXDBMVQOMLDA.data'
Could you please help me spot where the problem is?
Did I set the repo wrong?
Thanks in advance!
const express = require('express');
const app = express();
const IPFS = require('ipfs')
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
const ipfs = IPFS.create({
repo: repo(),
EXPERIMENTAL: {
pubsub: true
},
config: {
Addresses: {
Swarm: [
'/ip4/0.0.0.0/tcp/4001'
],
API: "/ip4/127.0.0.1/tcp/5001",
Gateway: "/ip4/127.0.0.1/tcp/8080"
}
}
});
function repo () {
return 'ipfs_' + Math.random()
}
app.listen(6500, ()=>{
console.log('App listening on Port 6500');
});