Host blog over IPFS

  1. blog powered by jekyll
    >jekyll build
    # => The current folder will be generated into ./_site
    
  2. install IPFS(js-ipfs)
    > npm install ipfs --global
    > jsipfs --help
    Commands:
      bitswap               A set of commands to manipulate the bitswap agent.
      block                 Manipulate raw IPFS blocks.
      bootstrap             Show or edit the list of bootstrap peers.
      commands              List all available commands
      config <key> [value]  Get and set IPFS config values
      daemon                Start a long-running daemon process
    # ...
    
  3. Start local ipfs node
    >jsipfs init
    >jsipfs daemon
    

    check http://localhost:5002/webui

  4. Add blog to ipfs node
    >ipfs add -r _site
    added QmZsfVcdi6Q6TqFioQDgzGWxjdwft8da6mcGy8HjamV87p _site
    

    $SITE_HASH: QmZsfVcdi6Q6TqFioQDgzGWxjdwft8da6mcGy8HjamV87p

  5. visit the blog

notes

js-ipfs different with go-ipfs

  • default repo location: ~/.jsipfs (can be changed with env variable IPFS_PATH)
  • default swarm port: 4002
  • default API port: 5002
  • default Bootstrap is off, to enable it set IPFS_BOOTSTRAP=1

web extension

  • http://localhost:5002/webui/ should be http://localhost:5002/webui

reference