Comment exécuter l’explorateur de chaînes de blocs Ethereum du CNRC sur IPFS

bitaccess logo

We are excited to announce that subsequent to the successful experiment with the Ethereum Blockchain in January 2018, the Government of Canada is experimenting with additional decentralized technologies. The National Research Council of Canada, through its Industrial Research Assistance Program (NRC IRAP), is using our latest product, the Catena Blockchain Suite, to host its own Ethereum blockchain explorer on the InterPlanetary File System (IPFS).

From a high level, IPFS is a peer-to-peer hypermedia protocol that aims to replace HTTP and make the web faster, safer, and more open. To easily access information stored on blockchains, users need to use a web-based application. IPFS provides a storage technology which allows for unalterable, permanent hosting of web applications. Unlike traditional web hosting, applications hosted on IPFS can be accessed far into the future, even if the original web host has gone offline.

You can access the explorer in the exact same way as always by visiting nrc-cnrc.explorecatena.com. It looks and feels like any other website but behind the scenes the application is stored in a different way. On a conventional website the owner is responsible for maintaining servers that store and distribute the content to you when you visit a website on your device. When using IPFS the content could be stored on any number of computers anywhere in the world and is accessible to everyone without restrictions.

Anyone can install IPFS on their own computer and start hosting the site themselves (the path is /ipns/explorecatena.com). If you are tech-savvy and interested in hosting your own copy, feel free to read the detailed instructions below. If you would like a simple way to check it out, feel free to check out the application on the public IPFS node ipfs.io.

Self hosting the app

First, you need to install and setup IPFS. After you are running an IPFS node, you can pin the NRC blockchain explorer by running the command:

ipfs pin -r /ipns/explorecatena.com

You should see output that looks like:

pinned QmRRUpdRgqKcxZ6aZU3UpyfkWReBDHxpVJvGQqrdpfTRiw recursively

This saves a clone of the current version of the app on your local machine. When the application is updated in the future you’ll need to run the command for the latest version.

You can view the NRC explorer using your local IPFS gateway running at localhost:8080 and using the url /ipfs/<app_hash>. Look for the “app hash” in the long code output by the pin command, it’s bolded in the above output. For example, using the example above, you’d go to:

localhost:8080/ipfs/QmRRUpdRgqKcxZ6aZU3UpyfkWReBDHxpVJvGQqrdpfTRiw

You now have a copy of the Catena Blockchain Explorer on your computer that you can continue to use even if the official site goes offline.