Skip to content

Serving a static website published to the IPFS network, updated by pushes to the BCH blockchain.

License

Notifications You must be signed in to change notification settings

christroutner/koa-ipfs-blog

Repository files navigation

koa-ipfs-blog

Greenkeeper badge

A light-weight web server that serves any website published to IPFS. It monitors a BCH address and automatically updates when new content is announced by that address.

This is the server-side software that serves up content to users with a normal web browser. It works in conjunction with the memo-push publishing tool. Memo-push is used to announce new content via the BCH network. This software is used to retrieve that new content from the IPFS network and serve it to users. Future versions will also serve content directly to the Tor network as well, via a hidden service.

This project was forked from the koa-api-boilerplate

Requirements

  • node ^10.15.1
  • npm ^6.7.0

Installation

  • Clone and install dependencies:
git clone https://github.com/christroutner/koa-ipfs-blog
cd koa-ipfs-blog
npm install
  • Install IPFS and ensure the daemon is running by executing ipfs daemon.

Usage

There are two forms of using this repository. Development is best for hacking and development of the server. Production packages the repository into a Docker container for easy deployment. It also adds a Tor docker container so that your website content can be accessed directly through Tor and the Tor browser.

Development

  • Ensure the IPFS daemon is running.

  • Add your BCH address to the config file. This should be the same address associated with your memo.cash profile.

  • Start the server: npm start

Production

It's assumed that you are starting with a fresh installation of Ubuntu 18.04 LTS on a 64-bit machine. It's also assumed that you are installing as a non-root user with sudo privileges.

  • Install Docker on the host system. This tutorial shows how to install Docker on a Ubuntu system. It's specifically targeted to Digital Ocean's cloud servers, but should work for any Ubuntnu system.

  • Install Docker Compose too. This tutorial shows how to do so on a Ubuntu system.

  • Add your BCH address to the production/common.js file. This should be the same address associated with your memo.cash profile.

  • Build the image: docker-compose build

  • Run the docker container: docker-compose up

  • Or, run the docker container in daemon mode: docker-compose up -d

Note: It takes time for the container to crawl the IPFS peer-to-peer network and connect to peers, in order to find the initial content it wants to download. You can speed up this processes by pre-downloading the initial content into the ipfs-data directory. If working regularly with this software, consider forking this ipfs-stay-connected app to make uploading of IPFS content faster.

Note: Your website will be able to be accessed directly over the Tor network. The .onion address for your website can be found in keys/koa/hostname.

IPFS

v1.1.3 uploaded to IPFS:

  • Get it: ipfs get QmULHyBTAHQxT9Rnd6n7bfnXCDFdcHtZQKM4Jn1JsSteUG
  • Pin it: ipfs pin add -r QmULHyBTAHQxT9Rnd6n7bfnXCDFdcHtZQKM4Jn1JsSteUG

License

MIT

About

Serving a static website published to the IPFS network, updated by pushes to the BCH blockchain.

Resources

License

Stars

Watchers

Forks

Packages

No packages published