A simple wrapper to the mam.client for NodeJs
The full article was originally published by tangleMesh on Medium. Read the full article here.
The IOTA Foundations has published a great new “second layer data communication protocol” for publishing messages with ensured integrity and security. This protocol runs on the decentralized tangle, so everyone has access to it and can use it for free. If you want to read more about this protocol, you should read the great article from the IOTA Foundation: Introducing masked Authenticated Messaging
We’ve used this new protocol introduced by the IOTA Foundation to enable messaging and queueing services to any developer for free or with additional functionality for a small fee. How this service works and what it is about can be read in our previous article. This article focuses on using the Message and Queue Service in a development environment.
For this purpose the IOTA Foundation has already published a neat package the mam.client.js. You can have a look on the code basis for developing NodeJs applications on their github account. We had a look on this package and liked the functionality of it and what possibilities it provides. But we have thought about how to make the use of MAM in companies or private projects even easier. That’s why we decided to write a simple and easy to use wrapper in NodeJs.
We have set ourselves the requirement that MAM messaging must be even easier to understand as a user and the application must look simpler, especially in existing projects. This wrapper uses the functions of the mam.client.js internally, but is based on an object-oriented approach and makes the use of the protocol even more modular.
A few new components have been introduced that allow a simple abstraction of the MAM construct: Provider, Stream and Message.