{"id":22350133,"url":"https://github.com/gcp-development/event-streaming-platform","last_synced_at":"2026-05-05T21:38:57.464Z","repository":{"id":64170559,"uuid":"571103330","full_name":"gcp-development/event-streaming-platform","owner":"gcp-development","description":"Event Streaming Platform (Blockchain)","archived":false,"fork":false,"pushed_at":"2023-02-06T07:20:19.000Z","size":318,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T11:32:17.423Z","etag":null,"topics":["blockchain","event-driven-architecture","kafka","kafka-streams","kubernetes","minikube","proof-of-stake","web3"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gcp-development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-27T06:54:59.000Z","updated_at":"2023-02-06T07:20:49.000Z","dependencies_parsed_at":"2023-02-19T05:16:10.282Z","dependency_job_id":null,"html_url":"https://github.com/gcp-development/event-streaming-platform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gcp-development/event-streaming-platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcp-development%2Fevent-streaming-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcp-development%2Fevent-streaming-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcp-development%2Fevent-streaming-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcp-development%2Fevent-streaming-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcp-development","download_url":"https://codeload.github.com/gcp-development/event-streaming-platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcp-development%2Fevent-streaming-platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32669433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","event-driven-architecture","kafka","kafka-streams","kubernetes","minikube","proof-of-stake","web3"],"created_at":"2024-12-04T11:10:20.201Z","updated_at":"2026-05-05T21:38:57.431Z","avatar_url":"https://github.com/gcp-development.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Event Streaming Platform (Blockchain)\n\n## Motivation\n\nBlockchain and Kafka are complementary, Kafka and the notion of blockchain share many traits, such as immutability, replication, distribution, and the decoupling of applications. This complementary relationship means that we are able to extend the functionality of a given DLT(distributed ledger technology) through sidechain or off-chain activities, such as analytics, integrations with traditional enterprise systems, or even the integration of certain chains and ledgers. \n \n\u003chr\u003e\n\n## Table of Contents\u003cbr\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#kafka-and-kubernetes\" target=\"_self\"\u003eKafka and Kubernetes\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform/blob/main/README.md#blockchain\" target=\"_self\"\u003eBlockchain\u003c/a\u003e\u003c/li\u003e \n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#block-overview\" target=\"_self\"\u003eBlock Overview\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#blockchain-overview\" target=\"_self\"\u003eBlockchain Overview\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#consensus-mechanism\" target=\"_self\"\u003eConsensus Mechanism\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e \u003ca href=\"https://github.com/gcp-development/event-streaming-platform#implementation\" target=\"_blank\"\u003eImplementation\u003c/a\u003e\u003c/li\u003e\n \u003cul\u003e\n  \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#1-run-the-blocks-consumer\" target=\"blank\"\u003e1) Run the blocks-consumer\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#2-run-the-block-processor\" target=\"blank\"\u003e2) Run the block-processor\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform#3-run-the-transactions-producer\" target=\"blank\"\u003e3) Run the transactions-producer\u003c/a\u003e\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/ul\u003e\n\u003chr\u003e\n\n### Kafka and Kubernetes\n\nApache Kafka is frequently deployed on the [Kubernetes](https://kubernetes.io/) management system, which is used to automate deployment, scaling, and operation of containers across clusters of hosts. Cloud-native applications are independent, loosely coupled, and distributed services that deliver high scalability via the cloud. In the same way, the event-driven applications built on Kafka are loosely coupled and designed to scale across a distributed hybrid cloud environment.\n\n![image](https://user-images.githubusercontent.com/76512851/205594178-5de3849d-9e34-4920-ba2b-4e2326469168.png)\n\nBy integrating these technologies, this PoC creates a platform for demonstrate blockchain concepts in a simple and easy way.\n\nSouce Code:\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform/tree/main/kafka-setup\" target=\"blank\"\u003ekafka-setup\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\n\n### Blockchain\n\nWhat is Blockchain?\n\u003cul\u003e\n \u003cli\u003eBlockchain is a transaction record database that is distributed, permission less and maintained around the world by a\nnetwork of nodes.\u003c/li\u003e\n \u003cli\u003eBlockchain has a distributed group of nodes that oversee the network.\u003c/li\u003e\n \u003cli\u003eBlockchain uses decentralized technologies to provide peer-to-peer, permissionless, and immutable network to store\ntransactions.\u003c/li\u003e\n\u003c/ul\u003e\n \nA blockchain network have the following characteristics:\n\u003cul\u003e\n \u003cli\u003eNo Central Authority\u003c/li\u003e\n \u003cli\u003eVerifiability and Auditability\u003c/li\u003e\n \u003cli\u003eDisintermediation\u003c/li\u003e\n \u003cli\u003eConfidentiality and Integrity\u003c/li\u003e\n \u003cli\u003eRobustness\u003c/li\u003e\n\u003c/ul\u003e\n\nA blockchain network have the following benefits:\n\u003cul\u003e\n \u003cli\u003eNo Third-Party Intermediaries\u003c/li\u003e\n \u003cli\u003eGreater Transparency\u003c/li\u003e\n \u003cli\u003eHigh Availability\u003c/li\u003e\n \u003cli\u003eHigh Security\u003c/li\u003e\n \u003cli\u003eFaster Dealings and Cost Savings\u003c/li\u003e\n \u003cli\u003eImproved Traceability\u003c/li\u003e\n\u003c/ul\u003e\n\n#### Block overview\n\n![image](https://user-images.githubusercontent.com/76512851/206841362-e0757f53-a059-4790-a5f3-2d154e04fe34.png)\n\n\u003cul\u003e\n \u003cli\u003eBlock version, version number of the block.\u003c/li\u003e\n \u003cli\u003ePrevious block hash, the hash of the previous block.\u003c/li\u003e\n \u003cli\u003eMerkle tree root hash, Each transaction in the block is\nhashed and stored in a tree-like structure such that\n  each hash is linked to its parent.\u003c/li\u003e\n \u003cli\u003enBits, encoding of the block target. A block will be\nvalid only if the hash of its header is below the target\nvalue.\u003c/li\u003e\n \u003cli\u003eNonce, a variable decided by the miner creating the\nblock changed In order to get a block hash under\ntarget value.\u003c/li\u003e\n \u003cli\u003eTimestamp, value is a source of variation for the block\nhash.\u003c/li\u003e\n\u003c/ul\u003e\n\n#### Blockchain overview\n\n![image](https://user-images.githubusercontent.com/76512851/206840630-235d178e-b796-456f-8ec7-d85799cff948.png)\n\n\u003cul\u003e\n \u003cli\u003eBlockchain contains a list of blocks cryptographically connect to the previous block.\u003c/li\u003e\n \u003cli\u003eThe blocks are connected such that if there is any change in block(n-1) the connection between the next block will\nbreak.\u003c/li\u003e\n \u003cli\u003eThis makes very hard to change any data in blockchain.\u003c/li\u003e\n \u003cli\u003eEach block contains set of transactions data that is linked in the next blocks so that anyone can trace the origin of data.\u003c/li\u003e\n\u003c/ul\u003e\n\n##### Consensus Mechanism\n\n[Validators](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Validator.java)\n\nIn Proof of Stake blockchains, validators are selected to produce the next [block](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Block.java) based on their stake. Designed with [random functions](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/ParticipantsPool.java#L53) in order to make the selection more fairer,because a larger amount staked by a [validator](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Validator.java) could give them a higher chance of producing the next [block](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Block.java). Proposed [blocks](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Block.java) by [validators](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Validator.java) are then propagated to the rest of the network, who verify and add the approved [block](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Block.java) to the blockchain. \n\nProof of Stake(PoS)\n\nIn order to participate in PoS, the [validators](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Validator.java) has to produce some stake. In PoS the validators are selected in terms of some [selection algorithm](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/ParticipantsPool.java#L53) and the amount of stake locked in the network [(ParticipantsPool)](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/ParticipantsPool.java) and only then that [selected validator](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/ParticipantsPool.java#L53) will be allowed to add the [block](https://github.com/gcp-development/event-streaming-platform/blob/main/basic-blockchain/src/main/java/org/blockchain/Block.java). If the validator founds to be malicious, then they will lose all their stake.\n\n\u003chr\u003e\n\n### Implementation\n\n![image](https://user-images.githubusercontent.com/76512851/206766875-be6a8c1b-f274-4aa9-8389-78747e4fe1f9.png)\n\nTransactions Producer\n\n-\u003eThis [Java project](https://github.com/gcp-development/event-streaming-platform/tree/main/transactions-producer) will create the transactions for our basic blockchain.\n\nBlock Processor\n\n-\u003eThis [Java project](https://github.com/gcp-development/event-streaming-platform/tree/main/blocks-consumer) will process the transactions and create the new blocks for our basic blockchain.\n\nBlocks Consumer\n\n-\u003eThis [Java project](https://github.com/gcp-development/event-streaming-platform/tree/main/blocks-consumer) will consume the blocks.\n\nBasic Blockchain\n\n-\u003eThis [Java project](https://github.com/gcp-development/event-streaming-platform/tree/main/basic-blockchain) this library(JAR) contains the objects that form a basic blockchain.\n\n##### 1) Run the blocks-consumer\n\nAs a prerequisite the [basic-blockchain project](https://github.com/gcp-development/event-streaming-platform/tree/main/basic-blockchain) needs to create the JAR which the other projects will use.\n\nOpen the [blocks-consumer project](https://github.com/gcp-development/event-streaming-platform/tree/main/blocks-consumer) with [Intellij community](https://www.jetbrains.com/idea/download/#section=linux) and run the project.\n\nThe listener will subscribe to the blockchain topic to consume any message saved there.\n\n![image](https://user-images.githubusercontent.com/76512851/207286799-293b9ce9-bfb9-4f0f-ae08-07cb32195387.png)\n\nFor troubleshooting any issue look at the logs generated by the [log4j](https://logging.apache.org/log4j/2.x/).\n\n![image](https://user-images.githubusercontent.com/76512851/207288001-3ac6ceaf-c615-47de-b4e3-9ff550b64d20.png)\n\n##### 2) Run the block-processor\n\nOpen the [block-processor project](https://github.com/gcp-development/event-streaming-platform/tree/main/block-processor) with [Intellij community](https://www.jetbrains.com/idea/download/#section=linux) and run the project.\n\n![image](https://user-images.githubusercontent.com/76512851/207289206-19f61f41-7f73-466a-b62b-52b77075cf96.png)\n\nFor troubleshooting any issue look at the logs generated by the [log4j](https://logging.apache.org/log4j/2.x/).\n\n![image](https://user-images.githubusercontent.com/76512851/207289924-e76b7768-19d8-4739-9573-1f248ef8d872.png)\n\n##### 3) Run the transactions-producer\n\nOpen the [transactions-producer project](https://github.com/gcp-development/event-streaming-platform/tree/main/transactions-producer) with [Intellij community](https://www.jetbrains.com/idea/download/#section=linux) and run the project.\n\n![image](https://user-images.githubusercontent.com/76512851/207290392-f87e6d60-3e53-4c8c-857c-a1fb294ae0b2.png)\n\nFor troubleshooting any issue look at the logs generated by the [log4j](https://logging.apache.org/log4j/2.x/).\n\n![image](https://user-images.githubusercontent.com/76512851/207290846-ebfa1526-c571-4b55-9079-ba2ffdc59b55.png)\n\nThe [transactions-producer project](https://github.com/gcp-development/event-streaming-platform/tree/main/transactions-producer) will insert 15 transactions in the transactions topic. This transactions topic is subscribed by the [block-processor project](https://github.com/gcp-development/event-streaming-platform/tree/main/block-processor) and the blocks created inserted in the blockchain topic. \n\nThe run windows should look like this.\n\n![image](https://user-images.githubusercontent.com/76512851/207294741-7f515a90-8667-4f2d-8bfe-9dce451c392a.png)\n\nThe [blocks-consumer project](https://github.com/gcp-development/event-streaming-platform/tree/main/blocks-consumer) is subscribed to the blockchain topic which will read any message insert into the blockchain topic.\n\nThe run windows should look like this.\n\n![image](https://user-images.githubusercontent.com/76512851/207292859-50ea15d0-22a1-4a8a-8670-714c608aa0a0.png)\n\nThe Blockchain created.\n\n![image](https://user-images.githubusercontent.com/76512851/207298415-bddae0e2-e6ab-4ac0-bf0a-d5ad76fdf20c.png)\n\nSource Code:\n\u003cul\u003e\n \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform/tree/main/basic-blockchain\" target=\"_blank\"\u003ebasic-blockchain\u003c/a\u003e\u003c/li\u003e\n \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform/tree/main/transactions-producer\" target=\"_blank\"\u003etransactions-producer\u003c/a\u003e\u003c/li\u003e\n \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform/tree/main/block-processor\" target=\"_blank\"\u003eblock-processor\u003c/a\u003e\u003c/li\u003e\n \u003cli\u003e\u003ca href=\"https://github.com/gcp-development/event-streaming-platform/tree/main/blocks-consumer\" target=\"_blank\"\u003eblocks-consumer\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\nReferences:\u003cbr\u003e\n\n[Event-Driven](https://martinfowler.com/articles/201701-event-driven.html)\u003cbr\u003e\n[Benchmarking Apache Kafka: 2 Million Writes Per Second (On Three Cheap Machines)](https://engineering.linkedin.com/kafka/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines)\u003cbr\u003e\n[Peercoin Introduction to Proof-of-Stake](https://www.peercoin.net/docs/proof-of-stake)\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcp-development%2Fevent-streaming-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcp-development%2Fevent-streaming-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcp-development%2Fevent-streaming-platform/lists"}