Code Monkey home page Code Monkey logo

Comments (3)

olizilla avatar olizilla commented on June 2, 2024

The challenge here is the js interface is used by both js-ipfs, a full implemenation of ipfs in javascript, and js-ipfs-http-client, which is used to talk to the http api of a seperate ipfs daemon. js-ipfs could offer a reactive / evented api, but the current http api doesn't support anything other than standard http request / response. No web-sockets, no server-sent events.

There is work underway to rethink how the http client works, and there is desire to upgrade the http api to support simpler ways for clients to keep up to date with changing data, but it's not something the core team will be tackling soon. We'd welcome prototypes and proposals from the community!

from interface-js-ipfs-core.

alanshaw avatar alanshaw commented on June 2, 2024

If you want to do this programmatically in JS IPFS you can use:

ipfs.libp2p.on('peer:connect', peerInfo => {})
ipfs.libp2p.on('peer:disconnect', peerInfo => {})

https://github.com/libp2p/js-libp2p#events

from interface-js-ipfs-core.

KrishnaPG avatar KrishnaPG commented on June 2, 2024

Thank you @alanshaw Looks like the libp2p events can help. Will look into it.

from interface-js-ipfs-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.