{"id":19907602,"url":"https://github.com/jaerith/ethginelite","last_synced_at":"2026-04-13T09:31:28.720Z","repository":{"id":150412403,"uuid":"122131842","full_name":"jaerith/EthgineLite","owner":"jaerith","description":"A proof-of-concept business rules engine for the Ethereum platform that is inherently metadata-driven.","archived":false,"fork":false,"pushed_at":"2018-06-06T19:58:34.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T08:13:43.451Z","etag":null,"topics":["business-rules","ethereum","javascript","metadata-driven","solidity","truffle-framework"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/jaerith.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-19T23:05:35.000Z","updated_at":"2022-09-19T07:06:21.000Z","dependencies_parsed_at":"2023-06-26T01:02:05.046Z","dependency_job_id":null,"html_url":"https://github.com/jaerith/EthgineLite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaerith/EthgineLite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaerith%2FEthgineLite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaerith%2FEthgineLite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaerith%2FEthgineLite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaerith%2FEthgineLite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaerith","download_url":"https://codeload.github.com/jaerith/EthgineLite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaerith%2FEthgineLite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["business-rules","ethereum","javascript","metadata-driven","solidity","truffle-framework"],"created_at":"2024-11-12T20:43:16.034Z","updated_at":"2026-04-13T09:31:28.703Z","avatar_url":"https://github.com/jaerith.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EthgineLite\n\nA proof-of-concept business rules engine for the \u003ca target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Ethereum\"\u003eEthereum\u003c/a\u003e platform that is inherently metadata-driven, written into the form of a smart contract using the Solidity language.  Basically, after providing a number of rules and populating a record, a user can submit the populated record for validation by the rules engine.\n\n# Requirements\n\n* Basic knowledge of Ethereum and some experience with Javascript\n* An installation of \u003ca target=\"_blank\" href=\"http://truffleframework.com/docs/\"\u003eTruffle\u003c/a\u003e and a local blockchain (like \u003ca target=\"_blank\" href=\"http://truffleframework.com/ganache/\"\u003eGanache\u003c/a\u003e)\n* A fair amount of patience and forgiveness\n\n# Disclaimer\n\nThis prototype only serves as an example, and it should not even be considered an attempt at an actual implementation, since it has a number of shortcomings.  For example, in terms of \u003ca target=\"blank\" href=\"https://ethereum.stackexchange.com/questions/3/what-is-meant-by-the-term-gas\"\u003egas usage\u003c/a\u003e, this contract can be somewhat expensive.\n\n# The Basics\n\n## Quick Runthrough\n\nAfter installing the Truffle framework and configuring/starting your local blockchain, change directory to the EthgineLite repo and compile the contracts:\n\n```\n$ truffle compile\n```\n\nThen deploy them to your local blockchain\n\n```\n$ truffle migrate\n```\n\nAnd finally test the engine using the provided Javascript file:\n\n```\n$ truffle test\n```\n\n## Brief Overview of How to Use the Engine\n\n1.) First, you need to define the data point(s) that we will want to test with the rules engine (like a Price, for example). \n\n```\n        // INSIDE THE CONTRACT'S CONSTRUCTOR\n        attributes.push(WonkaLib.WonkaAttr({\n                attrId: 2,\n                attrName: \"Price\",\n                maxLength: 128,\n                maxLengthTruncate: false,\n                maxNumValue: 1000000,\n                defaultValue: \"000\",\n                isString: false,\n                isDecimal: false,\n                isNumeric: true,\n                isValue: true               \n            }));\n```\n\n```\n    // INSIDE THE TEST SCRIPT\n    instance.addAttribute(web3.fromAscii('Language'), 64, 0, new String('ENG').valueOf(), true, false);\n```\n\nFor now, the engine automatically creates three Attributes in the engine's constructor, but that could be changed easily.\n\n2.) Next, you need to create a RuleSet for containing the rules:\n\n```\n    instance.addRuleSet(accounts[0], web3.fromAscii('ValidateProduct'));\n```\n\nAs well as create the Rule itself:\n\n```\n    instance.addRule(accounts[0], web3.fromAscii('Validate price'), web3.fromAscii('Price'), GREATER_THAN_RULE, new String('0099').valueOf()); // in cents, since we can't use decimals\n```\n\n3.) Then, we need to populate our record (held within the contract instance for us) with the data:\n\n```\n    // SINCE ETHEREUM HAS LIMITATIONS WHEN DEALING WITH DYNAMIC ARRAYS AND MAPPINGS, WE MUST KEEP AN ARRAY/MAPPING\n    // ON THE CONTRACT SIDE AND MANIPULATE IT FROM THE CLIENT\n    instance.setValueOnRecord(accounts[0], web3.fromAscii('Title'), new String('The First Book').valueOf());\n    instance.setValueOnRecord(accounts[0], web3.fromAscii('Price'), new String('0999').valueOf()); // in cents\n    instance.setValueOnRecord(accounts[0], web3.fromAscii('PageAmount'), new String('289').valueOf());\n```\n\n4.) Finally, we execute the rules engine, using our provided RuleSet and applying it to our specified data record:\n\n```\n    instance.execute.call(accounts[0]);\n```\n\nAnd we learn whether or not the data record is valid, according to our provided rules.\n\n# Notices\n\nThis project will no longer be developed any further, since it only served as a proof of concept.  However, you can understand its basis by reading about the \nideas and the general design presented in my \u003ca target=\"_blank\" href=\"https://www.infoq.com/articles/mdd-creating-user-friendly-dsl\"\u003eInfoQ article\u003c/a\u003e that talks about metadata-driven design (i.e., MDD) and business rules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaerith%2Fethginelite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaerith%2Fethginelite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaerith%2Fethginelite/lists"}