MESG Engine v0.10, JS CLI and JS library v3.0.0 Release Notes

Renaming Core to Engine

Following the introduction of the MESG SDK, we are renaming MESG Core to MESG Engine to better describe what the software does and how it fits within the SDK.

The CLI has also been extracted to a dedicated repository. See the New CLI section.

Service task output simplification

This newest version of the Engine includes a massive simplification for service development!

Services can now define a single output per task (containing many parameters) rather than many outputs per task.

We found that most services implemented one success output and one error output, with the success output returning the result of the execution and the error output returning the error message. Services implementing more than two outputs can be easily converted to two outputs by combining the outputs’ data into one payload.

This improves the executions’ state machine by letting the Engine know which output is the expected one, and enables the retry system when executions fail. This is very important when the decentralized network is implemented so unexpected execution errors can be tolerated!

I encourage you to check out our latest Product Update to learn more about the roadmap, and why this feature is so important.

Here is a diff of a task definition:

        type: String
        type: String
        type: String
        type: String
-     success:
-       data:
-         status:
-           type: Number
-     error:
-       data:
-         message:
-           type: String
+     status:
+       type: Number

This simplification also makes the implementation of tasks much easier.

We’ve updated the mesg-js library to catch errors and send outputs to the Engine so your services don’t have to. If the task throw any error, the lib will catch it and send it to the Engine.

Let’s take a look at the implementation diff of this task in JavaScript using mesg-js:

- const send = async (inputs, outputs) => {
+ const send = async (inputs) => {
- try {
  const result = await sendgrid.send(inputs)
- return outputs.success({
-   status: result[0].statusCode
- })
+ return {
+   status: result[0].statusCode
+ }
- } catch (error) {
-   return outputs.failure({
-     message: error.toString()
-   })
- }

:confetti_ball: That’s 50% fewer lines of code for this simple task! :confetti_ball:


We are also releasing v1 of a new CLI in Javascript.

We’ve created a new CLI for two reasons:

  • To separate the CLI from the Engine repository
    We were struggling with keeping the cli and the engine implementation as separate as possible because both were developed in Go and used many packages in common.
  • To use Javascript
    Javascript is a massively-used language across many ecosystems and is known by almost every developer. We want to build tools that the community can easily contribute to and extend as they see fit. Also, we plan to create User Interfaces to manage MESG Engine with ease. There are a lot of tools to create powerful and flexible UIs using Javascript that can reuse the CLI source code.

You can install it by running the following command:

npm install -g mesg-cli

You can also checkout its github repo: mesg-foundation/cli.

We had some issues during the release process of the CLI and had to release it under v1.0.4. So don’t worry about missing any updates, because there weren’t any :upside_down_face:

For the complete changelog of the MESG Engine, refer to the changelog on Github.

For the complete changelog of mesg-js library, refer to the changelog on Github.

To update to v0.10, follow the installation process on the documentation

1 Like