Published
Edited
May 10, 2021
Insert cell
Insert cell
IPFS3 = await require('https://unpkg.com/ipfs@0.52.0/dist/index.min.js')
Insert cell
node = {

console.log(IPFS3)
//return new IPFS3();
return await IPFS3.create();
}
Insert cell
file = node.add(new Blob(['Hello Ethereum dApps']))
Insert cell
{
let content = '';
const decoder = new TextDecoder();
const cid = new IPFS3.CID('QmPYzJWktCFUFUMVvY8qejkFgXNURCyV1SCvZEoRibvkEF'); // Qmf412jQZiuVUtdgnB36FXFX7xg5V6KEbSJ4dpQuhkLyfD
for await (const chunk of node.cat(cid)) {
content += decoder.decode(chunk);
}
return content;
}
Insert cell
qrcode = html`<div style="max-width: 300px">${await qr.toString('https://observablehq.com/@khron/marks-factory?file=QmPYzJWktCFUFUMVvY8qejkFgXNURCyV1SCvZEoRibvkEF&input=%7B%22placeholder%22%3A%22Write%20mark%20code%20here.%22%2C%22value%22%3A%22%22%2C%22row%2B%22%3A3%7D', {
margin: 2
})}</div>`
Insert cell
qr = require('https://unpkg.com/qrcode@1.4.4/build/qrcode.min.js')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more