API and Documentation

We are currently working on developing more robust tutorials and other documentation for developers. In the meantime, here is a quick guide to getting started with module development:

1. Installing Modules

Your Saito modules go in the /mods directory. Putting a module here is not enough to get it to run though. You will also need to edit your your module configuration file to tell Saito that you want it to load.

> /config/modules.config.js

Every module configuration file has two sections. The first section (“core”) refers to the modules that you want to run on your server. The second section (“lite”) refers to the modules that you want to compile into the version of Saito that you serve to your users.

If you make changes to your module configuration file that affects the javascript that you want to serve to remote clients, be sure to run “npm run compile” to refresh the file before restarting the server.

2. Core Blockchain Software

The main Saito codebase can be found in the /lib/saito directory. You should not need to touch anything in this directory.

3. API for Module Development

We are working on a set of tutorials to get developers up-and-running quickly with application development. In the meantime, the easiest way to start is by looking at the modules directory and checking out how the existing modules work.

Saito is an extremely flexible and powerful system. All of the modules inherit from a base class (/lib/templates/modtemplate.js) that allows the modules to run functions at various convenient points (such as when a transaction is received, or when a new block is added to the blockchain).
All modules

As above, we are working to develop a set of tutorials that explain how to do everything from write a simple email-plugin to creating a fully-featured encrypted chat client. If you would like to build something and are not clear about how exactly it can be done in Saito, get in touch with us and we’ll help you get things moving.