Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Blockchain Developer's Guide

You're reading from   Blockchain Developer's Guide Develop smart applications with Blockchain technologies - Ethereum, JavaScript, Hyperledger Fabric, and Corda

Arrow left icon
Product type Course
Published in Dec 2018
Publisher
ISBN-13 9781789954722
Length 564 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (4):
Arrow left icon
Paul Valencourt Paul Valencourt
Author Profile Icon Paul Valencourt
Paul Valencourt
Brenn Hill Brenn Hill
Author Profile Icon Brenn Hill
Brenn Hill
Narayan Prusty Narayan Prusty
Author Profile Icon Narayan Prusty
Narayan Prusty
Samanyu Chopra Samanyu Chopra
Author Profile Icon Samanyu Chopra
Samanyu Chopra
Arrow right icon
View More author details
Toc

Table of Contents (37) Chapters Close

Title Page
Copyright
About Packt
Contributors
Preface
1. Blockchain 101 FREE CHAPTER 2. Components and Structure of Blockchain 3. Decentralization Versus Distributed Systems 4. Cryptography and Mechanics Behind Blockchain 5. Bitcoin 6. Altcoins 7. Achieving Consensus 8. Advanced Blockchain Concepts 9. Cryptocurrency Wallets 10. Alternate Blockchains 11. Hyperledger and Enterprise Blockchains 12. Ethereum 101 13. Solidity 101 14. Smart Contracts 15. Ethereum Accounts and Ether Tokens 16. Decentralized Applications 17. Mining 18. ICO 101 19. Creating Your Own Currency 20. Scalability and Other Challenges 21. Future of Blockchain 22. Understanding Decentralized Applications 23. Understanding How Ethereum Works 24. Writing Smart Contracts 25. Getting Started with web3.js 26. Building a Wallet Service 27. Building a Smart Contract Deployment Platform 28. Building a Betting App 29. Building Enterprise Level Smart Contracts 30. Building a Consortium Blockchain 1. Other Books You May Enjoy Index

What are event topics?


Topics are values used for indexing events. You cannot search for events without topics. Whenever an event is invoked, a default topic is generated, which is considered the first topic of the event. There can be up to four topics for an event. Topics are always generated in the same order. You can search for an event using one or more of its topics.

The first topic is the signature of the event. The rest of the three topics are the values of indexed parameters. If the index parameter is string, bytes, or array, then the keccak-256 hash of it is the topic instead.

Let's take an example to understand topics. Suppose there is an event of this form:

event ping(string indexed a, int indexed b, uint256 indexed c, string d, int e); 

//invocation of event 
ping("Random String", 12, 23, "Random String", 45);

Here, these four topics are generated. They are as follows:

  • 0xb62a11697c0f56e93f3957c088d492b505b9edd7fb6e7872a93b41cdb2020644: This is the first topic. It is generated using...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime