What are topics?
In Synternet's Data Layer (DL), a topic represents a specific stream of blockchain data made available for consumption by developers and applications. Topics are granular units that encapsulate different types of data within a blockchain network. Each topic is designed to cater to a particular aspect or event within the blockchain, enabling developers to access and process only the data they require, minimizing unnecessary data consumption and optimizing performance.
The example of a topic would be synternet.ethereum.tx
- this would imply that the given data stream is provided by Synternet, as a data provider and contains transactions that happened in the Ethereum network.
To interact with a specific topic, developers can utilize Synternet's provided Software Development Kits (SDKs) tailored for different programming languages like Go, Python, JavaScript, Rust, and Web Sockets. These SDKs empower developers to seamlessly integrate their applications with the Data Layer and efficiently consume the data from their chosen topics.
Example: Ethereum
Let's dig deeper into Ethereum-based examples
In Synternet's Data Layer, Ethereum data stream offers developers access to three specific topics, each catering to distinct aspects of the Ethereum blockchain. These topics enable developers to fine-tune their data consumption and focus only on the information relevant to their dApp's requirements, reducing unnecessary data usage and optimizing performance.
synternet.ethereum.tx: This topic contains Ethereum chain transaction data. Developers can subscribe to this topic to gain real-time access to transactional activities occurring on the Ethereum blockchain. Whether it's monitoring token transfers, smart contract interactions, or any other transactions, this topic provides detailed insights into the movements and activities within the Ethereum network.
{
"hash": "0xd333dba850a9f6829d3e364d48e16711b36588df01fecab872e639bf4521a878",
"value": "0",
"gas": 5000000,
"gasPrice": 70101747780,
"nonce": 749,
"from": "0x8A2c9eD8F6B9aD09036Cc0F5AAcaE7E6708f3D0c",
"to": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
}synternet.ethereum.block: The second topic contains Ethereum chain block data. By subscribing to this topic, developers can access crucial information about individual blocks on the Ethereum blockchain. This data includes block headers, timestamps, block numbers, and other relevant details. Utilizing this topic, developers can closely track the block-level events and trends on the Ethereum blockchain.
{
"blockHash": "0x92696d170ade3c42c22a09889c4515613e411eef902965edeb3704678a69d6ec",
"blockNumber": 16918918,
"time": 1679922551,
"nonce": 0,
"transactionsCount": 140
}synternet.ethereum.header: The third topic provides access to Ethereum chain header data. Subscribing to this topic offers developers an overview of Ethereum blockchain headers, which include key metadata and information about blocks.
{
"parentHash": "0x98c03280f363f199408a28a7f89ee55b46bbf3a2aa19ade5f5e8499d14de2ccf",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5",
"stateRoot": "0x4b2fb0145298ce4af3319d4ab54518fed2d8a6da20f5db37b96ee4b495b32b44",
"transactionsRoot": "0x0bf256ec967ca1daf70486a43d3aaf5a29eed96716e51f6dd09c8725e5d761a9",
"receiptsRoot": "0xf5227fb121df18bc3704c25f6c2a04f27924bd5f3ce77cd49b01dfb40bc85d77",
"logsBloom": "0x9031400e19950929b2201a70e37996a305a49c7b4ded0c585c1f8ce99f110c07368d93b2889c4a48153c380050080d358208b638c8d5ad0ea3180c8050e54967d170e9f042bcb82a6d02430ef3b402f4ea3e94c8ca73fc4bb41f7d548821be065e686b22bfd63b2f46249a682812795f9a3eb41e69903d3d76008ddd04db359c832987174ab09149b7e958040ef94ef68d2587e947c34d58f5f082d0f93d7aab8bca01ef0b03689bf51ac1f3aa1b6689e26adff6e1ea0236ab649d61247b11584fa8dd271e8b0e0607088b861f75f516450bc328b53328376a1420ca5ab5b047057c360b98845a808a167ea3b89542429d78407073ac16c2174adcd3ff613859",
"difficulty": "0x0",
"number": "0x1022986",
"gasLimit": "0x1c9c380",
"gasUsed": "0xb1d0ba",
"timestamp": "0x64219577",
"extraData": "0x6265617665726275696c642e6f7267",
"mixHash": "0xda35193d5dd48b080f4e13113d4f6d40cf51e8c4d649182cbc9059647ea3da3c",
"nonce": "0x0000000000000000",
"baseFeePerGas": "0x564ccde44",
"hash": "0x92696d170ade3c42c22a09889c4515613e411eef902965edeb3704678a69d6ec"
}
As a developer, you have the flexibility to choose the topics you want to subscribe to within the Ethereum data stream. This subscription-based approach allows you to tailor your data consumption to match your dApp's specific needs. By selecting relevant topics, you ensure that your application receives precisely the data it requires, enhancing efficiency, and optimizing resource usage.
For a more comprehensive understanding of each stream and its specific topics, we encourage you to explore the detailed documentation provided for each stream within the Developer Portal. In the documentation, you will find in-depth information about the available topics, their structures, and their potential use cases.