The MESG product update this month spans two versions of Core v0.3.0 and v0.4.0, plus a new mesg-js version 1.4.0.  There are plenty of new features to cover, so let's get started!

New Core features include:

  • Multiple Cores running on the same computer.
    Allowing multiple copies of MESG Core to run on the same computer is the first step in the implementation of the network. It increases flexibility in implementation by allowing the testing of the network without requiring the involvement of multiple computers.
  • Configuration of the CLI’s output with --no-color and --no-spinner flags. Colorize JSON
    We’ve created a better general user experience while using the CLI. Once servers start, apps can now automatically execute MESG-related functionalities using a CLI.
CLI%20Output
  • Added required validations on Services’ task, event and output data
    We’ve added more validations and tests for the development of Services. Each time you deploy a Service, you will receive feedback from Core, helping improve the development workflow of the Service.
  • BREAKING CHANGE. Added support for .dockerignore, and removed support of .mesgignore
    Please rename .mesgignore to .dockerignore as a solution to this breaking change. This was done in order to ensure easier adoption and increased compatibility between Docker and MESG.
  • Call dependency of a MESG Service
    You can now access the dependencies of your service through the Network. This is really helpful if you want to integrate, for example, a database, a blockchain client or anything else you need to connect to that exposes a server. You can find an example in the documentation.
  • Executions stored in a database
    Each execution done by your application is now saved in a database. This considerably reduces the memory required by mesg-core, and is a step towards reaching decentralized functionality.

Check out Github for a complete list of new, updated and removed features in Core V0.3.0, and Core V0.4.0.

To update to the latest version follow the installation process on the documentation

MESG-js v1.4.0

A new version of the mesg-js library has been released: v1.4.0.

This version brings exciting new features to application developers, such as:

  • Filtering data
  • Execution tags

Filtering data

It’s now possible to filter any data being listened to from events and results.
This enables a more customized and granular flow in your applications.

whenEvent

MESG.whenEvent({
  serviceID: 'xxx',
  eventKey: 'xxx',
  filter: function (eventKey, eventData) {
    // Filter here is based on the eventKey (string)
    // or the eventData (object) containing all the event's data
    return true
  }
}, taskDefinition)

whenResult

MESG.whenResult({
  serviceID: 'xxx',
  outputKey: 'xxx',
  filter: function (outputKey, outputData, taskKey, tags) {
    // Filter here is based
    // on the result's outputKey (string)
    // or the result's outputData (object) containing all the data from the result
    // or the result's taskKey (string)
    // or the result's tags ([]string) containing the execution's tags
    returns true
  }
}, taskDefinition)

You may notice the introduction of execution tags, keep reading for more info 😉

Execution tags

A task’s executions can now accept tags.
You can attribute a list of tags to the task executions, then create task’s result filter based on them.
The tags system is powerful and customizable, as tags are not passed onto services.
You can create your own business-oriented logic without having to stick with the services’ logic.

Tags can help you to:

  • categorize a task’s executions
  • add metadata to executions
  • filter based on data which is not related to the task’s input and output data

There are two different ways to attribute tags to task’s executions:

Static definition

MESG.whenEvent(eventDefinition, {
  serviceID: 'yyy',
  taskKey: 'yyy',
  inputs: { foo: 'bar' },
  tags: [
    'metaX',
    'metricsA',
    ...
  ]
})

Dynamic definition

whenEvent

MESG.whenEvent(eventDefinition, {
  serviceID: 'yyy',
  taskKey: 'yyy',
  inputs: { foo: 'bar' },
  tags: function (eventKey, eventData) {
    // Create the tags ([]string) here based
    // on the eventKey (string)
    // or the eventData (object) that contains all the event's data
    return [
      eventKey,
      eventData.foo
    ] 
  }
})

whenResult

MESG.whenResult(resultDefinition, {
  serviceID: 'yyy',
  taskKey: 'yyy',
  inputs: { foo: 'bar' },
  tags: function (outputKey, outputData, taskKey, tags) {
    // Create the tags ([]string) here based 
    // on the result's outputKey (string)
    // or the result's outputData (object) containing all the data from the result
    // or the result's taskKey (string)
    // or the result's tags ([]string)
    return [
      outputKey,
      outputData.foo,
      taskKey,
      tags.foo
    ] 
  }
})

Update to the latest versions by following the installation process on the documentation.