1

I have a lot of errors using the API and I am wondering if there is anyway to debug it.

When I use

 curl "http://127.0.0.1:5001/api/v0/object/get?arg=QmU5KhkgvweYgE3Gsr8A19uFQrq7mszx7dubcoo89cTmAV&encoding=json"
{"Links":[],"Data":"\u0008\u0002\u0012\u000etrevor oakley\n\u0018\u000e"}

When I try

 curl "http://jenbil.com:5001/api/v0/cat?arg=QmU5KhkgvweYgE3Gsr8A19uFQrq7mszx7dubcoo89cTmAV&stream-channels=true"
curl: (7) Failed to connect to jenbil.com port 5001: Connection refused


netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address            State       PID/Program name
tcp        0      0 127.0.0.1:8180          0.0.0.0:*                   LISTEN      13749/ipfs      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN       1287/sshd       
tcp        0      0 0.0.0.0:4001            0.0.0.0:*               LISTEN      13749/ipfs      
tcp        0      0 104.236.58.158:8545     0.0.0.0:*               LISTEN      11669/geth      
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN      13749/ipfs      
tcp6       0      0 :::22                   :::*                    LISTEN      1287/sshd       
tcp6       0      0 :::3000                 :::*                    LISTEN      11513/node      
tcp6       0      0 :::30303                :::*                    LISTEN      11669/geth      
tcp6       0      0 :::4001                 :::*                    LISTEN      13749/ipfs 

Has anyone any ideas about this?

0

You need to set the IPFS host to 0.0.0.0

ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/9001

You may also need to set CORS:

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'

Restart IPFS daemon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.