Publishing data to an ipfs-cluster

Lets say I am running an example cluster similar to:

How do i configure the js-ipfs client to use the exposed cluster api at :5001?

The cluster API is at port 9094. 5001 is the ipfs api port. You need to check the documentation and code for the library that you are using.

If you want to interact with cluster, and not with ipfs, you should preferentially use GitHub - nftstorage/ipfs-cluster: A zero-dependency client to the IPFS Cluster HTTP API, built for the browser..

1 Like

But if I use that client library with the cluster, how can I publish an ipld block to the cluster because the .add() method is only for files? Or do i not need to add the block to the cluster and only the pin?

As of 0.13.3-rc1, you can wrap your ipld block(s) in a CAR file, and add the CAR file using ?format=car.

1 Like

Thanks hector for the pointers. You’re the man! :slight_smile:

1 Like