{"_id":"@compound-finance/eureka","_rev":"6-53e1b159c197e95ef38f87af808dab94","name":"@compound-finance/eureka","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.2":{"name":"@compound-finance/eureka","version":"1.0.2","license":"MIT","_id":"@compound-finance/eureka@1.0.2","maintainers":[{"name":"maxwolff","email":"maxcwolff@gmail.com"},{"name":"hayesgm","email":"geoff@compound.finance"}],"dist":{"shasum":"75679ca60a4bd03bef110dafb63f55737ba8d6e2","tarball":"https://registry.npmjs.org/@compound-finance/eureka/-/eureka-1.0.2.tgz","fileCount":56,"integrity":"sha512-z319rlpedPOWXwI2AdXbWEIU3kgS1f3B0P6xHydoC52E9EIH5BKQTDSrYdkd/1WtmDEE8i1Sz6qLSmJFRkEgDQ==","signatures":[{"sig":"MEYCIQCR57gOAuzYqYQNb8m5AgSZyUff/3x304jnAXM8PnqiagIhALZocgEdc1SkUJ3qWYbPDdJhkeN7+2KespwtokSLbERt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":206865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIJd+CRA9TVsSAnZWagAAnvkP/1HATEVWi/jJEAShyzPA\n30NklabS8Wwma5SnC9M++93YKIofvoyzqNc8smhR9+OECiHZyRRe0lr1hwE7\nTjcuk7L7fB0VVpjsHnqGwSgeyLTBkif21xUUMg44MtnCg/kX2qybhmXp2K9Z\nlI6au542Q53afJdXaeQ71jnZBDF5x0/PKiGY/vape0jkUjwefMdGClxECdBM\nrwZoD4NiY1eu8jWt3cNrsh3UrbNzK8wrOaEvdNLV7NohIAM6maTXdZOwaCFp\n5dv+BDboTBL3ZIpFoiIozSL8BpUMZCyhIy283HgBsb7Klvbpo5vIdypQtEfD\nulyXh97XB1e+RV6EeqnjpbKZsHN4yxstfknIx5IdR4SNi8qWsylZS1BGyhYx\npBBz+zV64JdA3Xza+OPaaJeE/W8bVRX/cZZDwNlXP7uetl7fL8E4Fg4CgGba\npYIP8Kkl19SylwHYg0SbVMUY9DmM7i/CLtjz+C4XopbwOjssB5bkhN1L2gi6\nfDQe4jvmEba31zchqmUrMkN9LbPCRgXr/11G9OejP69Je45wTJwpZ0yvE8zH\nQOlRs3t5s11xqwx60Exj/01aQS+QrZ3f93pZs0Uxwt7xp1ajOSzv5kRmgm7B\ns3LCQzVpAFYz4u/6HBPR9VLLwl47w6W8P5kRfirCDDwLRoFqBzHYGbcTO9hd\nu/pv\r\n=kmzs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/cli.mjs","type":"module","scripts":{"cli":"node --experimental-vm-modules --unhandled-rejections=strict src/cli.mjs","test":"npx -n --experimental-vm-modules --unhandled-rejections=strict jest -c jest.config.mjs","gen-parser":"npx pegjs -o src/eureka-grammar.cjs src/grammars/eureka.pegjs","gen-abi-parser":"npx pegjs -o src/abi-grammar.cjs src/grammars/abi.pegjs"},"_npmUser":{"name":"hayesgm","email":"geoff@compound.finance"},"description":"Eureka is a tool for reproducable builds of Ethereum contracts. Think of it like Terraform for Ethereum.","directories":{},"dependencies":{"chalk":"^4.0.0","pegjs":"^0.10.0","yargs":"^15.3.1","ohm-js":"^0.14.0","logic_js":"^0.0.3","web3-eth":"^1.2.7","web3-eth-abi":"^1.2.7","canonical-json":"^0.0.4","@compound-finance/etherscan":"^0.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.5.4","node-docker-api":"^1.1.22","jest-environment-node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/eureka_1.0.2_1595971453667_0.1623838819128498","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@compound-finance/eureka","version":"1.0.3","license":"MIT","_id":"@compound-finance/eureka@1.0.3","maintainers":[{"name":"hayesgm","email":"geoff@compound.finance"},{"name":"maxwolff","email":"maxcwolff@gmail.com"},{"name":"ajb413","email":"adam@compound.finance"}],"dist":{"shasum":"d98e00dee54c0465e63a7a316a449e1c20599f5c","tarball":"https://registry.npmjs.org/@compound-finance/eureka/-/eureka-1.0.3.tgz","fileCount":47,"integrity":"sha512-C2B10S5ApIUC5LT2t0HTSiLkawKuel+hRLGaFa33u6CS3BwLckd6XDsFEpLR2XfBNa/ul0yeMUVLsGm4eK5rsg==","signatures":[{"sig":"MEUCIQDPdJwvn7DgxUxP3so0ZKO0BHXxWvudKfu3kflUAdmBOQIgOSGhvxVyokaB0bsv7Dyg6svcTNIRiBYQkhhAFGMraV8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLvhKCRA9TVsSAnZWagAAbJYP/RNlSUFixhBJyuMxMENH\nA4c6y3AFakoqk2zXCDXWU4VDACanEVQ0Tnmd9s6W7lZmprQTU9616eZ91QWU\nTUJgPxReavASj2WAZIFSg0dHs+bERQ0DJDo5emnjPa8JGLrcsLDw52f0SoAY\nZny5AmNS4hqsqKClJShduzr/ajVs1YGUSSDDasNJbvewaAeBKYLqY235jI45\np44h+BmsYnLglZbGkoZ3LEfoXxlPTy19auYOU/fouCzCvnfhJtK0sMSrz2WA\nRnY5v5VUjXs1KQ0yB1kvuI8wR2BbuLEuOigSQcQfhL1KzFrm8/zAi1VWc0t0\nXXEVgfymuVRA7a/kypeZDYj/Li4h9avwetIAY7h/BjeIs26Yttw2u+UXTlbO\nmHpN0txSb5kSi7Y+Jiwxi2VuGo5aCmH25SjbhAikI7CXFPnwMYyy96065YtU\nb3THu0UdLDdqwAa439jTrmba8rcu2TGqunDF9bqGkW6EICKa+cTD06V5fLpw\nGaKhRVgJIPC7SeSfYNJAdxeZkAJIHqk8o2FuT3+sg2fsAFBdMQFeiY/m/2x1\n100viuZzoSZmIcoS0m7v6dWuPP6vuar8bScU2thFrKkQRxooz9nZya++xpaN\n0EXmhECYcqFRMsiEFTea1mPACy/MEuRuu9z9opIqVeAZ8enrEKDVYg/zx8nO\n6xhf\r\n=zM4F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/cli.mjs","type":"module","gitHead":"5fa1fe9f000fa75ae609e72b769b8c01ebeefdfb","scripts":{"cli":"node --experimental-vm-modules --unhandled-rejections=strict src/cli.mjs","test":"npx -n --experimental-vm-modules --unhandled-rejections=strict jest -c jest.config.mjs","gen-parser":"npx pegjs -o src/eureka-grammar.cjs src/grammars/eureka.pegjs","gen-abi-parser":"npx pegjs -o src/abi-grammar.cjs src/grammars/abi.pegjs"},"_npmUser":{"name":"ajb413","email":"adam@compound.finance"},"_npmVersion":"6.14.11","description":"Eureka is a tool for reproducable builds of Ethereum contracts. Think of it like Terraform for Ethereum.","directories":{},"_nodeVersion":"14.15.5","dependencies":{"chalk":"^4.0.0","pegjs":"^0.10.0","yargs":"^15.3.1","ohm-js":"^0.14.0","logic_js":"^0.0.3","web3-eth":"^1.2.7","web3-eth-abi":"^1.2.7","canonical-json":"^0.0.4","@compound-finance/etherscan":"^0.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.5.4","node-docker-api":"^1.1.22","jest-environment-node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/eureka_1.0.3_1613690954163_0.31338322200635704","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-07-28T21:24:13.446Z","modified":"2024-12-12T18:14:46.846Z","1.0.2":"2020-07-28T21:24:13.832Z","1.0.3":"2021-02-18T23:29:14.383Z"},"license":"MIT","description":"Eureka is a tool for reproducable builds of Ethereum contracts. Think of it like Terraform for Ethereum.","maintainers":[{"email":"arr00comp@gmail.com","name":"arr00"},{"email":"hayesgm@gmail.com","name":"hayesgm"},{"email":"adam@compound.finance","name":"ajb413"},{"email":"bhasinaryan@gmail.com","name":"aryanbhasin"}],"readme":"\n## Eureka\n\nEureka is a tool for reproducable builds of Ethereum contracts. Think of it like Terraform for Ethereum.\n\n## Getting started\n\nMake sure you have Node 13 installed and then run:\n\n```bash\nyarn install\n```\n\nYou can run tests with `yarn test`.\n\n## Running Examples\n\nSimply run:\n\n```bash\nyarn cli apply -c examples/tick/tick.js -d examples/tick/tick.eureka\n```\n\nNote: this project relies on Node 13+.\n\n## Example\n\nAn example is worth a thousand words. Let's say we have two simple contracts `Tick` which keeps track of a `time` variable, and `Clock` which prints out the associated day for tick.\n\nWe'll create a Eureka spec that specifies the desired set-up:\n\n**tick.eureka**\n\n```java\nTick#tick{\n  time: 1588297301\n}\n\nClock#clock {\n  tick: #tick\n}\n```\n\nWe specify a Eureka configuration for any properties about the contracts that are not available by analyzing the contract and ABI.\n\n**tick.js**\n\n```javascript\ndefine('Tick', {\n  properties: {\n    time: 'number'\n  }\n});\n\ndefine('Clock', {\n  properties: {\n    tick: { 'ref': 'Tick' } // A reference to a Tick contract, i.e. an address\n  }\n});\n```\n\nFrom here, we can tell Eureka to deploy this configuration:\n\n```bash\nyarn cli -n rinkeby -c tick.js tick.eureka\n```\n\nHere, Eureka will tell you the delta it needs to construct the given configuration, e.g.:\n\n```bash\nBuild<Tick#tick, { time: '1588297301' }>\nBuild<Clock#clock, { tick: { ref: 'tick' } }>\n```\n\nThen, if you decide, you can apply these changes, and the updates will be tracked in state.\n\nState can be synced to a remote (e.g. AWS S3) to track the known state and used in updates.\n\n## Updates\n\nThe goal of the system is to allow updates, for instance, building on above:\n\n```java\nTick#tick{\n  time: 1688297301\n}\n\nClock#clock {\n  tick: #tick\n}\n```\n\nThis would generate an action script:\n\n```bash\nUpdate<Tick#tick, { time: '1588297301 -> 1688297301' }>\n```\n\nOnce applied, this would keep the state in sync.\n\n## Future Areas\n\n**Remote Import**\n\n```\neureka import <contract_id>\neureka import <tx_id>\n```\n\nThis script would generate `eureka` config files from a given tx_id and / contract address. This effectively allows you to \"import\" state that was not deployed through Eureka directly.\n\n**Remote Sync**\n\nThe current code does not discuss \"remote sync.\" That is, when we change `tick` above- what happens when it changes remotely. Should we sync state changes from remote back to our state system, and then should we apply changes to match our diagram?\n\n**Versioning**\n\n```java\nTick#tick {\n  tag: \"#v1.0\"\n}\n\nClock#clock {\n  tag: \"#v1.1\"\n}\n```\n\nVersioning would allow Eureka to track resources that come from different Solidity builds. This would be difficult (but fun) to try to manage different versions side-by-side, but I think there could be some good and fun strategies to approach this. For instance, we could pull `contract.json` from Docker builds matching the versions.\n\n## Open Questions\n\nThere remains a few open questions. First off, how opinionated should we be in \"state.\" For instance, in Terraform, the system tracks a mapping of \"local resource\" to \"remote resource,\" with the intent of never updating a resource it didn't create. Since we're in permissioned blockchain land, this might not be as important, and it might be _more_ important to get import and sync set-up correctly. In other words, we should be opinionated about what works best for Ethereum. Also, we should question our dependency on saddle.\n\n## Notes\n\nThis project is just in exploration phase. Look under `examples/tick` for an example project. Look under `src` for the core code. We use ES7 modules, which are new, so expect things to be a bit strange. Also `compound.md` has a thought experiment for how this could apply to Compound.\n\nAlso, just for fun, this project uses NodeJS modules without babel, and therefore probably requires Node 13+.\n","readmeFilename":"README.md"}