Configuring the SDK

Creating default configuration files

When you generate a project using strat generate, the wizard will prompt you for a few settings. Having to type them every time can become tedious after a while. Fortunately you can generate configuration files to set default values for the settings.

Open a terminal, then type the following command:

strat generate /path/to/home/.stratumn

Replace /path/to/home/ with the path to your home directory. This is where the SDK looks for configuration files by default.

Choose option “A Stratumn configuration” (press 2 then enter):

What would you like to generate?
1: A basic Javascript agent
2: A Stratumn configuration
? 2

You will then be prompted for a few settings, some of which will be used as default values when generating projects. The settings are saved to the file /path/to/home/.stratumn/variables.json.

Managing multiple configurations

You may wish to have multiple configurations that you can use depending on the project. You can generate as many configurations as you want, for instance:

strat generate /path/to/home/.stratumn-work

When you run strat commands, by default it looks for configuration files in /path/to/home/.stratumn. There are two ways you can override this location:

  1. pass a -c flag to strat
  2. set a STRATUMN_CONFIG environment variable

For instance, to generate a project using the configuration files in /path/to/home/.stratumn-work, you can run:

strat generate -c /path/to/home/.stratumn-work myproject

Or, using an environment variable (on Unix systems):

export STRATUMN_CONFIG=/path/to/home/.stratumn-work
strat generate myproject