In previous blog posts, we briefly mentioned a new system we are developing that would transform the ARK Core v2 into a basic plugin / modular concept. Since then, the first implementation has outgrown it’s initial concept so much so that we decided it needs a dedicated post to explain the upcoming changes. We are very excited at how it has turned out so far and believe that it will make our system much more powerful in the future.

ARK Core v2 will be split into multiple packages using Lerna to manage development and publishing of those packages.

The benefit of this approach is that it is easier to focus on smaller parts of the whole system in isolation. Each part of the core can be easily replaced by custom implementations, imagine a core-logger-logstash package that replaces the default logger.

Everything should be easy to replace, remove or disable in modules, which also makes it possible to just tag a new version of the core-database if, for example, a database fix needed to be done instead of having to tag a new core release. We can split the whole core into modules and provide a lego-like experience for building your own node (provide chain manager, forger, transaction pool, etc. as default and APIs, webhooks, etc. as optional modules).

For instance, using this method, relay nodes wouldn’t need to include the core-forger module. This change also makes it easier for bridgechains and forks to modify the core as they can swap their custom implementations in without too much effort.

To put these updates in perspective, have a look at the current structure of the modules for ARK v2 (note that this is not final and we might add more or modify current ones with different implementations):

The Plugin Manager

All of those plugins are interconnected via the core-plugin-manager package, which functions as a container to hold all the instances that are shared across plugins.

The plugin manager allows us to provide different Bootstrap processes for things like starting a relay node or a forging node.

The plugin manager accepts 2 parameters, the path to a folder that contains a plugins.json file and an optional parameter that can contain options like including and excluding plugins from the Bootstrap process or plugin specific options that are not available from the configuration file.

Configuration

The basic plugin.json at the moment looks roughly like this and is subject to changes.