Skip to content

Instantly share code, notes, and snippets.

@VictorTaelin
Last active December 30, 2021 20:09
Show Gist options
  • Save VictorTaelin/b8a4a44005c7a5243ce0150585a4d48b to your computer and use it in GitHub Desktop.
Save VictorTaelin/b8a4a44005c7a5243ce0150585a4d48b to your computer and use it in GitHub Desktop.
Upload a JSON to IPFS
const ipfs = require("nano-ipfs-store").at("https://ipfs.infura.io:5001");
(async () => {
const doc = JSON.stringify({
foo: "bar",
tic: "tac"
});
const cid = await ipfs.add(doc);
console.log("IPFS cid:", cid);
console.log(await ipfs.cat(cid));
})();
@hurali97
Copy link

Thank you so much!

@GunaShekar02
Copy link

This is amazing! Thanks!

@NevMoney
Copy link

Thank you!!!

@Ian-Bright
Copy link

This is actually so welcome. Much appreciated!!!

@codenametobes
Copy link

Gracias!!

@enricobottazzi
Copy link

Hi, how can I fetch the data back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment