IPFS Overview & Ternoa IPFS Client
Overview
Ternoa IPFS Client
import { TernoaIPFS, File } from "ternoa-js";
const main = async () => {
const file = new File(
[await fs.promises.readFile("shining.jpg")],
"shining.jpg",
{
type: "image/jpg",
}
);
const ipfsClient = new TernoaIPFS(new URL("IPFS_NODE_URL"), "IPFS_API_KEY");
const nftMetadata = {
title: "Shining, a nice movie",
description: "This is (not) my first Ternoa's NFT",
};
const { Hash } = await ipfsClient.storeNFT(file, nftMetadata);
console.log("The off-chain metadata hash is ", Hash);
};Last updated