Questions tagged [js-ipfs]

The JavaScript implementation of the IPFS (InterPlanetary File System) protocol.

IPFS logo

The InterPlanetary File System is a hypermedia distribution protocol, addressed by content and identities. It enables the creation of completely distributed applications.

IPFS aims to make the web faster, safer, and more open by connecting all computing devices with the same system of files.

js-ipfs provides a library which enables users to spin up full IPFS nodes from JavaScript. It runs in the command line, or in the browser.

Latest release of js-ipfs is 0.54.4. Read more about the latest release at https://github.com/ipfs/js-ipfs/releases

js-ipfs documentation: https://github.com/ipfs/js-ipfs/tree/master/docs

95 questions
1
vote
0 answers

JS-IPFS preload error client.js:12 WebSocket connection to 'wss://node3.preload.ipfs.io/p2p/

Hello I have an issue with preload p2p wss from js-ipfs defaults. Normally everything works perfectly, but defaults goes wrong. client.js:12 WebSocket connection to 'wss://node3.preload.ipfs.io/p2p/QmY7JB6MQXhxHvq7dBDh4HpbH29v4yE9JRadAVpndvzySN'…
Uland Nimblehoof
  • 862
  • 17
  • 38
1
vote
1 answer

ipfs.name.publish command in js-ipfs not working, throwing error

I am working with js-ipfs and want to use the publish functionality of IPFS. Given below is the code let result = await ipfs.add("hello"); const ipns_hash = await ipfs.name.publish('/ipfs/'+result.cid) console.log(ipns_hash) I referred the offcial…
Roviostar
  • 23
  • 2
1
vote
1 answer

What is the use of key API in IPFS Core APIs?

I am working on a project with JS implementation of IPFS. I want to upload multiple websites. While going through the official documentation of IPFS Core APIs, under example section of ipfs.name.publish I found a line which says "If you want to have…
Roviostar
  • 23
  • 2
1
vote
1 answer

how do i create directory with ipfs-http-client with infura gateway?

Trying to create a directory with infura. this is from the docs but it does not work... const run = async () => { const projectId = 'xxx'; const projectSecret = 'xxx'; const auth = 'Basic ' + Buffer.from(projectId + ':' +…
Muhammad Ahmod
  • 649
  • 4
  • 15
1
vote
0 answers

The system cannot find the path specified when I run npm start command in visual code studio

Whenever I run the command npm start I got below error. Please, help regarding this. The system cannot find the path specified. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! example-browser-browserify@1.0.0 build: copyfiles -u 1 -a…
1
vote
0 answers

How to import IPFS in svelte?

I'm trying to import the ipfs like "import {create} from 'ipfs'" but is not working it gives me error like upon using the package "ipfs-http-client" import { create } from 'ipfs-http-client' what is the solution for this? I'm using svelte v3.0…
1
vote
0 answers

JS-IPFS API doesn't work well when I use Ipfs.cat

I try to use js-ipfs. First I import ipfs using CDN. When I try ↓ this code, it worked well. async function main (){ const ipfs = await Ipfs.create() const cid = await…
MeRRy
  • 11
  • 1
1
vote
0 answers

Get streaming stats for each node inside IPFS cluster?

I'm using ipfs for video files storage and streaming , inside the cluster there are 4 nodes by now and anyone can join the cluster as ipfs node and can provide streaming for rewards. I need the information that how we can calculate streaming…
Omar
  • 145
  • 1
  • 1
  • 9
1
vote
0 answers

how to recover image or other file from ipfs?

I have a cid returned by ipfs.add api, and i want get the file(image) but i can't restore the picture even i can get the Uint8Array, and I have read the api docs, but i still can't get it. I want to know how to manipulate data to recover my picture…
1
vote
0 answers

Determining the CID of larger (> 256KB) files

I'm setting up a repo to be used in projects where CID (related) data needs to be transacted on-chain and where I'm following a work-flow of: 1.) Establishing the CID data; 2.) Transacting said data; 3.) Publishing/Importing data in to IPFS after a…
1
vote
0 answers

Js-IPFS Error: cid.toBaseEncodedString() is not a function

I'm currently working on the backend of a website that would work similar to YouTube but only use IPFS for storage, meaning if you want to "upload" videos to the site it would already have to be on the IPFS network. The actual function is more of an…
PyKestrel
  • 11
  • 3
1
vote
1 answer

IPFS in browser: testing a simple file fetch

I want to download this file and print its contents to the console using an in-browser IPFS node. The following html file should do the job:
BnMcGn
  • 1,440
  • 8
  • 22
1
vote
1 answer

Maximum callstack exceeded in IPFS app. When IPFS API calls made twice in a row

I have one GET request at first to retrieve a data structure. Then I perform some changes and perform a PUT request to send the data structure to the server and update the record. When I click the submit button on the on the first form it works as…
1
vote
1 answer

IPFS: base64-encoded image not showing as image

I have a simple function that tries to base64-encode an image and upload it to IPFS: async function toIPFS() { const node = await IPFS.create() const data = fs.readFileSync('./src/assets/logo.png', 'base64').toString('base64') const results =…
ilmoi
  • 1,994
  • 2
  • 21
  • 45
1
vote
0 answers

ipfs.cat() returns Promise {} even though I follow the example

This is the getFile function I wrote. Using it-to-buffer to access file chunks. async function getFile(cid){ let content = await toBuffer(client.cat(cid)); return content; } const getFileFromNet = async(cid)=>{ return await…