Skip to content

Instantly share code, notes, and snippets.

View devzl's full-sized avatar

dev_zl devzl

View GitHub Profile
// Simple example of how to display an image from IPFS on your html web page
// Using ipfs/js-ipfs : https://github.com/ipfs/js-ipfs#use-in-the-browser
// Don't forget to include the scripts into your html page:
// <script src="https://unpkg.com/ipfs/dist/index.min.js"></script>
// <script src="https://cdn.jsdelivr.net/npm/ipfs/dist/index.min.js"></script>
function showIPFSImage () {
// Create the IPFS node instance
const node = new Ipfs()
{
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x8000000",
"alloc": {},
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0