js-ipfs | IPFS implementation in JavaScript | Storage library

 by   ipfs JavaScript Version: ipfs-message-port-server-v0.15.1 License: Non-SPDX

kandi X-RAY | js-ipfs Summary

kandi X-RAY | js-ipfs Summary

js-ipfs is a JavaScript library typically used in Storage, Ethereum applications. js-ipfs has no bugs, it has no vulnerabilities and it has medium support. However js-ipfs has a Non-SPDX License. You can install using 'npm i pinata-ipfs-utils' or download it from GitHub, npm.

Upgrading from <=0.40 to 0.48? See the release notes for the list of API changes and the migration guide. We've come a long way, but this project is still in Alpha, lots of development is happening, APIs might change, beware of ..
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              js-ipfs has a medium active ecosystem.
              It has 7429 star(s) with 1359 fork(s). There are 224 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 1671 have been closed. On average issues are closed in 1916 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of js-ipfs is ipfs-message-port-server-v0.15.1

            kandi-Quality Quality

              js-ipfs has 0 bugs and 0 code smells.

            kandi-Security Security

              js-ipfs has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              js-ipfs code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              js-ipfs has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              js-ipfs releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              It has 30 lines of code, 0 functions and 990 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed js-ipfs and discovered the below as its top functions. This is intended to give you an instant insight into js-ipfs implemented functionality, and help decide if they suit your requirements.
            • write metadata to file
            Get all kandi verified functions for this library.

            js-ipfs Key Features

            No Key Features are available at this moment for js-ipfs.

            js-ipfs Examples and Code Snippets

            No Code Snippets are available at this moment for js-ipfs.

            Community Discussions

            QUESTION

            What is the use of key API in IPFS Core APIs?
            Asked 2022-Feb-22 at 21:05

            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 multiple websites (for example) under the same IPFS module, you can always check the key API."

            I went through the key API but did not understand the purpose of these APIs, what is there usage and how will it help in hosting multiple websites?

            ...

            ANSWER

            Answered 2022-Feb-22 at 21:05

            With ipfs.name.publish you use the IPNS feature, that maps an identifier (of the form /ipns/...) to a CID. The API allows to update the mapping, such that your IPNS name always points to the latest version of your content/website. As I've detailed here, the IPNS identifier of the form /ipns/... is an encoded version of your public key. Only you, who has the corresponding private key can update the mapping of IPNS to CID.

            If you want to manage multiple websites, each with a separate IPNS identifier, you need multiple private-public-key-pairs. With the key API, you can manage and create additional keys. When you call ipfs.name.publish() you can pass the name of a key as an optional argument. This choice which key you use will define the IPNS identifier and also which mapping/website will be updated.

            Source https://stackoverflow.com/questions/71211524

            QUESTION

            IPNS, no link named "xxxx" under "hash"
            Asked 2021-May-24 at 17:56

            I am using IPFS and IPNS to populate my website with data. Pulling json files via HTTP works great, but when I try to pull .jpg file from my IPNS published IPFS directory, I get an error.

            ...

            ANSWER

            Answered 2021-May-24 at 17:56

            easy one to answer you have a typo instead of 'pictures' you have 'picutres' as the error message says.

            no link named "picutres"

            basically this error message tells you that no folder with that name exists. You should check spelling.

            Source https://stackoverflow.com/questions/67556167

            QUESTION

            How to pin a hash for IPFS through Infura's gateway using ipfs-http-client API
            Asked 2021-Mar-17 at 09:17

            The documentation shows the request to be in the following format:

            curl -X POST "https://ipfs.infura.io:5001/api/v0/pin/add?arg=&progress="

            I'm currently using JavaScript's API ipfs-http-client to make Http calls.

            The add function from the source code doesn't seem to provide a way to indicate pinning:

            ...

            ANSWER

            Answered 2021-Mar-16 at 22:02

            I have never used infura and I do not really understand how their authentication supposed to work (linked page does not provide much detail). But assuming that it works via auth token it would be something along these lines:

            Source https://stackoverflow.com/questions/66660309

            QUESTION

            "POST http://localhost:9090/spawn ERR_CONNECTION_REFUSED" error while spawning an IPFS daemon using ipfsd-ctl
            Asked 2021-Feb-18 at 14:19

            I'm trying to Spawn an IPFS daemon from the Browser using the provided remote endpoint using the ipfsd-ctl library.

            This is the link I'm referring

            ...

            ANSWER

            Answered 2021-Feb-18 at 14:19

            Ctl.createServer starts an HTTP Server that Ctl.createFactory will connect to. As the warning says "Server not implemented in the browser", you need to run it in nodejs and from the browser use Ctl.createFactory to interact with it.

            Source https://stackoverflow.com/questions/66246962

            QUESTION

            IPNS name published in browser with js-ipfs won't resolve on gateway or local node
            Asked 2020-Nov-27 at 17:25

            I am working on a browser application which uses js-ipfs. After I publish an ipfs address (e.g. /ipfs/Qm...), I successfully get the returned name (i.e. /ipns/Qm..). But the problem is that I can't resolve it anywhere else (local node's gateway, public gateway etc.), but within the same browser application, which is very problematic...

            How can this be solved? I believe it has something to do with DHT not being supported within browser, but have no idea how to solve it whatsoever...

            ...

            ANSWER

            Answered 2020-Nov-27 at 17:25

            Your node needs to be dialable by other nodes for them to be able to resolve content or IPNS names, etc from you. For the browser this means using a WebRTC transport and connecting to a WebRTC signalling server. Other nodes connected to the same signalling server will be able to dial your node.

            See the browser-exchange-files example for how two browser nodes can discover each other via a WebRTC signalling server.

            The public gateways run go-IPFS which doesn't have a WebRTC transport yet so they can't dial your node to resolve the name.

            If you want your IPNS name to be resolvable after the user closes their browser you'll need to ensure it's being propagated on the network somewhere, either by standing up a long-lived go-IPFS node yourself which you control via it's HTTP API (do consider the security implications here) or using a pinning service that will let you create IPNS names.

            Source https://stackoverflow.com/questions/65039648

            QUESTION

            Connect browser to NodeJS IPFS node
            Asked 2020-Nov-06 at 20:10

            I'm trying to connect a browser js-ipfs node to a my NodeJS server that is running an js-ipfs node as well. I understand that I need to add in the server's Multiaddr to the browser's bootstrap config in order to connect the two nodes.

            However, since my website uses HTTPS, when I try to connect the browser to my server via ws it gives this warning: An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. but from my understanding NodeJS's js-ipfs cannot listen to wss calls.

            So how can I go about connecting the two nodes? Is using WebSockets the only or best way?

            ...

            ANSWER

            Answered 2020-Nov-06 at 20:10

            Due to browser’s security policies you cannot establish unencrypted connection from secure context (e.g. page loaded via HTTPS). You can read about it at MDN Secure Context. So you should make your server to use SSL and then replace ws:// with wss://. The simplest thing to do would be to setup SSL with nginx. You’ll need to setup a domain name for the cert too. You can also look on some documentation on how to setup libp2p/IPFS with SSL on this PR.

            You can also use webrtc-star instead of websockets. However, while you can use both, each one of them have particularities that are better for certain scenarios. If you need peer discovery, webrtc-star should be used at the moment and you can check https://github.com/libp2p/js-libp2p/tree/master/examples/libp2p-in-the-browser and https://github.com/ipfs/js-ipfs/tree/master/examples/browser-exchange-files . If you do not need to rely on peer discovery and the other peer is a well known peer you can use bootstrap and connect via websockets.

            Source https://stackoverflow.com/questions/64720398

            QUESTION

            How to start IPFS in browser by using only DHT WebRTC peers?
            Asked 2020-Sep-02 at 09:57

            I'm using this code in the browser. It seems to be connecting to ipfs.io via http?. I'm looking to only connect to DHT webRTC peers. I'm guessing I need to pass some option to Ipfs.create? I see an example of custom libp2p here but the amount of options are overwhelming. https://github.com/ipfs/js-ipfs/blob/master/examples/custom-libp2p/index.js

            ...

            ANSWER

            Answered 2020-Sep-02 at 09:57

            You can pass the IPFS config options when creating the instance, which enables you to specify the remote WebRTC addresses you want to listen on, and remove/change the Bootstrap nodes to initially connect to. You can see this in the file exchange example at https://github.com/ipfs/js-ipfs/blob/ipfs%400.49.1/examples/browser-exchange-files/public/app.js#L48. So your config might look like this:

            Source https://stackoverflow.com/questions/63696779

            QUESTION

            js-IPFS / vue.js upload error - Object is not async iterable
            Asked 2020-Aug-12 at 15:56

            I have been working on js-ipfs (0.49.0) and this was working fine but I started getting some issues, anyway I have finally come back to look at the code again and the connection works fine but when I attempt to upload I get a new error

            Object is not async iterable

            I am not sure what that means or how to address in my code a lot of the examples are for react and not vue

            Any pointers much appiciated.

            ...

            ANSWER

            Answered 2020-Aug-12 at 15:56

            ipfs.add returns a single object since ipfs@0.48.0 - you need to change:

            Source https://stackoverflow.com/questions/63379148

            QUESTION

            How to create a directory and add files to ipfs using js-ipfs with pure javascript only
            Asked 2020-Jun-30 at 13:32

            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 javascript only, generally one file at a time.

            I conceptually understand that a directory in ipfs is simply another file. But I don't understand how to create that directory (file) and add other files to it for later retrieval, particularly with js-ipfs and pure javascript code.

            I am implicitly not using node.js, therefore neither react, angular or vue either.

            This works for a single file with no directory on ipfs:

            ...

            ANSWER

            Answered 2020-Jun-30 at 13:32

            Reading through the js-ipfs documentation, I finally found the answer.

            To only create a directory:

            Source https://stackoverflow.com/questions/62648572

            QUESTION

            The use of Buffer before saving to IPFS
            Asked 2020-Feb-26 at 21:24

            I am following an IPFS github example to save to IPFS:

            ...

            ANSWER

            Answered 2020-Feb-26 at 21:24

            By default Node.js works with Buffers where use APIs who can be streams, if you works with strings in JavaScript, these works in unicode (utf-8) and these can broke with binary data (for example, an image, a video file, etc).

            An easy example to difference strings from Buffers could be compare the size of UTF-8 string, as unicode text (counting by character) and a buffer (counting by byte):

            Source https://stackoverflow.com/questions/60422376

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install js-ipfs

            Read the docs
            Ensure CORS is correctly configured for use with the HTTP client
            Look into the examples to learn how to spawn an IPFS node in Node.js and in the Browser
            Consult the Core API docs to see what you can do with an IPFS node
            Head over to https://proto.school to take the IPFS course that covers core IPFS concepts and JS APIs
            Check out https://docs.ipfs.io for glossary, tips, how-tos and more
            See https://blog.ipfs.io for news and more
            Need help? Please ask 'How do I?' questions on https://discuss.ipfs.io
            Installing ipfs globally will give you the jsipfs command which you can use to start a daemon running:.
            If you do not need to run a command line daemon, use the ipfs-core package - it has all the features of ipfs but in a lighter package:.

            Support

            ConceptsConfigCore APIExamplesDevelopment
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries