Socket
Socket
Sign inDemoInstall

ipfs-grpc-client

Package Overview
Dependencies
132
Maintainers
3
Versions
230
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ipfs-grpc-client

A client library for the IPFS gRPC API


Version published
Weekly downloads
660
decreased by-5.85%
Maintainers
3
Install size
15.9 MB
Created
Weekly downloads
 

Readme

Source

⛔️ DEPRECATED: js-IPFS has been superseded by Helia

📚 Learn more about this deprecation or how to migrate

⚠️ If you continue using this repo, please note that security fixes will not be provided

ipfs-grpc-client

ipfs.tech Discuss codecov CI

A client library for the IPFS gRPC API

Table of contents

Install

$ npm i ipfs-grpc-client

Browser <script> tag

Loading this module through a script tag will make it's exports available as IpfsGrpcClient in the global namespace.

<script src="https://unpkg.com/ipfs-grpc-client/dist/index.min.js"></script>

This module implements part of the IPFS Core API using gRPC over websockets to achieve the bidirectional streaming necessary to have full duplex streams running in the browser.

It's not recommended you use this directly, instead use the ipfs-client to combine this with the ipfs-http-client in order to have HTTP fallback for the missing parts of the API.

Why?

The fetch and XHR APIs do not allow for full-duplex streaming, that is, allowing the client to receive bytes from the response while also adding more bytes to the outgoing request.

This limits what we can do in browsers in terms of the API, for example streaming arbitrarily sized payloads or exposing libp2p duplex streams.

gPRC over websockets has no such limitations so allows us to harness the full power of a remote IPFS node in the browser without the need to work around browser behaviour.

API

create([options])

Parameters

None

Options

An optional object which may have the following keys:

NameTypeDefaultDescription
urlMultiaddr or string or URLundefinedThe address of a ipfs-grpc-server to connect to
agenthttp.AgentundefinedA http.Agent used to control HTTP client behaviour (node.js only)

Returns

TypeDescription
objectAn instance of the client

Example

import { create } from 'ipfs-gprc-client'

const client = create({
  url: '/ipv4/127.0.0.1/tcp/1234/ws'
})

const id = await client.id()

License

Licensed under either of

Contribute

Contributions welcome! Please check out the issues.

Also see our contributing document for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Keywords

FAQs

Last updated on 25 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc