back to notes
changelogover 2 years ago

v0.0.0

Welcome the zeroeth iteration of Krondor.Org

This site is me attempting to workout what exactly I’d want out of a distributed / publically verifiable Conetent Management System (CMS) thingy, with included backend, owned or otherwise, data format, and views / viewers. It implements a blog as an example of how my ideas could work since blogs seem like a natural use case for CMSs. Meanwhile, it’d also be cool to have a place to publish my thoughts and ideas on other projects and interests, so why not build that too?

You can see the current results of that process here on this very site!

If you want to see what work goes into making this site, you can look at its repository: https://github.com/amiller68/krondor

Blog Components

Krondor is comprised of the following components:

  • [contracts] - A single smart contract that points to the latest version of the blog, and is owned by the deployer of the contract (me!)
  • [cli] - A command line interface for interacting with the blog contract and IPFS, for deploying and updating the blog.
  • [org] - A NextJS application that serves as a blog frontend (which you are using right now), which consumes markdown files I upload to IPFS by looking at the pointer on the blog contract.

Why do this?

By using these two technologies together, this blog format has a few interesting properties:

  • All content on the blog is pointed to by an owned contract which I control, and the content itself is identified by a hash. This allows others to verify that the content on this site is correct and published by yours truly. (it’s publically verifiable)
  • All services are distributed (other than the frontend), so I don’t have to rely on any one piece of infrastructure or provider in order to host it! (it’s distributed)
  • All current posts are pointed at by a single CID, allowing me to update the content of my blog without changing its frontend views. This is really handy since I’m managing all of this myself!

It’s a blog framework that’s fun to work with, uses cool technologies, and easy-ish to use 😅

CMS Usage

Content is managed by the CLI tool that implements a very basic CMS. If you’ve set up a fork of the project’s repository (and configured services properly) you can try running the following to start seeing how it works:

yarn cli

You should see the help menu:

A commander based CLI for managing blog content

Options:
  --prod              Whether to use the prod config (default: false)
  -h, --help          display help for command

Commands:
  init                Initialize a new directory for blog content
  add <name> <title>  Add a new blog post to the local manifest...
  update <name>       Update a blog post in the local manifest
  remove <name>       Remove a blog post from the local manifest
  publish             Publish the local manifest to Eth and IPFS
  sync <dir>          Pull the latest content from IPFS and Eth to a specified directory
  help [command]      display help for command

Let’s set up a new blog space. Run:

yarn cli --prod init

This initializes a new directory with empty manifest and history files. These files serve the following purposes:

  • Manifest File: This file tracks what posts are included in the most recent version of the blog, as well as required metadata such as titles, update timestamps, and just about anything else that could be useful! This is what let’s me populate the table at https://www.krondor.org/blog
  • History File: This file points to the previous version of the blog by its content’s CID. We can walk back through the blog’s history by travsering history files. Pretty neat!

Let’s try adding a new post!

yarn cli --prod add v0.0.0 "Welcome to KrondorV0!"

You should see a new file created in the work space that says:

# Welcome to KrondorV0!

2023-07-09T22:50:49.455Z

Woah, meta ….

Let’s update the content by adding some text to the post:

# Welcome to KrondorV0!

2023-07-09T22:50:49.455Z

This site is me attempting to workout what exactly I'd want out of a distributed / verifibably public Conetent ...


Once we’re done editing and making changes to our post, we should update the entry in the Manifest file:

yarn cli --prod update my-first-post

And after that we can publish to IPFS and Ethereum by running:

yarn cli --prod publish

You should be walked through the process of publishing the workspace to IPFS and Ethereum:

Publishing posts to Eth and IPFS...
Using dev config
Publishing posts to IPFS
Updating history
Root CID:  bafybeid5ragww6unfov5rrqn5wss3t27t2pcv3a4zl63d3iwh52ixgabmq
Publishing Root CID to Eth
Estimated gas: 95425
Estimated gas price: 2593823085
Proceed? (y/n)y
Submitting txn to sepolia ...
Sending transaction ...
Mining transaction ...
https://sepolia.etherscan.io/tx/0xd984f220cfddffe0d2c6efb38aa6ef8d302e65959fe65b90398a097e57d75827
Mined in block 3768147
Succeeded with 95425 gas used
Done!
✨  Done in 11.94s.

And tada 🎉! We’ve successfully published our first piece of content to this blog! This same workflow brought you this very post (and hopefully many others soon)!

Wrap Up

I hope you had fun following along! Thanks for bearing with me 😄

This project is still at a very early stage, I hope to add more features soon in order to deliver functionality such as:

  • quality of life development updates such as easy configuration, upgradable contracts, updated project structure, etc
  • distributed frontend hosting over IPFS
  • assymetric key authentication for commenting on posts
  • replication to Filecoin
  • private blog access to a special list of users
  • photo sharing
  • creative feeds gfor showing off my content in new ways
  • etc etc etc

If you:

  • have ideas for how to make this project better
  • want help deploying or developing on top of it
  • think my stuff is cool

be sure to engage! You can find my contact info on:

https://www.krondor.org/about