Ipfs-java API issue

Hi,all
I am curious about how to know that ipfs daemon is running in java code?
is there any interface availble in java-API?

As a basic health check you can fetch a list of swarm peers
(Swarm#peers() or http://localhost:5001/api/v0/swarm/peers)

  • if request fails, then your IPFS node is offline
  • if it succeeded, but peer count is equal 0, then you have problem with reaching the network, otherwise everything is OK

User-friendly reference for HTTP API : http://docs.ipfs.apiary.io

1 Like

you can see that : https://github.com/ipfs/java-ipfs-api

1 Like

When you create an instance using the the java api that @josselinchevalay linked to, e.g.
new IPFS("/ip4/127.0.0.1/tcp/5001");
it will try and contact the ipfs daemon to verify the version is supported. If it can’t reach it, then an exception is thrown.

1 Like

tnx a lot bro,got it

tnx, it is very useable

Hello guys, I am having an issue to use the Ipfs java api.
the daemon is executed and everything seems good. but when I try to instantiate the ipfs i fall into the exception io

hello,

maybe you have missing import try to add that import io.ipfs.multiaddr.MultiAddress; and check this class.

Regards

Thanks for reply ,
it was exactly what is missing , I add the libraries multihash, multibase, multiaddr, cid , hams etc…
run successfully .
Regards.