{"id":14967135,"url":"https://github.com/golemfactory/gfaas","last_synced_at":"2025-08-31T17:41:30.468Z","repository":{"id":56635768,"uuid":"246588081","full_name":"golemfactory/gfaas","owner":"golemfactory","description":"FaaS using gWasm platform","archived":false,"fork":false,"pushed_at":"2020-10-28T12:45:05.000Z","size":1158,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T06:31:47.523Z","etag":null,"topics":["function-as-a-service","golem","rust","wasi","ya-runtime"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-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}},"created_at":"2020-03-11T14:06:50.000Z","updated_at":"2023-09-08T18:04:27.000Z","dependencies_parsed_at":"2022-08-15T22:20:31.917Z","dependency_job_id":null,"html_url":"https://github.com/golemfactory/gfaas","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/golemfactory/gfaas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgfaas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgfaas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgfaas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgfaas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/golemfactory","download_url":"https://codeload.github.com/golemfactory/gfaas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fgfaas/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267687768,"owners_count":24128007,"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-07-29T02:00:12.549Z","response_time":2574,"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":["function-as-a-service","golem","rust","wasi","ya-runtime"],"created_at":"2024-09-24T13:37:30.408Z","updated_at":"2025-07-29T12:40:33.184Z","avatar_url":"https://github.com/golemfactory.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003egfaas\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eFunction-as-a-Service on top of Golem Network using gWasm platform.\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/golemfactory/gfaas/actions?query=branch%3Amaster\"\u003e\u003cimg src=\"https://github.com/golemfactory/gfaas/workflows/Continuous%20Integration/badge.svg\" alt=\"Build status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/gfaas\"\u003e\u003cimg src=\"https://docs.rs/gfaas/badge.svg\" alt=\"Documentation Status\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003ch3\u003e\n    \u003ca href=\"https://golemfactory.github.io/gfaas/gfaas/\"\u003eDocs (master)\u003c/a\u003e\n  \u003c/h3\u003e\n\u003c/div\u003e\n\nThis crate allows you to distributed heavy-workload functions to the [Golem Network] (or any\nother compatible backend when support for it is added in the future).\n\n[Golem Network]: https://golem.network/\n\n## Quick start\n\nThe usage is pretty straightforward. In your `Cargo.toml`, put `gfaas` as your dependency\n\n```toml\n# Cargo.toml\n[dependencies]\ngfaas = \"0.3\"\n```\n\nYou can now annotate some heavy-workload function to be distributed on the Golem Network\nlike so\n\n```rust,ignore\nuse gfaas::remote_fn;\n\n#[remote_fn]\nfn hello(input: String) -\u003e String {\n    // let's make the input all-caps\n    input.to_uppercase().to_string()\n}\n\n#[actix_rt::main]\nasync fn main() {\n    let input = \"hey there gfaas\";\n    let output = hello(\"hey there gfaas\".to_string()).await.unwrap();\n    assert_eq!(input.to_uppercase(), output)\n}\n```\n\nIn order to compile your code you'll need to use our custom wrapper on top of `cargo` called\n`gfaas`. You can install the tool with `cargo-install` like so\n\n```\ncargo install gfaas-cli\n```\n\nThen, you can use `gfaas` like you would use `cargo`. So, to build and run on Golem Network,\nyou'd execute\n\n```\ngfaas run\n```\n\n## Notes about `gfaas::remote_fn`\n\nWhen you annotate a function with `gfaas::remote_fn` attribute, it gets expanded into a\nfull-fledged async function which is fallible. So for instance, the following function\n\n```rust,ignore\nuse gfaas::remote_fn;\n\n#[remote_fn]\nfn hello(input: String) -\u003e String;\n```\n\nexpands into\n\n```rust,ignore\nasync fn hello(input: String) -\u003e Result\u003cString, gfaas::Error\u003e;\n```\n\nTherefore, it is important to remember that you need to run the function in an async block\nand in order to get the result of your function back, you need to unpack it from the outer\n`Result` type.\n\nThe asyncness and the `Result` are there due to the nature of any distributed computation\nrun on top of some network of nodes: it may fail due to reasons not related to your app\nsuch as network downtime, etc.\n\nFurthermore, the input and output arguments of your function have to be serializable, and\nso they are expected to derive `serde::Serialize` and `serde::Deserialize` traits.\n\n### Specifying Golem's configuration parameters\n\nYou can currently set the following configuration parameters directly via `gfaas::remote_fn`\nattribute:\n\n* (maximum) budget in NGNT (defaults to 100):\n\n```rust,ignore\n#[remote_fn(budget = 100)]\nfn hello(input: String) -\u003e String;\n```\n\n* timeout in seconds (defaults to 10 minutes):\n\n```rust,ignore\n#[remote_fn(timeout = 600)]\nfn hello(input: String) -\u003e String;\n```\n\n* subnet tag (defaults to \"devnet-alpha.2\"):\n\n```rust,ignore\n#[remote_fn(subnet = \"devnet-alpha.2\")]\nfn hello(input: String) -\u003e String;\n```\n\nOf course, nobody stops you from setting any number of parameters at once\n\n```rust,ignore\n#[remote_fn(budget = 10, subnet = \"my_subnet\")]\nfn hello(input: String) -\u003e String;\n```\n\n## Notes about `gfaas` build tool and adding dependecies for your functions\n\nThe reason that a custom wrapper around `cargo` is needed, is because the function\nannotated with `gfaas::remote_fn`, under-the-hood is actually automatically cross-compiled\ninto a WASI binary.\n\nIn addition, since the functions are cross-compiled to WASI, you need to install\n`wasm32-wasi` target in your used Rust toolchain. Furthermore, for that same reason, not\nall crates are compatible with WASI yet, but you can manually specify which crates you\nwant your functions to depend on by adding a `[gfaas_dependencies]` section to your `Cargo.toml`\n\n```toml\n# Cargo.toml\n[package]\nauthor = \"Jakub Konka\"\n\n[dependecies]\nactix = \"1\"\n\n[gfaas_dependencies]\nlog = \"0.4\"\n```\n\n## Notes on running your app locally (for testing)\n\nIt is well known that prior to launching our app on some distributed network of nodes, it\nis convenient to first test the app locally in search of bugs and errors. This is also\npossible with `gfaas`. In order to force your app to run locally, simply pass\n`run_local=true` as argument to `gfaas::remote_fn` attribute\n\n```rust,ignore\n#[remote_fn(run_local = true)]\nfn hello(input: String) -\u003e String;\n```\n\nThis will spawn all of your annotated functions in separate threads on your machine locally,\nso you can verify that everything works as expected prior to launching the tasks on the\nGolem Network.\n\n## Examples\n\nA couple illustrative examples of how to use this crate can be found in the `examples/`\ndirectory. All examples require `gfaas` build tool to be built.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolemfactory%2Fgfaas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgolemfactory%2Fgfaas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolemfactory%2Fgfaas/lists"}