{"id":13651559,"url":"https://github.com/rogervs/cadcadgolem","last_synced_at":"2025-10-01T04:30:36.676Z","repository":{"id":50160207,"uuid":"325557667","full_name":"rogervs/cadcadgolem","owner":"rogervs","description":"This package is a wrapper for cadCAD to dispatch the simulation workload to multiple Golem nodes.","archived":true,"fork":false,"pushed_at":"2022-04-01T11:54:25.000Z","size":4851,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-25T08:22:06.467Z","etag":null,"topics":["cadcad","distributed-computing","golem","modelling","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rogervs.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":"2020-12-30T13:27:45.000Z","updated_at":"2023-09-08T18:16:34.000Z","dependencies_parsed_at":"2022-09-06T17:50:20.886Z","dependency_job_id":null,"html_url":"https://github.com/rogervs/cadcadgolem","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervs%2Fcadcadgolem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervs%2Fcadcadgolem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervs%2Fcadcadgolem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervs%2Fcadcadgolem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogervs","download_url":"https://codeload.github.com/rogervs/cadcadgolem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234821049,"owners_count":18891970,"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","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":["cadcad","distributed-computing","golem","modelling","simulation"],"created_at":"2024-08-02T02:00:50.507Z","updated_at":"2025-10-01T04:30:31.387Z","avatar_url":"https://github.com/rogervs.png","language":"Python","funding_links":[],"categories":["Archive","Apps"],"sub_categories":["Apps","Data Simulation"],"readme":"# cadCAD Golem\n\n## **This project is out of date due to changes in the Golem api. There is currently no intention to update this project**\n\nThis package is a wrapper for cadCAD to dispatch the simulation workload to multiple Golem nodes.\n\n[cadCAD](https://github.com/cadCAD-org/cadCAD) is a Python package that assists in the processes of designing, testing and validating complex systems through simulation, with support for Monte Carlo methods, A/B testing and parameter sweeping.\n\n[Golem](https://golem.network/) is a global, open source, decentralized supercomputer that anyone can access. It is made up of the combined power of users' machines, from PC's to entire data centers.\n\n## Note\n\n* __As the Golem VM's are pregenerated, and don't yet have internet connectivity, if you use a library that is NOT preinstalled in the Golem VM, your code will fail. If cadCADGolem does not work for you, please create an [Issue](https://github.com/rogervs/cadcadgolem/issues), give a brief description, and please include the libraries that you are importing/using. I will then generate a new Golem VM to include your libraries, which will hopefully fix the issue.__\n\n* The Golem network is still under development, and not all nodes behave perfectly. If your simulatino fails, try again a few times.\n\n## Getting Started\n\n### Demo Video\n\n[![cadCAD Golem Installation and Use Demo](https://img.youtube.com/vi/HD_eM_bN1fM/0.jpg)](https://www.youtube.com/watch?v=HD_eM_bN1fM)\n\n## Basic Overview Presentation\n[cadCAD Golem Overview](https://github.com/rogervs/cadcadgolem/blob/master/cadcadGolem.pdf)\n\n### Initialise/Create environment and working directory\nIf you are already using cadCAD, activate the virtual environment that you use for cadCAD. This might look something like:\n```bash\nsource ~/.venv/cadcad\n```\n\nIf you do not yet have a working directory or virtual environment, creat both and activate. Something like so:\n```bash\nmkdir -p ~/projects/cadcad-exp\ncd ~/projects/cadcad-exp\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\nNow you have an isolated environment where you can install your python packages without fear of bloating the rest of your system.\n\n### Install cadcadgolem\nRequires [\u003e= Python 3.8](https://www.python.org/downloads/)\n\n#### Install Using [pip](https://pypi.org/project/cadCAD/)\n```bash\n$ pip3 install cadcadgolem\n```\n\n### Install *yagna daemon*\n\nThe Yagna daemon is what you will use to interface with the Golem network. It runs in the background, waiting for API calls from your applications, in our case, from *cadcadgolem*.\n\nTo install yagna, you can use their helper script:\n```\ncurl -sSf https://join.golem.network/as-requestor | bash -\n```\n\nFor manual installation instructions, see: (https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development)\n\nTo check it is installed corretly, run:\n```\nyagna --version\n```\n\n### Prepare *yagna daemon*\nTo run the yagna daemon, follow the following sequence. This sequence will need to be followed everytime you restart *yagna*.\n\n#### Start the daemon\nThis will initialise the daemon\n```\nyagna service run\n```\n\n#### Generate the app key (*This only has to done once after initial install of `yagna`*)\n```\nyagna app-key create requestor\n```\n\nThis should produce a 32-character-long hexadecimal app key that you need to note down as it will be needed in your code to run the requestor agent.\n\n#### Get some coinage\nGolem currently has a faucet where you can get free tokens to pay for the processing that you will perform on the network.\n```\nyagna payment init -r\n```\n\n#### Check that the fund transfer was successfull.\n```\nyagna payment status\n```\n\n#### Add your app-key to your code\nWhen using cadcadgolem, a dictionary is passed that contains the parameters for your interaction with the network. One of them is yor app-key, which allows you to speak to the *yagna* daemon that you started earlier. Place your app-key into your dictionary (see dictionary below).\n\n## Using cadcad Golem\n\nTo use cadcad Golem, you need to do three things:\n\n1. Import the cadcad Golem Ambassador:\n```\nfrom cadcadgolem.golem_embassy import Ambassador\n```\n2. Define the golem_conf dictionary:\n    ```\n    golem_conf = {\n            'NODES': 3, # Number of nodes to utilise from the Golem Network. If you've got a big simulation to run, try pushing this up to 30. Remember you need at least twice as many simulation runs as you have nodes.\n            'BUDGET': 10.0, # Maximum amount of crypto you are prepared to spend\n            'SUBNET': \"community.3\", # choose your subnet, currently this is the test network\n            'YAGNA_APPKEY': '\u003cYOUR-YAGNA_APPKEY-GOES HERE\u003e', # get this from `yagna app-key list`\n            'TIMEOUT': 120 # In seconds - you will need to figure this out for your workload. Max currently is 25min, so 25 * 60 seconds\n            }\n    ```\n    [Example](https://github.com/rogervs/cadcad_models/blob/dc17128d2a0b874c809529230d17f5c387418cc3/simple_cadcad.py#L71-L77)\n    \n3. Wrap your cadcad `Executor` in the cadcad Golem `Ambassador`:\n    ```\n    Executor = Ambassador(Executor, golem_conf)\n    ```\n    [Example](https://github.com/rogervs/cadcad_models/blob/dc17128d2a0b874c809529230d17f5c387418cc3/simple_cadcad.py#L79)\n\n* Jupyter Notebook Example: [minimal_param_sweep.ipynb](https://github.com/rogervs/cadcadgolem/blob/master/minimal_param_sweep.ipynb)\n* Python script Example:  [simple_cadcad.py](https://github.com/rogervs/cadcad_models/blob/master/simple_cadcad.py)\n\n## System initialisation after first install\n1. `yagna service run`\n2. `yagna payment init -r`\n3. Run your cadCAD code!\n\n## cadCAD Examples/Demos\n\nYou can find more cadCAD demos to play with here: https://github.com/cadCAD-org/demos\nTo modify them them to work with cadcadGolem, just add the golem_conf dictionary declaration as above, and then wrap the cadCAD `Executor` with the cadCADGolem `Ambassador` and you're done.\n\n## Security Notice\nThe communication on the Golem network is currently not encrypted, so do not use this for any sensitive data.\n\n## Caveats\nYou need at least twice as many simulation runs as you have nodes, else it the simulation will fail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogervs%2Fcadcadgolem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogervs%2Fcadcadgolem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogervs%2Fcadcadgolem/lists"}