[nfura indicates that “Data is currently pinned until it’s been 6 months since it was last used”. Their documentation shows the request pin data to be in the following format:
curl -X POST `https://ipfs.infura.io:5001/api/v0/pin/add?arg=&progress="
I’m currently using JavaScript’s API ipfs-http-client
to make Http calls.
The add
function from the source code doesn’t seem to provide a way to indicate pinning:
module.exports = (options) => {
const all = addAll(options)
return configure(() => {
return async function add (path, options = {}) { // eslint-disable-line require-await
return last(all({
path,
...options
}, options))
}
})(options)
}
How do I pin data using this JavaScript API?
I’m currently making the Http request as following:
const ipfs = ipfsClient({
host: "ipfs.infura.io",
port: 5001,
protocol: "https",
});
try {
const added = await ipfs.add(data)
} catch (err) {
// handle error
}