im currently setting up a local docker test cluster (4 nodes all on the same machine). I’ve followed this docker-compose.yml and setup things like the replication factor etc., which all work.
The issue i’m having is adding files to the cluster directly, over the proxy api and not via ipfs-cluster-ctl cli, that works as it should. From what I understand the cluster proxy api (port 9095) mimics the ipfs api, meaning I should be able to add files with the js-ipfs-http-client, just like when running a normal ipfs node. However, when I add a file, I get an CORS error (No ‘Access-Control-Allow-Origin’ header is present on the requested resource) and no response that contains the files address, the request is still successful though. The funny thing is, the file is actually added to the cluster, with all the pins etc. working as expected.
ENV’s from docker compose:
environment: CLUSTER_SECRET: 890e6fe6498009xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx IPFS_API: /dns4/ipfs0/tcp/5001 CLUSTER_REPLICATIONFACTORMIN: 2 CLUSTER_REPLICATIONFACTORMAX: 2 CLUSTER_PEERNAME: cluster0 CLUSTER_LEAVEONSHUTDOWN: 'TRUE' CLUSTER_RESTAPI_CORSALLOWEDMETHODS: GET, POST CLUSTER_RESTAPI_CORSALLOWEDORIGINS: http://localhost:3000
Request error message:
Access to fetch at ‘http://127.0.0.1:9095/api/v0/add?stream-channels=true’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
Would be grateful for any help or ideas what could be causing this.