ipfs-inactive/js-ipfs-http-client

callback after connection to ipfs

HamzaBinSarfraz opened this issue · 3 comments

const ipfsClient = require('ipfs-http-client');

const ipfs = new ipfsClient({
    host: 'ipfs.infura.io',
    port: 5001,
    protocol: 'https'
});

is there any callback which confirm me that i am successfully connected to ipfs ?

No, because the client doesn't make any requests to the node until API methods are invoked.

If you want to confirm the config is valid and you can communicate with the node, you could call a cheap API method after construction like ipfs.id()?

Hope that answeres your question @HamzaBinSarfraz - let us know if not.