{"id":15532093,"url":"https://github.com/dexhunter/smart-contract-comparison","last_synced_at":"2025-09-21T17:18:22.130Z","repository":{"id":80231383,"uuid":"374601465","full_name":"dexhunter/smart-contract-comparison","owner":"dexhunter","description":"Collections of Smart contracts/Chaincodes Examples based on Industry/Category","archived":false,"fork":false,"pushed_at":"2021-08-25T07:15:16.000Z","size":1488,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T17:54:06.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dexhunter.png","metadata":{"files":{"readme":"README-cn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-07T09:04:11.000Z","updated_at":"2021-08-25T07:15:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"2549c62a-5747-476f-9d9a-b81544276bbe","html_url":"https://github.com/dexhunter/smart-contract-comparison","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"66dbc7bdbe2227710d375d5677e9fda107f2bf7f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dexhunter/smart-contract-comparison","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexhunter%2Fsmart-contract-comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexhunter%2Fsmart-contract-comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexhunter%2Fsmart-contract-comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexhunter%2Fsmart-contract-comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dexhunter","download_url":"https://codeload.github.com/dexhunter/smart-contract-comparison/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexhunter%2Fsmart-contract-comparison/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276273655,"owners_count":25614220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-02T11:29:05.445Z","updated_at":"2025-09-21T17:18:22.098Z","avatar_url":"https://github.com/dexhunter.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 区块链评测工具\n\n## 参考工具\n\n* [caliper](https://github.com/hyperledger/caliper)\n* [tape](https://github.com/Hyperledger-TWGC/tape)\n     ![](https://i.imgur.com/cY86Pfk.png)\n\n* 信通院的trustedbench（目前还没开源）\n* [BlockchainPerformanceMonitoring](https://github.com/InPlusLab/BlockchainPerformanceMonitoring) from paper *A Detailed and Real-time Performance Monitoring Framework for Blockchain Systems*\n    * parses only `TPS`, `starttime`, `endtime`, `txconfirmedcount`\n\n# 智能合约性能测试报告\n\n*基于超级账本性能测试白皮书（[原文地址](https://www.hyperledger.org/learn/publications/blockchain-performance-metrics)）*\n\n\n## 性能指标 (Key Metrics)\n\n\n* 只读操作延迟 Read Latency\nRead Latency = Time when response received - submit time\n只读操作延迟=收到响应的时间–提交时间\n只读操作延迟是指当只读操作提交时和服务器接收到时中间的一段时间\n\n* 只读操作吞吐量 Read Throughput/TPS\nRead Throughput = Total read operations / total time in seconds\n只读操作吞吐量=总读取操作数/总时间（秒）\n只读操作吞吐量是指一个在规定的时间段内完成多少个读取操作的度量，用每秒读取数（Rate Per Second, RPS）表示。\n\n* 交易确认延迟 Transaction Latency\nTransaction Latency = (Confirmation time @ network threshold) – submit time\n交易确认延迟=（确认时间@网络阈值）–提交时间\n交易确认延迟是指从提交到结果在网络中广泛可用的时间，包括传播时间和由于共识机制而产生的任何稳定时间。\n\n\n* 交易吞吐量 Transaction Throughput/TPS\nTransaction Throughput = Total committed transactions / total time in seconds @ #committed nodes\n交易吞吐量=提交的事务总数/总时间（秒）@ 已提交节点数\n交易吞吐量是区块链SUT在规定的一段时间内提交有效交易的速率。请注意，这不是单个节点的速率，而是整个SUT的速率，即在网络的所有节点上提交的速率。此速率以网络大小的每秒交易数（Transaction Per Second， TPS）表示。\n\n\n* 交易成功率 Transaction Success Rate\n* 系统可扩展性 Scalability\n* 系统容错性 Fault Tolerance\n    *note: test if the system is still working when some nodes fail*\n    * CFT crash fault tolerance\n        * kafka\n        * raft\n    * BFT byzantine fault tolerance\n        * PBFT\n* 资源利用率（CPU，网络，磁盘，能耗等等）\n\n\n## 智能合约分类及描述\n\n\n* 贸易\n    * 商业票据 [Commercial Paper](https://github.com/hyperledger/fabric-samples/tree/main/commercial-paper)\n        * 参与方及功能 Participants\n            * **Digibank**\n                * 发行 Issue\n            * **Magnetcorp**\n                * 购买 Buy\n                * 赎回 Redeem\n                * 查询 Queries\n* 物流\n    * 供应链案例 [Supplychain Example](https://github.com/xcottos/convector-example-supplychain-master)\n        * 智能合约将记录商品物流详情，商品从生产厂家生产出一直到消费者手里，商品信息都会上链\n        * 参与方及功能\n            + 供应商 **Supplier**\n                + rawMaterialAvailable: is a number that expresses the quantity of raw material available to be supplied\n            + 生产工厂 **Manufacturer**\n                + rawMaterialAvailable: is a number that expresses the quantity of raw material available to be used for creating products\n                + productsAvailable: is a number that expresses the quantity of products ready to be distributed\n            + 运输中转 **Distributor**\n                + productsToBeShipped: is a number that expresses the quantity of products ready to be shipped\n                + productsShipped: is a number that expresses the quantity of products shipped\n                + productsReceived: is a number that expresses the quantity of products shipped that have been received.\n            + 零售商 **Retailer**\n                + productsOrdered: is a number that expresses the quantity of products ordered\n                + productsAvailable: is a number that expresses the quantity of products available for being sold\n                + productsSold: is a number that expresses the quantity of products that have been sold\n            + 顾客 **Customer**\n                + productsBought: is a number that expresses the quantity of products bought\n            + helper functions\n                + **createSupplier**: creates a Supplier\n                + **createManufacturer**: creates a Manufacturer\n                + **createDistributor**: creates a Distributor\n                + **createRetailer**: creates a Retailer\n                + **createCustomer**: creates a Customer\n                + **getAllSuppliers**: shows all the created Suppliers\n                + **getAllManufacturers**: shows all the created Manufacturers\n                + **getAllDistributors**: shows all the created Distributors\n                + **getAllRetailers**: shows all the created Retailers\n                + **getAllCustomers**: shows all the created Customers\n                + **getAllModels**: shows all the created Models\n\n* 文娱\n    * [Simple Ping Pong Game](https://github.com/cnnrznn/fabric-samples/blob/release-1.4/chaincode/fabcar/javascript/lib/fabcar.js)\n        * Based on fabcar example\n        * The transacions per block was reduced to one to eliminate the latency of compiling a block\n* 社会公共服务\n    * 可信身份 [TrustID](https://github.com/hyperledger-labs/TrustID)\n        * 去中心化的数字身份系统\n        * 个人身份 Individual Identity\n            * 独一无二的去中心化身份号码 DID\n            * 公钥 PublicKey\n            * 身份持有人 Controller\n            * 权限 Access\n        * 服务身份 Service Identity\n            * 独一无二的去中心化身份号码 DID\n            * 智能合约名称 Name\n            * 是否是公开的服务 Public\n            * 权限 Access\n            * 服务持有人 Controller\n* 金融\n    * 国际金融区块链 [IBM/global-financing-blockchain](https://github.com/IBM/global-financing-blockchain)\n        * 参与方及功能 Participants\n            * 基于`订单(Order)`的智能合约\n                * 订单状态包含 Created, Bought, Cancelled, Ordered, ShipRequest, Delivered, Delivering, Backordered, Dispute, Resolve, PayRequest, Authorize, Paid, Refund, Refunded\n            * 买家\n                * 创建订单\n            * 卖家\n                * 联系供应商\n            * 物流\n                * 运输物品\n            * 金融公司\n                * 中转交易费用给卖家\n\n        ![](https://i.imgur.com/7x2AH7s.png)\n\n        \n* 政务\n    * 市民脉搏 [citizen-pulse](https://github.com/hyperledger-labs/citizens-pulse)\n        * 一个基于超级账本Fabric去中心化的市民参政议政平台\n        * 主要内容为针对Plan的CRUD操作\n        * CRUD OPs\n            * Plan\n            * PlanPriveteDetails\n* 知识产权\n    * [fabric-ipn-contract](https://github.com/mickeymond/fabric-ipn-contract/blob/master/src/contracts/CopyrightContract.ts)\n        * 知识产权上链\n        * 主要内容为针对Copyright的CRUD操作\n        * CRUD OPs\n            * Copyright\n* 社交\n    * forum content to chain (example not found on chaincode)\n        * solidty\n* 日常消费\n    * 物流链案例 Supply Chain Example\n        * [fabric-supply-chain](https://github.com/jiaxyan/fabric-supply-chain/blob/master/example01/chaincode.go)\n            * ProductName\n            * Supplier\n            * ArrivedTime\n            * Singature\n        * 自动生产框架 [Automation Framework](https://github.com/hyperledger-labs/blockchain-automation-framework/blob/master/docs/source/example/supplychain.md)\n            * 物品信息上链\n            * [chaincode](https://github.com/hyperledger-labs/blockchain-automation-framework/blob/master/examples/supplychain-app/fabric/chaincode_rest_server/chaincode/supplychain/Common.go)\n            * trackingID\n            * type\n            * health\n            * location\n            * containerID\n            * custodian\n            * timestamp\n            * contents\n            * participants\n* 工业\n    * 物流链\n\u003c!--     * Fabric机器 [Fabric-Machine](https://github.com/hyperledger-labs/fabric-machine)\n        * 基于FPGA的硬件加速器 --\u003e\n* 农业\n    * 精准农业 [Precision Farming](https://github.com/manilpuri9/hyperledger-fabric-precision-farming)\n        * 针对农作物(Crop)的操作，包含以下属性\n            * `GeoLocation`\n            * `FarmInfo`\n            * `Temperature`\n            * `Pressure`\n            * `Humidity`\n            * `Radiation`\n            * `Moisture`\n            * `Nitrogen`\n            * `Phosphorus`\n            * `Weather`\n            * `SoilCondition`\n* 能源\n    * 去中心化的能源交易 [Decentralized Energy](https://github.com/IBM/decentralized-energy-fabric-on-IBP20)\n        * 参与方 Participants\n            * 住户 **Residents**\n            * 银行 **Banks**\n            * 功能公司 **utilityCompanies**\n            * 身份地图 **identityMap**\n        * Functions\n            * 能源交易 EnergyTrade\n            * 现金交易 CashTrade\n* 教育\n    * 教育链 [eduCC](https://github.com/kevin-hf/education/blob/master/chaincode/eduCC.go)\n        * 数据上链，进行CRUD操作\n        * 简单的数据存储\n* 医疗\n    * [substra-chaincode](https://github.com/Substra/substra-chaincode)\n        * 基于一个保证安全可信的机器学习任务分发框架\n        * 参与方 Participants\n            * 数据管理员 DataManager\n                * 数据 DataSamples\n                * 算法 Algo\n                * 任务 Objective\n                * 设置 Traintuple\n            * 医院\n                * 训练数据 Train DataSamples\n                * 测试数据 Test DataSamples\n        * 功能 Functions\n            * CRUD\n            * log\n            * query\n\n![](https://doc.substra.ai/_images/architecture_overview.png)\n\n\n\n## Appendix 附录\n\n* 测试系统\n\n显示了区块链性能评估的典型配置。左侧的测试线束在右侧显示了用于针对被测系统（SUT）生成负载的程序和系统。图1中的每个术语都在本节中定义。\n![](https://i.imgur.com/mmYMd3h.png)\n\n* 测试工具\n\n测试工具是用于运行性能评估的硬件和软件。这个测试工具通常代表许多客户机，这些客户机可以注入工作负载并在任意数量的节点上进行观察。\n\n* 客户\n\n一个客户是可以将工作引入系统或调用系统行为的实体。在区块链系统中，通常在多个级别上有多种类型的客户端。\n\n一个负载生成客户端代表用户向区块链网络（SUT）提交交易的节点，通常遵循自动测试脚本。客户机和SUT之间的接口可以从简单的表示状态转移（REST）接口到全面的软件开发工具包（SDK）。根据接口的不同，客户机可以是无状态的，也可以是有状态的。\n\n一个观察客户是一个节点，它接收来自SUT的通知，或者可以查询SUT有关已提交事务的状态，通常在自动测试脚本之后。可以有多个观察客户端。观察客户端不能提交任何新事务。\n\n* 测试系统(SUT)\n\n定义被测系统（SUT）是一个复杂的问题。在本文档中，SUT被定义为运行和维护区块链所需的硬件、软件、网络和具体配置。或不包括任何用于加速读取外部数据库的时间。\n\n* 节点\n\n在区块链网络的上下文中，节点是一个独立的计算实体，它与网络中的其他节点通信，共同协作完成交易。\n\n节点是一个虚拟实体，从某种意义上说，它可以运行在物理硬件上，也可以作为VM或容器化环境运行。在后一种情况下，节点可以与同一网络中的其他节点共享物理硬件。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexhunter%2Fsmart-contract-comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdexhunter%2Fsmart-contract-comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexhunter%2Fsmart-contract-comparison/lists"}