Web3alert x Celestia: A Technical Dive Into How Integration is Made
Introduction
In this article we will tell about what is Web3alert, what is Celestia, what is the Celestia-ITN project in Web3alert, how to get alerts about Celestia on-chain events and and how the integration is built.
What is Web3alert?
Web3alert is an alert notification service that allows users to receive real-time and reliable alerts for events happening on the blockchain. With the increasing popularity of blockchain technology, it has become necessary for users to have a platform that can provide them with timely notifications for important blockchain transactions. By using Web3alert, users can receive alerts for various events such as token transfers, governance proposals, and smart contract executions.
Web3alert is highly customizable, allowing users to set up alerts based on their specific needs. Users can choose which events they want to be alerted for, and they can also choose the notification method (e.g. Telegram, Discord, Slack and more to come). This makes it a powerful tool for developers and businesses looking to monitor blockchain activity in real-time.
Overall, Web3alert is a reliable and powerful solution for anyone looking to stay informed about blockchain activity. Whether you’re a developer, trader, or blockchain enthusiast, Web3alert can help you stay ahead of the curve.
What is Celestia and Celestia-ITN project in Web3alert?
Celestia is a modular consensus and data network, built to enable anyone to easily deploy their own blockchain with minimal overhead.
Recently, they’ve launched Incentivised Testnet (ITN) called Blockspace Race to test everything out before launching mainnet. For that testnet we’ve built the Celestia-ITN project to iron it out before Celestia Mainnet and also to help testers do their job: for example, by allowing them to receive alerts about new governance proposals.
How to get these alerts?
- Go to https://web3alert.io/celestia-itn and Log in with Telegram if you haven’t already
- After you have logged in, click Add an alert
- Choose Event and calls, then Gov module and Submit proposal event. Then click Next step
- No filters are needed. Click Next step again
- Finally, choose messengers to receive alerts and click Save alert
- That’s it. You will see your dashboard with the new alert. The notification in Telegram about new proposal will look like this
Technical part
Source code for back-end is available in the repo https://github.com/web3alert/celestia
What is actually in the repository?
There is a Stream service that has an API interface:
— enumerate. A list of all possible values/combinations of params, with metadata for each combination;
— process. It exports events in a specified range of blocks and outputs them in a format suitable for web3alert.
How enumerate is implemented?
We parse proto-files and extract from them structures describing all messages in all modules. We directly obtain Celestia events from the source code of the modules. All data is formatted into structures suitable for web3alert.
How process is implemented?
The service has a state — a network block. By changing this state (block), new requests are made to the Celestia blockchain node, and information about all events and messages in the block is collected. Some custom data processing is also applied — for example, the display of token values.
How do we get information from blockchain?
We get a block via the API: cosmos/base/tendermint/v1beta1/blocks/${height}
https://github.com/web3alert/celestia/blob/master/src/cosmos/provider/cosmos-api-provider.ts#L240
Then we get a transaction via the API:cosmos/tx/v1beta1/txs/${hash}
https://github.com/web3alert/celestia/blob/master/src/cosmos/provider/cosmos-api-provider.ts#L245
How custom data processing is done for token values?
We recursively traverse all the arguments in an event or message, and if we encounter a balance, we replace it with a more readable format. We discover the token information via the API: cosmos/bank/v1beta1/denoms_metadata/${denom}
Here’s the link to the relevant part of the code in the GitHub repository: https://github.com/web3alert/celestia/blob/master/src/cosmos/provider/cosmos-api-provider.ts#L251
The link to the method code for balances is: https://github.com/web3alert/celestia/blob/master/src/cosmos/provider/cosmos-api-provider.ts#L176
Subscribe and reach us through
Web3alert.io | Twitter | Telegram Announcements | Telegram Chat
The team welcomes your feedback and encourages you to share your thoughts via our Telegram chat . Bug reports, ideas, opinions are all welcome.