ADAMANT is a special messenger. Each message is a transaction, and such a concept has taken the privacy and security of messaging to a new level.
A fundamentally new approach required the elaboration of tasks that are simple for classic instant messengers. One of these issues was the speed of work and the search for an effective way to receive messages.
Initially, the ADAMANT blockchain provided standard APIs for messenger applications, and they needed to fetch all transactions in order to show the correspondence. We are glad to announce that with the new API Chatrooms, created specifically for instant messengers, loading messages has become ten times more efficient, and applications have begun to consume less memory and CPU.
Check out how loading messages looks like in comparison with the previous version of the messenger:
Loading the previous version took 25 seconds and 80 MB of memory:
And the new version is 3 seconds and 28 MB of memory. This is 8 times faster.
Chatrooms provides two endpoints:
/api/chatrooms/U000000000000/U000000000001. The first receives a chat list for the
U000000000000 account, and the second receives chat messages between
U000000000001. In order not to send a lot of data, we have provided pagination. More details are in AIP 14.
To load new chats and messages, we have added a lovely animation:
Any application can use Chatrooms API, like a messenger or a bot.
To make this work, we also made changes on the nodes — they are the ones that handle application requests.
The effectiveness of switching to a new version depends on the number of messages in the account. The more messages, the more noticeable the difference.
Note that Chatrooms API downloads messages by demand, and requires an internet connection. The previous version downloaded all messages at once, and after that a user was able to view them offline.
Try the new Messenger app now:
If something goes wrong, you can use the old version of the application: legacy.adamant.im. Be sure to report bugs to us.
Here is the full list of v3.0.0 release updates:
- Chatrooms API (tens times faster, less RAM usage)
- Replace http node
- Remove Resfinex exchange and RES token
- Workaround for Lisk Service
- Fix for light/dark theme
- Fix ‘You may have an infinite update loop in a component render function’ in ADM Tx list
- Update dependencies