Documentation

Blocktree is currently undergoing architectural changes. If there are discrepancies between the code and the paper, the paper is considered authoritative.

What is Blocktree?

Blocktree is a platform for building distributed systems. It’s based on the actor model, so if you’re familiar with Erlang, Elixir, or Akka, it should seem familiar.

What distinguishes Blocktree from these systems is that it’s organized around a global distributed filesystem, which is itself implemented using the actor runtime. Each instance of the runtime located at a specific filesystem path. Messages to actors in a given runtime are addressed using its path. The filesystem is divided into disjoint domains of authority, each controlled by a root security principal. The first component of an absolute path identifies the root principal of the path’s domain. This identifier is a fingerprint of the root principal’s public key, which is the root of the chain of trust used to authenticate file data. The filesystem can be mounted with a FUSE daemon so it can accessed from outside the actor runtime.

In addition to running individual actors, Blocktree also supports registering and orchestrating services. These are logical collections of actors which work together to provide some service, either to other actors or external clients. The runtime is responsible for starting service actors, load balancing them, and deactivating them when they’re idle or the system is overloaded. The filesystem is itself implemented as a service.

Each instance of the actor runtime is a unique security principal with its own credentials (public-private key pairs and a certificate chain). These credentials specify the runtime’s path and so the domain that it’s part of. It can automatically discover other runtimes in its domain and connect to them over the internet. These connections are secured using mutual TLS authentication and the path of each runtime is cryptographically verified during the handshake. Messages sent between actors in different runtimes are transparently forwarded over these connections.

Blocktree provides a system for defining actor communications protocols. These are optional, but they help to ensure the correctness of a distributed system providing information which is used to statically and dynamically check for protocol compliance. This system helps to isolate bugs to the component responsible for breaking protocol. It’s implemented using compile time code generation, allowing it to provide these benefits with minimal runtime overhead.

Is Blocktree a good fit for my project?

If you’re building a system that will ever need to scale beyond the performance or reliability of a single computer, then Blocktree is worth considering. Even if you don’t need to support a large number of users today, by adopting a programming model that allows for scalability you can save yourself the hassle of re-architecting your software down the road. You can keep things simple when you begin development using a monolithic actor that does everything, then cut out pieces into different actors as you identify functionality that can be modularized.

Blocktree currently only supports actors which are implemented in asynchronous Rust. If you’re unfamiliar programming in this environment and don’t want to learn, then Blocktree is not for you. In the future other actor implementation languages will be supported using Wasm modules. This work is blocked pending the standardization of the WebAssembly Component Model.

Further Reading

For a more thorough conceptual description of the system, checkout this paper.

To learn more about the code checkout the project README, which gives an overview of the crates in the system and provides links to their rustdocs.