{"id":14967053,"url":"https://github.com/golemfactory/gwasm-runner","last_synced_at":"2025-10-19T09:31:27.106Z","repository":{"id":37179624,"uuid":"205185968","full_name":"golemfactory/gwasm-runner","owner":"golemfactory","description":"Command line tool for running gWasm compatible apps locally, via Golem Unlimited or via Brass Golem.","archived":false,"fork":false,"pushed_at":"2023-03-25T01:49:16.000Z","size":2176,"stargazers_count":4,"open_issues_count":8,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-01T04:28:05.783Z","etag":null,"topics":["golem","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"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/golemfactory.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":"2019-08-29T14:46:15.000Z","updated_at":"2023-09-08T17:57:29.000Z","dependencies_parsed_at":"2024-09-14T03:49:28.277Z","dependency_job_id":"a5897cee-cb72-4251-b688-38d9498bc27b","html_url":"https://github.com/golemfactory/gwasm-runner","commit_stats":{"total_commits":157,"total_committers":13,"mean_commits":"12.076923076923077","dds":0.7770700636942676,"last_synced_commit":"bc34b8966c8df90659aa223b7e86080bfe14dba7"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgwasm-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgwasm-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgwasm-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgwasm-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/golemfactory","download_url":"https://codeload.github.com/golemfactory/gwasm-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869245,"owners_count":16555571,"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":["golem","rust"],"created_at":"2024-09-24T13:37:23.401Z","updated_at":"2025-10-19T09:31:26.735Z","avatar_url":"https://github.com/golemfactory.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gwasm-runner [![Build Status](https://github.com/golemfactory/gwasm-runner/workflows/Continuous%20integration/badge.svg)](https://github.com/golemfactory/gwasm-runner/actions?workflow=Continuous%20integration)\n\nCommand line tool for running gWasm compatible apps locally, via Golem Unlimited or via Brass Golem.\n\nIt introduces minimalistic [gwasm dispatcher API](https://golemfactory.github.io/gwasm-runner/gwasm_dispatcher/index.html) that resembles map-reduce paradigm.\nThis API with only three operations:\n\n1. `split` - divide the problem into subproblems.\n2. `execute` - performs computation for all subproblems independently.\n3. `merge` - collect all computation results and formulate final result.\n\nenables developers to easily implement applications and run them on top of the [Golem Unlimited](https://github.com/golemfactory/golem-unlimited) and also on [Brass Golem 0.21 and later](https://blog.golemproject.net/brass-golem-beta-0-21-0-hello-mainnet-gwasm/).\n\n## building from sources\nHaving below prereqs just invoke\n```\ncargo build --release\n```\n### prerequisites\nYou need to have C compiler, Python 2, AutoConf 2.13 and yasm\n\n#### on Ubuntu (16.04+)\n```\nsudo apt-get install clang-6.0 autoconf2.13 yasm\n```\n\n#### on macOS\n```\nxcode-select --install\n```\n\nUse [Homebrew](https://brew.sh/#install) to install Python 2, AutoConf 2.13 and Yasm:\n```bash\nbrew install python@2 autoconf@2.13 yasm\n# remove newer version of autoconf\nbrew unlink autoconf\n# and use 2.13 instead\nac=`which autoconf213` \u0026\u0026 sudo ln -s \"$ac\" \"${ac%213}\"\n```\n\n## Running a WASM binary\nThe first step here is obtaining a WASM binary compatible with the runner. This means that the binary must conform to the runner's split-execute-merge API.\nA list of compatible binaries can be found in the [wasm-store](https://github.com/golemfactory/wasm-store) repository. Of course, you can also create your own program.\nAs our example we're going to use [mandelbrot](https://github.com/golemfactory/mandelbrot), a Mandelbrot fractal visualiser.\n\n### Running on the Golem network\nUsing gwasm-runner, you can execute the WASM binary in the Golem network, taking advantage of parallelism by splitting the work between multiple providers.\n\nTo create a task you will need to have an instance of Golem (version 0.21+) running locally on your machine. This instance will act as a requestor within the Golem network.\nAssuming that we want to run the mandelbrot example, issue the below command:\n\n```\n./gwasm-runner /path/to/mandelbrot.wasm --backend=Brass -- 1000 1000 4\n```\n\nLet's take a closer look at that command:\n- The first argument to the runner is the path to the WASM binary. Please note that the runner expects the corresponding `.js` file to be present in the same directory as the WASM binary.\n- `Brass` stands for Brass Golem, the name for the current iteration of the Golem project.\n- The parameters after `--` are passed directly to the WASM program, therefore they are app-specific. In the case of the mandelbrot example, the first two numbers (`1000 1000`) are the width and height of the output image. The last number (`4`) is the subtask count, which determines the number subtasks we want to split our work into.\n\nShould you need to change the default configuration for the runner (e.g. whether to use Ethereum's mainnet or testnet), there is an option to use a JSON configuration file. By default, the following values are used when creating a Golem task:\n\n```\n{\n    \"data_dir\": \"/home/user/.local/share/golem/default\",\n    \"address\": \"127.0.0.1:61000\",\n    \"budget\": 1.0,\n    \"name\": \"gwasm-task\",\n    \"net\": \"testnet\",\n    \"subtask_timeout\": \"00:10:00\",\n    \"task_timeout\": \"00:30:00\"\n}\n```\n\nTo override the default values you will need to create your own, local configuration file. The path to this file depends on your operating system, here are examples for each platform:\n\n- Linux: `$HOME/.config/g-wasm-runner/brass/config.json`\n- MacOS: `$HOME/Library/Application Support/g-wasm-runner/brass/config.json`\n- Windows: `C:\\Users\\\u003cUSER_NAME\u003e\\AppData\\Roaming\\Golem Factory\\g-wasm-runner\\brass\\config.json`\n\nAs for the contents, you can copy the JSON object shown above and modify its fields as required. The runner will print its currently used configuration upon start-up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolemfactory%2Fgwasm-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgolemfactory%2Fgwasm-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolemfactory%2Fgwasm-runner/lists"}