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
10
votes
1 answer

How to create a directory and add files to ipfs using js-ipfs with pure javascript only

The only answers I can find in my research cover uploading multiple files from a directory on a PC. That is not what I'm trying to do. I'm trying to create a directory in ipfs and then add new files to that directory using js-ipfs with pure…
Dshiz
  • 3,099
  • 3
  • 26
  • 53
6
votes
1 answer

Errors when importing IPFS while using React

I can not import IPFS because some Webpack errors. I do not really know how to fix them but after searching some information I think that is something about Webpack 5. I did the following steps: npx create-react-app test-app cd test-app npm install…
Prankster2k
  • 91
  • 1
  • 5
4
votes
1 answer

What is the difference between ipfs.add and ipfs.dag.put?

Using the js-ipfs lib, I'm struggling to find good information regarding the difference between the following commands: > await ipfs.add('hello world',{cidVersion:1}) { path: 'bafkreifzjut3te2nhyekklss27nh3k72ysco7y32koao5eei66wof36n5e', cid:…
cwarny
  • 997
  • 1
  • 12
  • 27
4
votes
2 answers

How can I update data on IPFS

I am storing user information on IPFS in JSON object format and then storing that file hash on blockchain. I want to update that JSON object array every time I add a new user object. How can I achieve this? I'm using Etherium Blockchain and ReactJS
4
votes
2 answers

Retrive JPG image stored on IPFS using Infura API and ipfs-http-client in React

I uploaded a jpg image on ipfs using infura API and ipfs-http-client. The file was taken from input with type=file. The event listner was onchange. // imports const IpfsHttpClient = require("ipfs-http-client"); const ipfsC = IpfsHttpClient({ host:…
Rahul Bera
  • 65
  • 2
  • 6
3
votes
1 answer

I cannot bundle ipfs-core with webpack. Module not found: Error: Can’t resolve ‘util’

I want to use ipfs-cose in browser side of my app. I use webpack as a bundler but for ipfs-core is required a polyfill Module not found: Error: Can't resolve 'util' ....... BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core…
3
votes
0 answers

504 Gateway Time-out (Openresty)

i am trying to upload my website folder in ipfs. However when i try run it showing me 504 Gateway. Can someone help me? Thank you
TechDev
  • 415
  • 5
  • 18
3
votes
1 answer

How to get file contents from ipfs-http-client

I am using ipfs-http-client to read the contents of a file form infura, how do i use the "cat" funtionality to correctly get the data in a string/json format? const client = create({ url: ipfsUrl(), headers: { authorization:…
Emmanuel Thomas
  • 159
  • 1
  • 12
3
votes
2 answers

I am not able to use ipfs

I want to publish files on ipfs but it's showing me an error. Here is my code... const ipfsClient = require('ipfs-http-client'); const ipfs = ipfsClient({host: 'ipfs.infura.io', port: 5001, protocol: 'https'}); function App() { const [buffer,…
3
votes
3 answers

Import ipfs in TypeScript

Importing and module initialization is generally simple using JavaScript/TypeScript using either require or import. I'm having trouble running the basic example from the JS IPFS website to initialize ipfs. If I follow the general instructions I get…
haleonj
  • 1,438
  • 3
  • 16
  • 30
3
votes
2 answers

Cannot find module 'jsonfile/utils' in Electron-Typescript app

I started from a brand new working very simple Electron-Typescript app. In this working really simple Electron-Typescript app, I added in main.ts: import Ipfs from 'ipfs'; import IpfsHttpClient from 'ipfs-http-client'; and this import of ipfs…
Raphael10
  • 2,508
  • 7
  • 22
  • 50
2
votes
0 answers

How do I set up and run my own delegated routing node in IPFS?

I have done some research on js ipfs to realize that, by default, my local ipfs node does not use DHT based queries to fetch files with CIDs nor propagate my local DHT to other connected peers once the local node downloads the file. Instead it makes…
lucidcloud
  • 73
  • 6
2
votes
0 answers

How to resolve module not found error with ipfs-core @chainsafe/libp2p-noise

Hi I'm having an error with installing ipfs-core into my existing project. I'm using node v16.14.2 and npm v8.5.0. I've tested with a fresh project and just installing ipfs-core and somehow that worked, I feel as if this is an issue with webpack…
scoot556
  • 65
  • 5
2
votes
1 answer

Orbit-db createInstance error "Path must be a string"

ipfs initializes, but I cannot manage to get an orbitdb instance. const orbitdb = await OrbitDB.createInstance( ipfs ); Uncaught (in promise) TypeError: Path must be a string. Received "12D3KooWByXmww9fsJv46RddyFk4PJDfiuAY315MHQb9jAtyTBfW" at…
2
votes
0 answers

OrbitDB can't replicate database on different peer

I have forced with problem in my p2p database orbitdb. Everything works fine while I did not move the database to another server. const ipfsOptions = { repo: './ipfs' } const ipfs = await IPFS.create(ipfsOptions) const orbitdb = await…
Zethuman
  • 59
  • 2
1
2 3 4 5 6 7