{"id":14156518,"url":"https://github.com/second-state/dapr-sdk-wasmedge","last_synced_at":"2025-10-10T02:41:59.885Z","repository":{"id":98615220,"uuid":"543426666","full_name":"second-state/dapr-sdk-wasmedge","owner":"second-state","description":"An experimental Dapr SDK in Rust. It is designed to run in WasmEdge applications.","archived":false,"fork":false,"pushed_at":"2023-12-03T06:20:35.000Z","size":5775,"stargazers_count":44,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-06T02:45:33.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/second-state.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}},"created_at":"2022-09-30T04:18:44.000Z","updated_at":"2025-05-13T20:33:10.000Z","dependencies_parsed_at":"2023-04-09T00:05:51.098Z","dependency_job_id":null,"html_url":"https://github.com/second-state/dapr-sdk-wasmedge","commit_stats":null,"previous_names":["second-state/dapr-sdk-wasmedge","second-state/dapr-sdk-wasi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/second-state/dapr-sdk-wasmedge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fdapr-sdk-wasmedge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fdapr-sdk-wasmedge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fdapr-sdk-wasmedge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fdapr-sdk-wasmedge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/second-state","download_url":"https://codeload.github.com/second-state/dapr-sdk-wasmedge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fdapr-sdk-wasmedge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002541,"owners_count":26083403,"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-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-08-17T08:05:32.850Z","updated_at":"2025-10-10T02:41:59.849Z","avatar_url":"https://github.com/second-state.png","language":"Rust","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# Dapr SDK for WebAssembly\n\nWritten in Rust, the *dapr_sdk_wasi* crate can be compiled into WebAssembly and runs in the [WasmEdge Runtime](https://github.com/wasmedge).\n\n[Introduction](#introduction) | [How it works](#how-it-works) | [Contribution](#contribution)\n\n## Introduction\n\n\u003e This software is still under development, we [welcome new contributors](#contribution)!\n\nWebAssembly provides a secure, fast, and lightweight runtime sandbox for cloud-native applications, especially for [microservices](https://github.com/second-state/microservice-rust-mysql), as [an alternative to Linux containers and VMs](https://wasmedge.org/wasm_linux_container/). The *dapr_sdk_wasi* crate is a Rust SDK for the [Dapr framework](https://dapr.io/). It provides an easy way for Rust-based microservices in WasmEdge to interact with Dapr APIs and sidecar services. The figure below shows a Dapr-enabled microservice running inside the WasmEdge sandbox.\n\n![](dapr-sdk-wasi.png)\n\nCurrently, the dapr-sdk-wasi supports Dapr's service invocation, state management, secrets, and health APIs.\n\n\n| Dapr API               | Status     |\n|------------------------|------------|\n| Service invocation API | ✅          |\n| State management API   | ✅          |\n| Pub/sub API            | To be done |\n| Bindings API           | To be done |\n| Actors API             | To be done |\n| Secrets API            | ✅          |\n| Configuration API      | To be done |\n| Distributed Lock API   | To be done |\n| Health API             | ✅          |\n| Metadata API           | To be done |\n\n\n## How it works\n\nThis repo contains the SDK, a Dapr service example, and an example client to access the Dapr service using the SDK.\n\n* The root project is the SDK, which is provides a Rust API to call Dapr API services.\n* `examples/echo` is a microservice demo that runs with a Dapr sidecar.\n* `examples/tests` is a SDK client that accesses Dapr APIs on the sidecar.\n\nIf you want to run the `echo` example and SDK tests, follow the following instructions.\n\n### Install Rust and add Wasi target for the Rust compiler\n\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nrustup target add wasm32-wasi\n```\n\n### Install WasmEdge\n\n```\ncurl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash\n```\n\n### Install and init Dapr\n\n```\nwget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash\ndapr init\n```\n\n### Run the `echo` example\n\n```\ncd examples/echo\n\n// compile the rust code to wasm \ncargo build --target wasm32-wasi --release\nwasmedgec target/wasm32-wasi/release/dapr_echo.wasm dapr_echo.wasm\n\n// Use Dapr to start the echo microservice application\ndapr run --app-id echo-service --app-protocol http --app-port 9004 --dapr-http-port 3502 --components-path ../config --log-level debug wasmedge dapr_echo.wasm\n\n// Shows the server log\nℹ️  Starting Dapr with id echo-service. HTTP Port: 3502. gRPC Port: 44517\ntime=\"2022-10-07T22:00:17.732779744Z\" level=info msg=\"starting Dapr Runtime -- version 1.8.4 -- commit 18575823c74318c811d6cd6f57ffac76d5debe93\" app_id=echo-service instance=fv-az186-200 scope=dapr.runtime type=log ver=1.8.4\ntime=\"2022-10-07T22:00:17.732813444Z\" level=info msg=\"log level set to: debug\" app_id=echo-service instance=fv-az186-200 scope=dapr.runtime type=log ver=1.8.4\n···\n```\n\n### Run the SDK tests\n\nDo the following from another terminal window from the `echo` service.\n\n```\ncd examples/tests\n\n// compile the SDK testing code to wasm\ncargo build --target wasm32-wasi --release\nwasmedgec target/wasm32-wasi/release/dapr_examples.wasm dapr_examples.wasm\n\n// Run the tests to interact with the `echo` service's Dapr sidecar from WasmEdge\nwasmedge dapr_examples.wasm\n\n// Results from the tests on the console\nURL is http://localhost:3502/v1.0/healthz/\nStatus code is 204\nDapr echo is healthy!\nURL is http://localhost:3502/v1.0/invoke/echo-service/method/echo\nEcho: {\"message\":\"WasmEdge\"}\nURL is http://localhost:3502/v1.0/state/starwars\nSaved!\nURL is http://localhost:3502/v1.0/state/starwars/weapon\nState for weapon: \"DeathStar\"\nURL is http://localhost:3502/v1.0/state/starwars/bulk\nState for weapon and planet: [{\"data\":\"DeathStar\",\"etag\":\"1\",\"key\":\"weapon\"},{\"data\":{\"name\":\"Tatooine\"},\"etag\":\"1\",\"key\":\"planet\"}]\nURL is http://localhost:3502/v1.0/state/starwars/weapon\nDeleted!\nURL is http://localhost:3502/v1.0/state/starwars/bulk\nState for weapon and planet: [{\"key\":\"weapon\"},{\"data\":{\"name\":\"Tatooine\"},\"etag\":\"1\",\"key\":\"planet\"}]\nURL is http://localhost:3502/v1.0/state/starwars/transaction\nTransacted!\nURL is http://localhost:3502/v1.0/state/starwars/bulk\nState for weapon, planet, key1 and key2: [{\"key\":\"weapon\"},{\"data\":{\"name\":\"Tatooine\"},\"etag\":\"1\",\"key\":\"planet\"},{\"data\":\"myData\",\"etag\":\"1\",\"key\":\"key1\"},{\"key\":\"key2\"}]\nURL is http://localhost:3502/v1.0/secrets/local-store/DB_URL:MYSQL\nSecret for DB_URL:MYSQL {\"DB_URL:MYSQL\":\"***127.0.0.1:3306/mysql\"}\n```\n\n## Contribution\n\nAny feedback is appreciated. If you have any questions or suggestions, please raise an issue or create a PR and let us know.\n\nIf you prefer chatting in real-time, join our [Discord server](https://discord.gg/U4B5sFTkFc).\n\n## Tech stacks used in this project\n\n* Tokio\n* hyper\n* reqwest\n* Dapr\n* WasmEdge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2Fdapr-sdk-wasmedge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecond-state%2Fdapr-sdk-wasmedge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2Fdapr-sdk-wasmedge/lists"}