Developer Fundamentals
Listen to Changes
Learn to subscribe to blockchain updates on VeChainThor using WebSockets. This lesson covers real-time event tracking, block notifications, and transaction monitoring for responsive app behavior.
What You Will Learn in This Chapter
In this chapter, you'll explore how to effectively monitor real-time changes on the VeChainThor blockchain, enabling your apps to respond promptly to various events.
By leveraging WebSockets, you can reduce the need for frequent polling and enhance the efficiency of your applications.
This final chapter will equip you with the knowledge required to listen to changes on VeChain effectively. This will allow you to build responsive and dynamic apps that integrate seamlessly with the VeChainThor blockchain's real-time data streams.
I. Event Subscriptions: Learn how to receive streams of contract-emitted events, allowing your apps to react to specific occurrences on the blockchain.
II. Block Notifications: Understand how to get notified about new blocks appended to the blockchain, facilitating up-to-date data handling.
III. VET Transfer Monitoring: Discover methods to track VET token transfers between addresses in real time, enhancing transaction transparency.
IV. Pending Transactions: Explore techniques to listen to transactions added to the transaction pool, enabling proactive transaction management.
V. Heartbeat Signals: Utilize "beats" messages sent with each new block to detect changes on the blockchain efficiently.
Example Data
The example below will utilize the VTHO contract, which manages VeChain's VTHO Token.
Smart Contract Address: 0x0000000000000000000000000000456e65726779
The contract's source code can be found on GitHub. We invite you to take a look to learn how Solidity smart contracts are structured. Its Application Binary Interface (ABI) is shared on b32, a repository that gathers publicly available interfaces for VeChain projects.
Join our Telegram