I am trying to use ipfs-http-client
with pinata, but it seems impossible.
const ipfs = create({
host: 'api.pinata.cloud',
port: 80,
protocol: 'https',
apiPath: '',
headers: {
authorization: 'Bearer ' + 'JWT HERE'
}
})
await ipfs.add("nice");
This just results in connection timed out. The reason is that it makes a request to https://api.pinata.cloud:80/api/v0/add?stream-channels=true&progress=false
which seems wrong as pinata won’t have that /api/v0/add
in the endpoint.
If I try to set apiPath
setting while creating ipfs-http-client
, It poses 2 problems.
- If I am using multiple pinata endpoints, I have to create
ipfs-http-client
multiple times for differentapiPath
. - It again still doesn’t work. I tried setting
apiPath: 'pinning/pinByHash',
, but now it makes a request tohttps://api.pinata.cloud:80/api/v0/add?stream-channels=true&progress=false
. Soadd
is still in there in the url…
Doesn’t ipfs-http-client work with Pinata ?