Last active
December 30, 2021 20:09
-
-
Save VictorTaelin/b8a4a44005c7a5243ce0150585a4d48b to your computer and use it in GitHub Desktop.
Upload a JSON to IPFS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
})(); |
This is actually so welcome. Much appreciated!!!
Gracias!!
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
Thank you!!!