crust-api
crust-api copied to clipboard
Not able to use Cross Chain Pinning
First of great work on Crust! I was trying to pin some files using Cross Chain dStorage Solution, I have already added files to crust ipfs and have the cid.
I am doing something like this on my front end
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const publicAddress = await signer.getAddress();
const privateKey = await signer.signMessage(publicAddress);
const authHeaderRaw = `eth-${publicAddress}:${privateKey}`;
const authHeader = Buffer.from(authHeaderRaw).toString("base64");
and trying to pin file using
const res = await axios.post(`${ipfsPinningService}/pins`, {
headers: {
'Authorization': `Basic ${authHeader}`,
},
json: {
cid: cid.toV0().toString(),
name: "test",
}
})
console.log(res);
However I keep on getting error 401, am I missing something??