The Kinode microkernel routes messages between userspace packages and runtime modules.

Runtime module responsibilities

microkernel

eth

http

net

terminal

vfs

kv & sqlite

Runtime modules vs Processes vs Packages

"Runtime modules" talk to the outside world. E.g., eth talks to the chain, http speaks HTTP as a client or server, net talks to other nodes, terminal gets typed input from user & outputs text to user.

"Processes" are Wasm components. These are "userspace".

"Packages" are bundles of Wasm components that implement some specific functionality. E.g., the App Store consists of a main process as well as a chain process that manages communications for App Store to/from chain. The App Store distributes packages. Some packages are also distributed with the core Kinode distribution.

How do my processes talk to the outside world?

Only runtime modules can talk to the "outside world". The "outside world" includes the traditional web, the chain, the filesystem, the Kinode network, etc.

Processes only talk to the microkernel. The microkernel passes messages to their target. To give a few examples:

To make an HTTP request, a process passes a message targeted at the http runtime module. The http runtime module is then responsible for sending the HTTP request to the remote site and receiving the HTTP response. It then routes the HTTP response back to the microkernel, which in turn passes it to the originating process.

To send a message over the network, a process passes a message targeted to that node. The microkernel sees the target is remote and passes it to net, which is responsible for getting the message over the Kinode network to the target node.

To write to a file, a process passes a message targeted at the vfs runtime module. The vfs runtime module is then responsible for writing the file to the underlying filesystem.

Original gist on GitHub