Hello, I have a react-app running, where I try to connect to my local node via ipfs-http-client:
import { create, urlSource } from 'ipfs-http-client'
async function submit(){
var client = create(new URL("http://127.0.0.1:5001"));
console.log(client);
var file = await client.add("Test");
console.log(file);
...
Connection to local node is working, web-app port also set in config.json:
"API": {
"HTTPHeaders": {
"Access-Control-Allow-Origin": [
"https://webui.ipfs.io",
"http://webui.ipfs.io.ipns.localhost:8080",
"http://localhost:3001"
]
}
},
Restarted daemon and webapp. Also reinstalled IPFS-Desktop. But adding the file is not working, also not fetchable from public gateway after adding. Connection to node is working and HTTP-status 200 is returned and body returns:
1. Hash: "QmQrXZ4iXdEKQMiQT6GRg2Wy3vxb9exR25sYdaqoHwWWuR"
2. Name: "QmQrXZ4iXdEKQMiQT6GRg2Wy3vxb9exR25sYdaqoHwWWuR"
3. Size: "12"
Strangely enough running
client.stop();
works and kills the daemon.
Thanks for your help, maybe someone of you knows why adding is not working