# Service file

# Service file

To define a Service, you will need to create a specific folder with a mesg.yml file that describes its functionalities. This file can contain the following information in a YAMLsyntax:

You can create a default file using the CLI by entering the command:

mesg-cli service:init

This will create a mesg.yml file in your current directory with the following attributes:

# Definition

Attribute Type Default Description
name String "" Each Service has a name chosen by the developer. This name is used to identify the service in a nice humanlike way.
description String "" A description that will be useful to explain the features of your service.
sid String generated A unique service name that can be set optionally. It'll be auto generated when it isn't provided. A service can have multiple deployed versions (hashes) but its sid is always fixed. SID can be used in place of service hash. When used, it'll point to the latest deployed version(hash) of the service.
events map<id, Event> {} Services must declare a list of events they can emit. Events are actions on a technology the Service is connected to.
tasks map<id, Task> {} Services declare a list of tasks they can execute. A task is an action that accepts parameters as inputs, executes something on the connected technology, and returns one output to the Engine, with data.
repository String "" The url of the repository eg: https://github.com/org/repo
configuration Dependency {} Service can specify one configuration that will be use for the main docker container of the service
dependencies map<id, Dependency> {} Services can specify internal dependencies such as a database, cache or blockchain client.

You can find an example of mesg.yml file here.