{"id":31769186,"url":"https://github.com/second-state/ssvmrpc","last_synced_at":"2025-10-10T02:41:34.904Z","repository":{"id":57369084,"uuid":"224316465","full_name":"second-state/SSVMRPC","owner":"second-state","description":"A Remote Procedure Call (RPC) implementation which facilitates both code-deployment and code-execution interactions with SecondState's stateless Virtual Machine (SSVM)","archived":false,"fork":false,"pushed_at":"2021-07-07T11:25:32.000Z","size":512,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-06T05:52:59.390Z","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":"mit","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}},"created_at":"2019-11-27T01:13:53.000Z","updated_at":"2021-07-07T11:25:34.000Z","dependencies_parsed_at":"2022-09-16T10:00:54.735Z","dependency_job_id":null,"html_url":"https://github.com/second-state/SSVMRPC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/second-state/SSVMRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSSVMRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSSVMRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSSVMRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSSVMRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/second-state","download_url":"https://codeload.github.com/second-state/SSVMRPC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSSVMRPC/sbom","scorecard":{"id":809054,"data":{"date":"2025-08-11","repo":{"name":"github.com/second-state/SSVMRPC","commit":"effd42c41b53fea503b91daacf389d7fa1e795ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T12:36:44.843Z","repository_id":57369084,"created_at":"2025-08-23T12:36:44.843Z","updated_at":"2025-08-23T12:36:44.843Z"},"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":"2025-10-10T02:41:32.039Z","updated_at":"2025-10-10T02:41:34.893Z","avatar_url":"https://github.com/second-state.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated\n\nWe have a new and exciting product called WasmEdge (which offers a wide range of functionality and also performance and safety). This SSVMRPC was providing access to our Wasm runtime using Rust and Rocket. However, because WasmEdge can be packaged up and used as a NodeJS Add-On, we decided to provide access to our Wasm runtime using NodeJS. Please use [wasm-joey](https://github.com/second-state/wasm-joey) instead of this SSVMRPC.\n\nHere is [a tutorial](https://www.secondstate.io/articles/getting-started-with-function-as-a-service-in-rust/) which shows you how to get started with wasm-joey.\nHere is [a YouTube Video](https://www.youtube.com/watch?v=SF-6OARg9WM) of how to use wasm-joey.\n\n# SSVMRPC\nA Remote Procedure Call (RPC) implementation which facilitates both code-deployment and code-execution interactions with SecondState's stateless Virtual Machine (SSVM)\n\n# Try our ready-made demo now\nThis system is currently running on a server that you can use remotely. Please follow the instructions on how to [create](https://github.com/second-state/SSVMRPC/blob/master/examples/creating_wasm_application.md) and [deploy](https://github.com/second-state/SSVMRPC/blob/master/examples/deploying_wasm_application.md) your very own Wasm application, as well as, [execute](https://github.com/second-state/SSVMRPC/blob/master/examples/execute_wasm_applications_function.md) your Wasm application's public functions.\n\n# Create your own from scratch\nAlternatively, if you want to create your very own environment from scratch, you can read along and follow the instructions which are directly below this paragraph. These instructions will help you set up everything from RPC server, RPCContainer, SSVM complete with SSL, CORS and so forth.\n\n## Design overview\n![ssvmrpc diagram](https://github.com/second-state/SSVMRPC/blob/master/documentation/images/architecture.jpg)\n\n## Creating your own SSVMRPC\nThe following instructions will guide you through setting up your SSVMRPC server, which can receive HTTP POST requests from the web and communicate those to the rest of the SSVM ecosystem.\n\nSystem preparation\n```\nsudo apt-get update\nsudo apt-get -y upgrade\nsudo apt-get -y install gcc\n```\nRust installation\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource $HOME/.cargo/env\n```\nCreate the SSVMRPC project\n```\ncd ~\ncargo new ssvmrpc\ncd ssvmrpc\n```\nRust configuration and housekeeping\n```\nrustup override set nightly\nrustup update \u0026\u0026 cargo update\n```\nAdd rocket dependency to Cargo.toml\n```\n[dependencies]\nserde_json = { git = \"https://github.com/serde-rs/json\" }\nssvm_container = { git = \"https://github.com/second-state/SSVMContainer\" }\nrocket = { git = \"https://github.com/SergioBenitez/Rocket\" }\n\n[dependencies.rocket_contrib]\nversion = \"0.4.2\"\ndefault-features = false\nfeatures = [\"json\"]\n```\n## Main code\nCreate/open the ~/ssvmrpc/src/main.rs file and fill it with the contents of [this raw main.rs file](https://raw.githubusercontent.com/second-state/SSVMRPC/master/rust/main.rs)\n\nOnce your ~/ssvmrpc/src/main.rs file has been populated, you can build and deploy the application as follows.\n\n## Deployment\nBuild the ssvmrpc application\n```\ncd ~\ncd ssvmrpc\ncargo build --release\n```\nStart the ssvmrpc server\n```\n./target/release/ssvmrpc\n```\n\n## Using the SecondState VM (SSVM as the execution endpoint)\n\nDownload and install SSVM [using these instructions](https://github.com/second-state/SSVM#getting-started)\n\nSet the system PATH variable to include the `ssvm-proxy` executable command i.e.\n\n```\nexport PATH=/home/ubuntu/SSVM/build/tools/ssvm-proxy:$PATH\n```\n\n## Usage\n\nYou can use a command line approach i.e. curl, client-side Javascript or Node.js. As you know, each of these HTTP POST style approaches allow you to pass in a JSON data object. Below are a few arbitrary examples. Please see our [HTTP POST Specification](https://github.com/second-state/SSVMRPC/blob/master/documentation/specifications/http_post_specification.md) for more details on packing and unpacking request/response objects.\n\n### Deploy an application\n\nWe would use the same request data, regardless of which HTTP POST approach we used i.e. Curl vs Javascript etc. Here is an example of the data required to deploy and application. As you can see below, we are essentially just passing in the text of a `.wasm` binary and an arbitrary `name` for your new application.\n\n```\n{\n\t\"request\": {\n\t\t\"application\": {\n\t\t\t\"bytecode\": \"0x01234567890\",\n\t\t\t\"name\": \"Application Example\"\n\t\t}\n\t}\n}\n```\n#### Curl\n\nThe following Curl command\n```\ncurl --header \"Content-Type: application/json\" \\\n     --request POST \\\n     --data '{\"request\": {\"application\": {\"storage\": \"file_system\", \"bytecode\": \"0x01234567890\",\"name\": \"My App\"}}}' \\\n     http://13.236.207.76:8000/deploy_wasm_application\n```\nReturns the following JSON result\n```\n{\"response\":{\"application\":{\"name\":\"My App\",\"uuid\":\"1f81f773-2f1d-4632-9765-bdfedb54eb33\"},\"status\":\"success\"}}\n```\n\nThe response from the above request will provide us with a unique identifier for our application. As you can see below i.e. the `response-\u003eapplication-\u003euuid` key has a value of `1f81f773-2f1d-4632-9765-bdfedb54eb33`. **Note: This uuid must be saved/stored somewhere on your calling application.** \n\n```\n{\n    \"response\": {\n        \"application\": {\n            \"name\": \"My App\",\n            \"uuid\": \"1f81f773-2f1d-4632-9765-bdfedb54eb33\"\n        },\n        \"status\": \"success\"\n    }\n}\n```\n\nThe uuid is essential for further interaction with your newly deployed application. This uuid allows you to identify your application, when performing execution of the functions that reside in your Wasm application.\n\n#### Javascript\n\nTo deploy and execute Wasm via Javascript, you will first need to fetch the [raw ssvmrpc.js file](https://raw.githubusercontent.com/second-state/SSVMRPC/master/javascript/ssvmrpc.js). Then reference it in your HTML file like this.\n```\n \u003cscript src=\"/myJavascriptFiles/ssvmrpc.js\"\u003e\u003c/script\u003e\n ```\nOnce the js is accessible in your web page, the following line of code can be used to initialize an instance of the SSVMRPC. This line of code allows you to set the provider i.e. the SSVMRPC server that you are trying to contact.\n```\nvar ssvmrpc = new SSVMRPC('https://ssvmrpc.secondstate.io')\n```\nOnce the provider is set, you can then construct your [valid HTTP POST request](https://github.com/second-state/SSVMRPC/blob/master/documentation/specifications/http_post_specification.md) objects and call the functions (using syntax like `ssvmrpc.deployWasmApplication(data);`) as shown below.\n```\ndata = {\n\t\"request\": {\n\t\t\"application\": {\n\t\t\t\"bytecode\": \"0x01234567890\",\n\t\t\t\"name\": \"Application Example\"\n\t\t}\n\t}\n}\n\n```\n\n```\nssvmrpc.deployWasmApplication(data);\n```\n\n#### Node.\nInstall\n```\nnpm install ssvmrpc.js\n```\nImport\n```\nlet ssvmrpc = require(\"ssvmrpc.js\"); \nlet SSVMRPC = ssvmrpc.SSVMRPC;\n```\nSet provider\n```\nlet ssvmRpcInstance = new SSVMRPC('https://ssvmrpc.secondstate.io');\n```\nThen create a data object and call any of the methods\n```\ndata = {\n\t\"request\": {\n\t\t\"application\": {\n\t\t\t\"bytecode\": \"0x01234567890\",\n\t\t\t\"name\": \"Application Example\"\n\t\t}\n\t}\n}\n\n```\n```\nssvmRpcInstance.deployWasmApplication(data)\n.then(function(result) {\n    console.log(result);\n  })\n  .catch(function() {\n    console.log(\"Error\");\n  });\n```\n\n### Destroy an application\n\n**A word about application state**\nThis system allows you to deploy a `.wasm` file and call its functions, as a service. Whilst the actual execution of the Wasm code is performed in a stateless stack-based Virtual Machine (VM) called [SSVM](https://github.com/second-state/SSVM), this system does actually provide state. The default storage mechanism stores all information and activity [on disk](https://github.com/second-state/SSVMContainer#file-system). Future versions will use leveldb etc.\n\nThe \"destroy\" functionality of this service essentially allows you to free up storage.\n\n### Curl\n\nThe following Curl example\n```\ncurl --header \"Content-Type: application/json\" \\\n  --request POST \\\n  --data '{\"request\": {\"application\": {\"storage\": \"file_system\", \"uuid\": \"1f81f773-2f1d-4632-9765-bdfedb54eb33\"}}}' \\\n  http://13.236.207.76:8000/destroy_wasm_application\n```\nReturns the following result\n```\n{\"response\":{\"application\":{\"storage\":\"file_system\",\"uuid\":\"1f81f773-2f1d-4632-9765-bdfedb54eb33\"},\"status\":\"success\"}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2Fssvmrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecond-state%2Fssvmrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2Fssvmrpc/lists"}