{"info":{"_postman_id":"84b93d68-2073-4f51-bde3-68f19de57c62","name":"Wasm-Joey API documentation","description":"<html><head></head><body><h1 id=\"secondstates-wasm-execution-environment-wasm-joey\">SecondState's Wasm execution environment; Wasm-Joey</h1>\n<p><a href=\"https://www.secondstate.io/\">SecondState</a> has developed a high performance <a href=\"https://github.com/second-state/SSVM\">WebAssembly(Wasm) Virtual Machine called SSVM</a>. </p>\n<p>This product, called <a href=\"https://github.com/second-state/wasm-joey\">Wasm-Joey</a> allows you to:</p>\n<ul>\n<li>upload/store your WebAssembly executables (.wasm files) for later use</li>\n<li>run a function of your Wasm executable in the SSVM environment (via HTTP request/response)</li>\n<li>store data</li>\n<li>remote fetch data</li>\n<li>secure your Wasm </li>\n<li>share your Wasm and much more ...</li>\n</ul>\n<p>Below is an explanation of the list of features, followed by actual endpoint documentation.</p>\n<p>Firstly, callbacks!</p>\n<h2 id=\"callbacks\">Callbacks</h2>\n<ul>\n<li>Allows user to specify a callback object as part of a request. </li>\n<li>Callback objects can be placed in the request header i.e. <code>--header SSVM_Callback: {hostname ... port ... etc.}</code></li>\n<li>Callback objects can be placed in the request body i.e.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"SSVM_Callback\": {\n        \"hostname\": \"dev.rpc.ssvm.secondstate.io\",\n        \"path\": \"/api/run/1/say\",\n        \"method\": \"POST\",\n        \"port\": 8081,\n        \"headers\": {\n            \"Content-Type\": \"text/plain\",\n            \"SSVM_Usage_Key\": \"83f02dd3-6440-482f-983f-78127ed6f943\"\n        }\n    },\n      \"Function_Parameters\": [1, 2, 3, 4]\n}\n</code></pre><ul>\n<li>Callback objects can be stored permanently in Joey's DB via a RESTful API endpoint.</li>\n<li>A Callback in the header overrides a Callback in the body and a Callback in the DB.</li>\n<li>A Callback in the body overrides a Callback in the DB.</li>\n<li>If no other Callback objects are provided in the request and there is a Callback object in the DB, that DB Callback will execute regardless.</li>\n<li>A blank Callback object in the header or the body can negate the Callback that is stored in the DB.</li>\n</ul>\n<h2 id=\"remote-fetching-of-data\">Remote fetching of data</h2>\n<p>This allows the caller to deal with large files without having to upload/download them. The GET and POST activities take place on the server side. The client stays light.</p>\n<h3 id=\"ssvm_fetch-in-the-request-body-passes-the-response-from-the-request-and-ignores-any-peripheral-data-in-the-body\">SSVM_Fetch in the request body (passes the response from the request and ignores any peripheral data in the body)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/run/1/say' \\\n--header 'SSVM_Usage_Key: 83f02dd3-6440-482f-983f-78127ed6f943' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"SSVM_Fetch\": {\n        \"body\": \"body\",\n        \"hostname\": \"rpc.ssvm.secondstate.io\",\n        \"path\": \"/api/run/1/say\",\n        \"method\": \"POST\",\n        \"port\": 8081,\n        \"headers\": {\n            \"Content-Type\": \"text/plain\",\n            \"SSVM_Usage_Key\": \"83f02dd3-6440-482f-983f-78127ed6f943\"\n        }\n    },\n    \"function_params\": [1, 2]\n}'\n</code></pre><p>Returns</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>hello hello \"body\"\n</code></pre><h3 id=\"ssvm_fetch-in-the-request-head-overrides-body-and-any-peripheral-data\">SSVM_Fetch in the request head (overrides body and any peripheral data)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/run/1/say' \\\n--header 'SSVM_Usage_Key: 83f02dd3-6440-482f-983f-78127ed6f943' \\\n--header 'SSVM_Fetch: {\"body\": \"header\",\"hostname\": \"rpc.ssvm.secondstate.io\",\"path\": \"/api/run/1/say\",\"method\": \"POST\",\"port\": 8081,\"headers\": {\"Content-Type\": \"text/plain\",\"SSVM_Usage_Key\": \"83f02dd3-6440-482f-983f-78127ed6f943\"}}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"SSVM_Fetch\": {\n        \"body\": \"body\",\n        \"hostname\": \"rpc.ssvm.secondstate.io\",\n        \"path\": \"/api/run/1/say\",\n        \"method\": \"POST\",\n        \"port\": 8081,\n        \"headers\": {\n            \"Content-Type\": \"text/plain\",\n            \"SSVM_Usage_Key\": \"83f02dd3-6440-482f-983f-78127ed6f943\"\n        }\n    },\n    \"function_params\": [1, 2]\n}'\n</code></pre><p>Returns</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>hello hello \"header\"\n</code></pre><h3 id=\"ssvm_fetch-in-the-request-body-providing-only-a-url\">SSVM_Fetch in the request body; providing only a URL</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/run/1/say' \\\n--header 'SSVM_Usage_Key: 83f02dd3-6440-482f-983f-78127ed6f943' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"SSVM_Fetch\": \"https://raw.githubusercontent.com/tpmccallum/test_endpoint2/master/tim.txt\",\n    \"function_params\": [1, 2]\n}'\n</code></pre><p>Returns</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>hello Tim\n</code></pre><h3 id=\"ssvm_fetch-in-the-request-header-providing-only-a-url\">SSVM_Fetch in the request header; providing only a URL</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/run/1/say' \\\n--header 'SSVM_Usage_Key: 83f02dd3-6440-482f-983f-78127ed6f943' \\\n--header 'SSVM_Fetch: https://raw.githubusercontent.com/tpmccallum/test_endpoint2/master/tim2.txt' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"SSVM_Fetch\": \"https://raw.githubusercontent.com/tpmccallum/test_endpoint2/master/tim.txt\"\n}'\n</code></pre><p>Returns</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>hello Tim2\n</code></pre><h2 id=\"authenticated-calling\">Authenticated calling</h2>\n<h3 id=\"private\">Private</h3>\n<p>If a Wasm executable is for private use, the caller can make Joey generate a couple of keys (at the time when the Wasm executable is uploaded). For example, if the following header (<code>SSVM_Create_Usage_Key</code>) key is set to true in the request, the keys will be generated.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/executables' \\\n--header 'Content-Type: application/octet-stream' \\\n--header 'SSVM_Description: Private Wasm File' \\\n--header 'SSVM_Create_Usage_Key: true' \\\n--data-binary '@/Users/tpmccallum/hello_bg.wasm'\n</code></pre><p>The above code will return the following response</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"wasm_id\": 16,\n    \"wasm_sha256\": \"0xfb413547a8aba56d0349603a7989e269f3846245e51804932b3e02bc0be4b665\",\n    \"usage_key\": \"a038c28b-0e47-42e3-8686-be4c4d7f729b\",\n    \"admin_key\": \"87d6edf0-52de-48fa-a4b2-0d035e5dc70a\"\n}\n</code></pre><p>Note the <code>usage_key</code> and <code>admin_key</code>.</p>\n<h3 id=\"public\">Public</h3>\n<p>On the contrary, Wasm executables that are set into the system with no mention of <code>SSVM_Create_Usage_Key</code> are set to public by default. For example, the following request returns the generic zeroed out usage key.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/executables' \\\n--header 'Content-Type: application/octet-stream' \\\n--header 'SSVM_Description: Private Wasm File' \\\n--data-binary '@/Users/tpmccallum/hello_bg.wasm'\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"wasm_id\": 17,\n    \"wasm_sha256\": \"0xfb413547a8aba56d0349603a7989e269f3846245e51804932b3e02bc0be4b665\",\n    \"usage_key\": \"00000000-0000-0000-0000-000000000000\",\n    \"admin_key\": \"8741ec91-79d4-4718-bce9-d073438ea582\"\n}\n</code></pre><h3 id=\"switching-between-private-and-public\">Switching between private and public</h3>\n<p>To make a public Wasm executable private, simply perform the following RESTful (<code>PUT</code>) request</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request PUT 'https://rpc.ssvm.secondstate.io:8081/api/keys/17/usage_key' \\\n--header 'SSVM_Admin_Key: 8741ec91-79d4-4718-bce9-d073438ea582'\n</code></pre><p>The above request will return a fresh key as shown below.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"SSVM_Usage_Key\": \"c031f2c8-dada-4eff-9a92-8bd63011c7c1\"\n}\n</code></pre><p>This <code>PUT</code> request is also a great way to refresh keys i.e. change who can access a Wasm executable, after a hackathon or temporary training exercise etc.</p>\n<p>To make a private Wasm executable public, simply perform the following RESTful <code>DELETE</code> request</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request DELETE 'https://rpc.ssvm.secondstate.io:8081/api/keys/17/usage_key' \\\n--header 'SSVM_Admin_Key: 8741ec91-79d4-4718-bce9-d073438ea582'\n</code></pre><h2 id=\"ephemeral-storage\">Ephemeral storage</h2>\n<ul>\n<li>Allows users to quickly store ephemeral information via a RESTful endpoint (no Wasm or Rust required). This is useful for pooling information from IoT sensors or performing tasks such as quickly gathering information per second which is then placed in a batch which may be processed each 60 seconds etc.</li>\n<li>Allows users to quickly retrieve ephemeral information via RESTful endpoint.</li>\n<li>Any ephemeral information is saved for up to 1 hour. If the ephemeral information (at the specific key) is updated then the 1 hour limit is restarted.</li>\n</ul>\n<h3 id=\"store-data-and-receive-a-key-for-future-use\">Store data and receive a key for future use</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"some_json\": \"data_to_store_temporarily\"}'\n</code></pre><p>Returns</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"key\":\"e09da790-b072-46e9-9e6c-c879d07376fd\"}\n</code></pre><h3 id=\"use-the-key-to-access-the-data\">Use the key to access the data</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request GET 'https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/e09da790-b072-46e9-9e6c-c879d07376fd'\n</code></pre><p>Returns</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"value\":{\"some_json\":\"data_to_store_temporarily\"}}\n</code></pre><h3 id=\"update-the-data\">Update the data</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request PUT 'https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/e09da790-b072-46e9-9e6c-c879d07376fd' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"asdf\": \"Update the data\"}'\n</code></pre><h3 id=\"delete-the-data\">Delete the data</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl --location --request DELETE 'https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/e09da790-b072-46e9-9e6c-c879d07376fd'\n</code></pre><p>Now, as promised, let's look at the individual endpoints. </p>\n<h1 id=\"endpoints\">Endpoints</h1>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"SecondState's Wasm execution environment; Wasm-Joey","slug":"secondstates-wasm-execution-environment-wasm-joey"},{"content":"Endpoints","slug":"endpoints"}],"owner":"4967217","collectionId":"84b93d68-2073-4f51-bde3-68f19de57c62","publishedId":"SztA68nE","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-05-25T06:12:42.000Z"},"item":[{"name":"https://rpc.ssvm.secondstate.io:8081/api/executables/1","id":"acfd6d7b-ee9b-498d-9543-d702f851349d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://rpc.ssvm.secondstate.io:8081/api/executables/4?filterBy=[\"wasm_as_buffer\"]","description":"<p>Path structure</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/api/executables/:wasm_id\n</code></pre><p>Get a single wasm executable (all fields returned by default)</p>\n<h1 id=\"response\">Response</h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_id\":1,\"wasm_description\":\"Description goes here\",\"wasm_as_buffer\":{\"type\":\"Buffer\",\"data\":[49,49,44,53,44,49,44,52,44,53,44,49,44,49,49,50,44,49,44,49,54,44,49,54,44,53]}}\n</code></pre><h1 id=\"optional-parameters\">Optional parameters</h1>\n<p>Path structure (if using filters)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/api/executables/:wasm_id?filterBy=[\"wasm_id\"]\n/api/executables/:wasm_id?filterBy=[\"wasm_description\"]\n/api/executables/:wasm_id?filterBy=[\"wasm_as_buffer\"]\n</code></pre><h2 id=\"filterby\">filterBy</h2>\n<h3 id=\"wasm_id\">wasm_id</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22wasm_id%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"wasm_id\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_id\":1}\n</code></pre><h3 id=\"wasm_sha256\">wasm_sha256</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22wasm_sha256%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"wasm_sha256\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_sha256\":\"0x880633dce728eddd3d441f297f43226fd21b9bbac080d70a29407507ca6e004b\"}\n</code></pre><h3 id=\"wasm_description\">wasm_description</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22wasm_description%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"wasm_description\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_description\":\"Description goes here\"}\n</code></pre><h3 id=\"wasm_as_buffer\">wasm_as_buffer</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22wasm_as_buffer%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"wasm_as_buffer\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_as_buffer\":{\"type\":\"Buffer\",\"data\":[49,49,44,53,44,49,44,52,44,53,44,49,44,49,49,50,44,49,44,49,54,44,49,54,44,53]}}\n</code></pre><h3 id=\"wasm_state\">wasm_state</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22wasm_state%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"wasm_state\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_state\":\"state is x\"}\n</code></pre><h3 id=\"wasm_callback_object\">wasm_callback_object</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22wasm_callback_object%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"wasm_callback_object\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_callback_object\":{\"returns valid callback object\"}}\n</code></pre><h2 id=\"admin-only-filters\">Admin only filters</h2>\n<p><strong>Please note:</strong>\nThese (admin only) performance statistics are deliberately implemented on <strong>dev</strong>.rpc.ssvm.secondstate... only. Please contact us if you would like a demo.</p>\n<p>Admin only features, require the SSVM_Admin_Key. For example, the following \"total_gas_consumed\", \"total_invocations\", \"full_usage_report\" and \"latest_execution_time_in_nanoseconds\" filters will require the \"SSVM_Admin_Key\" in the request header like this.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>var settings = {\n  \"url\": \"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\\\"full_usage_report\\\"]\",\n  \"method\": \"GET\",\n  \"timeout\": 0,\n  \"headers\": {\n    \"SSVM_Admin_Key\": \"0000-xxxx-0000-xxxx-0000-xxxx\"\n  },\n};\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});\n</code></pre><h3 id=\"latest_execution_time_in_nanoseconds\">latest_execution_time_in_nanoseconds</h3>\n<p>This filter allows you to obtain the time it took to complete the most recent call.\nThe measurement is in nanoseconds, so be sure to convert to suit your needs.\nHere is a complete example, from the dev server.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>var myHeaders = new Headers();\nmyHeaders.append(\"SSVM_Admin_Key\", \"0000-xxxx-0000-xxxx-0000-xxxx\");\nvar requestOptions = {\n  method: 'GET',\n  headers: myHeaders,\n  redirect: 'follow'\n};\nfetch(\"https://dev.rpc.ssvm.secondstate.io:8081/api/executables/251?filterBy=[\\\"latest_execution_time_in_nanoseconds\\\"]\", requestOptions)\n  .then(response =&gt; response.text())\n  .then(result =&gt; console.log(result))\n  .catch(error =&gt; console.log('error', error));\n</code></pre><p>The result</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"latest_execution_time_in_nanoseconds\":\"1742587\"}\n</code></pre><p>The SSVM_Admin_Key has been changed, please contact secondstate.io if you would like a demo of how to measure performance statistics.</p>\n<h3 id=\"total_gas_consumed\">total_gas_consumed</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22total_gas_consumed%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"total_gas_consumed\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"total_gas_consumed\":\"200\"}\n</code></pre><h3 id=\"total_invocations\">total_invocations</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22total_invocations%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"total_invocations\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"total_invocations\":\"4\"}\n</code></pre><h3 id=\"full_usage_report\">full_usage_report</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=%5B%22full_usage_report%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/executables/1?filterBy=[\"full_usage_report\"]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"full_usage_report\": {\n        \"1606690637\": 50,\n        \"1606690639\": 50\n    }\n}\n</code></pre><p>The full_usage_report lists each invocation in the format of timestamp: gas. The sum of all gas values i.e. 100 is equivalent to <code>total_gas_consumed</code> and the length of the keys (timestamps) are equivalent to the <code>total_invocations</code> i.e.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>my_report = {\n    \"full_usage_report\": {\n        \"1606690637\": 50,\n        \"1606690639\": 50\n    }\n}\nObject.keys(my_report.full_usage_report).length;\n// Returns 2\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","executables","4"],"host":["rpc","ssvm","secondstate","io"],"query":[{"key":"filterBy","value":"[\"wasm_as_buffer\"]"}],"variable":[]}},"response":[],"_postman_id":"acfd6d7b-ee9b-498d-9543-d702f851349d"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/executables/","id":"45de47e7-2ca8-4b64-9a8d-2c2482a13e75","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://rpc.ssvm.secondstate.io:8081/api/executables","description":"<p>Path structure</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/api/executables\n</code></pre><p>Get all wasm executables (provides wasm_id for each)</p>\n<h1 id=\"response\">Response</h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>[{\"wasm_id\":1}, {\"wasm_id\":2}, {\"wasm_id\":3}, {\"wasm_id\":4}]\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","executables"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"45de47e7-2ca8-4b64-9a8d-2c2482a13e75"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/executables/","id":"aafb8e8f-b6cd-43d1-903f-91db47b900ed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/octet-stream","type":"text"},{"key":"SSVM_Description","value":"say","type":"text"}],"body":{"mode":"file","file":{"src":"/Users/tpmccallum/hello_bg.wasm"}},"url":"https://rpc.ssvm.secondstate.io:8081/api/executables","description":"<p>Path structure </p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/api/executables\n</code></pre><p>Set a wasm binary file. You simply have to perform this POST request and add your .wasm executable as the payload, as shown in the example -&gt;</p>\n<h1 id=\"response\">Response</h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_id\":1,\"wasm_sha256\":\"0xfb413547a8aba56d0349603a7989e269f3846245e51804932b3e02bc0be4b665\",\"usage_key\":\"83f02dd3-6440-482f-983f-78127ed6f943\",\"admin_key\":\"00ac9d9b-f611-43fe-bd54-4adc960fd2b8\"}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","executables"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"aafb8e8f-b6cd-43d1-903f-91db47b900ed"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/update_wasm_binary/3","id":"38eb967b-6ba4-4da5-96a1-144c64b732ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/octet-stream","type":"text"}],"body":{"mode":"file","file":{"src":"/Users/tpmccallum/triple/target/wasm32-unknown-unknown/debug/triple_lib.wasm"}},"url":"https://rpc.ssvm.secondstate.io:8081/api/update_wasm_binary/3","description":"<p>Path structure</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/api/update_wasm_binary/:wasm_id\n</code></pre><p>Hotswap Wasm binary (at specific wasm_id) with a different Wasm binary</p>\n<h1 id=\"response\">Response</h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_id\":1,\"wasm_sha256\":\"0xfb413547a8aba56d0349603a7989e269f3846245e51804932b3e02bc0be4b665\",\"usage_key\":\"83f02dd3-6440-482f-983f-78127ed6f943\",\"admin_key\":\"00ac9d9b-f611-43fe-bd54-4adc960fd2b8\"}\n\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","update_wasm_binary","3"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"38eb967b-6ba4-4da5-96a1-144c64b732ee"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/state/1","id":"369f451b-6528-4923-b5a8-0f8f74747c4a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","type":"text","value":"text/plain"},{"key":"SSVM_Usage_Key","value":"83f02dd3-6440-482f-983f-78127ed6f943","type":"text"}],"body":{"mode":"raw","raw":"{\"test\": \"test\"}","options":{"raw":{"language":"text"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/state/1","description":"<p>Path structure</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/api/state/:wasm_id\n</code></pre><p>Update the state object for the wasm executable with <code>wasm_id</code> of 1</p>\n<h1 id=\"response\">Response</h1>\n<p>The wasm_id of the executable which was just updated</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_id\":\"1\"}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","state","1"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"369f451b-6528-4923-b5a8-0f8f74747c4a"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/run/1/my_function/bytes","id":"b0fe3a80-16ca-4c51-86a4-32bf873eb748","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"text/plain"}],"body":{"mode":"raw","raw":"reverse this","options":{"raw":{"language":"text"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/run/21/reverse/bytes","urlObject":{"protocol":"https","port":"8081","path":["api","run","21","reverse","bytes"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"b0fe3a80-16ca-4c51-86a4-32bf873eb748"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/executables/19","id":"93bc2ddf-48cd-4755-8b42-3d7abe76d286","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/executables/19","description":"<p>Delete a Wasm executable (and all related metadata) where <code>wasm_id</code> equals <code>19</code></p>\n<h1 id=\"returns\">Returns</h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_id\":\"19\"}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","executables","19"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"93bc2ddf-48cd-4755-8b42-3d7abe76d286"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/run/1/my_function","id":"2b37d947-1b86-4d51-b836-40359e8b92a4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"text/plain","type":"text"}],"body":{"mode":"raw","raw":"reverse this","options":{"raw":{"language":"text"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/run/21/reverse","description":"<p>Execute a function that resides in your Wasm executable.</p>\n<p>Depending on the particular Rust/Wasm function, the caller will be required to provide the valid JSON in the format that the Rust/Wasm can consume it.</p>\n<p>Please note:\nThe Rust/Wasm code could explicitly declare a Struct on which serde_json could use as the data type, when parsing. However, a struct is flat. What this means, is that if you are going to parse and traverse nested data, then Rust will require that you build and maintain multiple complex data structures (which mirror the JSON data). You may want to do this, which is great. However, in some cases this may be too hard to write and maintain and so here is a proposal for an easier solution.</p>\n<p>Instead of writing complex nested Structs you could use serde_json's generic Value type as demonstrated in the following code. This approach allows for maximum flexiblility. For example if the Rust/Wasm application looks like this</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>use serde_json;\nuse serde_json::{Value};\n\n#[no_mangle]\nfn process(s: &amp;str){\n    let json_as_object: Value = serde_json::from_str(s).unwrap();\n    println!(\"{:?}\", json_as_object[\"function_params\"]);\n    println!(\"{:?}\", json_as_object[\"function_params\"][\"param_one\"]);\n    println!(\"{:?}\", json_as_object[\"function_params\"][\"param_two\"]);\n}\n</code></pre><p>Then the calling request would create a valid JSON object like the one below, in order to satisfy the Rust/Wasm's parsing of this data</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"function_params\": {\n        \"param_one\": 1,\n        \"param_two\": \"two\"\n    }\n}\n</code></pre><h1 id=\"callback\">Callback</h1>\n<p>The caller can also issue a callback object which will ensure that once the original request is performed, the second callback request will also be performed. Here is an example of a callback object.</p>\n<p>In a case where the user wanted to utilise a callback the original body of the request would be as follows (note that we are using not only the <code>function_params</code> but also the <code>callback</code> object which sits at the top level.)</p>\n<p>Please note the callback must be explicitly named <code>SSVM_Callback</code>, as shown below.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"SSVM_Callback\": {\n        \"hostname\": \"gorest.co.in\",\n        \"path\": \"/public-api/users\",\n        \"method\": \"POST\",\n        \"headers\": {\n            \"Content-Type\": \"application/json\",\n            \"Authorization\": \"Bearer 4dWCe0YCGG4IBIbKh1eRoNUdq3Qzv0xxxx\"\n        }\n    },\n    \"function_params\": {\n        \"param_one\": 4,\n        \"param_two\": 4\n    }\n}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","run","21","reverse"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"2b37d947-1b86-4d51-b836-40359e8b92a4"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/log/1","id":"d63aef49-f09b-40ab-a7cc-4849d0451187","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/log/1","description":"<h1 id=\"logging-of-execution\">Logging of execution</h1>\n<p>The <code>api/log</code> endpoint is able to provide details about past execution of wasm functions. The system captures many facets i.e. wasm_executable's state, callback objects in play, timestamp etc. every time an execution takes place. A caller can use this log to diagnose callbacks that did not complete and more. For efficiency sake, Joey allows the caller to filter logs based on any combination of the following parameters.</p>\n<h3 id=\"log_id\">log_id</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=%5B%22log_id%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=[%22log_id%22]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"log_id\":1}\n</code></pre><h3 id=\"wasm_executable_id\">wasm_executable_id</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=%5B%22wasm_executable_id%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=[%22wasm_executable_id%22]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_executable_id\":1}\n</code></pre><h3 id=\"wasm_executable_state\">wasm_executable_state</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=%5B%22wasm_executable_state%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=[%22wasm_executable_state%22]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"wasm_executable_state\":\"asdf\"}\n</code></pre><h3 id=\"execution_timestamp\">execution_timestamp</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=%5B%22execution_timestamp%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=[%22execution_timestamp%22]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"execution_timestamp\":\"2020-06-01T06:33:40.000Z\"}\n</code></pre><h3 id=\"execution_object\">execution_object</h3>\n<p><a href=\"https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=%5B%22execution_object%22%5D\">https://rpc.ssvm.secondstate.io:8081/api/log/1?filterBy=[%22execution_object%22]</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>execution_object: \"{\"callback_data_payload\": {\"function\": {\"name\": \"new template name\"}}, \"callback_request_options\": {\"path\": \"/api/run/2/my_other_function\", \"port\": 8081, \"method\": \"GET\", \"headers\": {\"Content-Type\": \"application/json\"}, \"hostname\": \"rpc.ssvm.secondstate.io\", \"maxRedirects\": 20}, \"original_wasm_executables_id\": \"1\"}\"\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","log","1"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"d63aef49-f09b-40ab-a7cc-4849d0451187"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/multipart/run/22/my_function","id":"b0be4952-8322-4eff-bb09-959d6fff9de9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"input_6","type":"file","src":"/Users/tpmccallum/for_joey/lib_small.wasm"},{"key":"fetch_input_2","value":"{ \"hostname\": \"reqres.in\",\n    \"path\": \"/api/users\",\n    \"method\": \"POST\",\n    \"headers\": {\n        \"Content-Type\": \"application/json\"\n    },\n    \"body\": {\n        \"name\": \"John Doe\",\n        \"job\": \"Content Writer\"\n    }\n}","type":"text"},{"key":"fetch_input_3","value":"https://postman-echo.com/get?foo1=bar1","type":"text"},{"key":"input_4","value":"asdf","type":"text"},{"key":"input_1","value":"{ \"left_temperature\": 35,\"right_temperature\": 38}","type":"text"},{"key":"input_5","type":"file","src":"/Users/tpmccallum/for_joey/lib_small.wasm"}]},"url":"https://rpc.ssvm.secondstate.io:8081/api/multipart/run/22/multipart","description":"<h1 id=\"multipart-request\">Multipart request</h1>\n<h1 id=\"conventions\">Conventions</h1>\n<p>Every key must end in an underscore <strong>followed</strong> by a number i.e. input_1\nThe order of the keys i.e. _1, _2, _3 relates to the order that <code>my_function</code> is expecting the function arguments</p>\n<p>Every key must <strong>not</strong> start with the reserved word <code>fetch</code> <strong>unless</strong> the caller is specifically wanting Joey to fetch the value from a remote location (upfront) and then pass that fetched value into <code>my_function</code> as an argument. See fetch_input_4 example below</p>\n<p>Every key must <strong>not</strong> start with the reserved word <code>SSVM_Callback</code> <strong>unless</strong> the caller is specifically wanting Joey to execute a callback at the very end of processing. See SSVM_Callback_6 example below</p>\n<h2 id=\"input_1\">input_1</h2>\n<p>This shows how a caller can just pass in a simple string as an argument. Joey will just pass this across to <code>my_function</code> verbatim.</p>\n<h2 id=\"input_2\">input_2</h2>\n<p>This example shows how to pass in JSON string. Data like this will just be passed straight into <code>my_function</code> verbatim. The Rust / Wasm and caller will have already agreed on how to interpret this data.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"left_temperature\": 35,\"right_temperature\": 38}}\n</code></pre><h2 id=\"fetch_input_3\">fetch_input_3</h2>\n<h3 id=\"execute-remote-request-before-calling-function\">Execute remote request before calling function</h3>\n<p>As mentioned above, if a key starts with the reserved word <code>fetch</code>, then the key must be one of two formats</p>\n<p>1 - A URL that will return remote data all on its own i.e. a URL which will return raw data or a URL pointing to a remote server's GET request endpoint. Here is an example of a URL that will return remote data all on its own i.e. a URL which will return raw data or a URL pointing to a remote server's GET request endpoint</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://postman-echo.com/get?foo1=bar1\n</code></pre><p>2 - A JSON string object which adheres to the <code>fetch_input_4</code> example below. This JSON data structure is modelled off the native Node.js <code>https.request</code> library which accepts this JSON data as <code>options</code>. See below ...</p>\n<h2 id=\"fetch_input_4\">fetch_input_4</h2>\n<p>The caller can create a JSON string object like the one below and pass this in as the value of <code>fetch_input_4</code>. Joey will execute the request as a top priority and then pass the result of this request into the <code>my_function</code> function at <code>wasm_id</code> 1 as, in this case, the 4th function parameter.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"method\": \"POST\",\n    \"hostname\": \"postman-echo.com\",\n    \"port\": 80,\n    \"path\": \"/post\",\n    \"headers\": {\n        \"Content-Type\": \"application/json\"\n    },\n    \"data\": {\n        \"hand\": \"wave\"\n    }\n}\n</code></pre><h2 id=\"input_5\">input_5</h2>\n<p>Data from callers file system that will be passed to the function as a Buffer</p>\n<h2 id=\"ssvm_callback_6\">SSVM_Callback_6</h2>\n<p>This object will be executed (after all other processing has taken place, but) right before Joey sends the result back to the original caller.</p>\n<p>The callback object must conform to the following structure i.e hostname, path, port, method etc.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"hostname\": \"rpc.ssvm.secondstate.io\",\n    \"path\": \"/api/run/46/convert_celsius_to_fahrenheit\",\n    \"method\": \"POST\",\n    \"port\": 8081,\n    \"headers\": {\n        \"Content-Type\": \"application/json\"\n    }\n}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","multipart","run","22","multipart"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"b0be4952-8322-4eff-bb09-959d6fff9de9"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage","id":"4294100f-b3cb-4b05-9991-f15d460b348d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\"some_json\": \"data_to_store_temporarily\"}","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage","description":"<p>Store ephemeral data in Joey (TTL is 1 hour only)</p>\n<p>Returns unique key like this</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"key\":\"d3e8b5b6-397b-48db-b594-013f1ca5790c\"}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","ephemeral_storage"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"4294100f-b3cb-4b05-9991-f15d460b348d"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/d3e8b5b6-397b-48db-b594-013f1ca5790c","id":"59bdc7ec-1b61-4e13-8925-0c2b5b052917","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/d3e8b5b6-397b-48db-b594-013f1ca5790c","description":"<p>Get storage at ephemeral location\nReturns the data</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"value\":{\"some_json\":\"data_to_store_temporarily\"}}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","ephemeral_storage","d3e8b5b6-397b-48db-b594-013f1ca5790c"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"59bdc7ec-1b61-4e13-8925-0c2b5b052917"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/d3e8b5b6-397b-48db-b594-013f1ca5790c","id":"33a01f77-2b5d-4a8b-bc13-b23cad62c397","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\"asdf\": \"Update the data\"}","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/d3e8b5b6-397b-48db-b594-013f1ca5790c","description":"<p>Update the data at a specific key location.</p>\n<p>This action resets the TTL to 1 hour</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"key\":\"d3e8b5b6-397b-48db-b594-013f1ca5790c\"}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","ephemeral_storage","d3e8b5b6-397b-48db-b594-013f1ca5790c"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"33a01f77-2b5d-4a8b-bc13-b23cad62c397"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/d3e8b5b6-397b-48db-b594-013f1ca5790c","id":"1fa4d837-3ee0-486c-af5d-53aa735cc2e4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/ephemeral_storage/d3e8b5b6-397b-48db-b594-013f1ca5790c","description":"<p>Delete the data at a specific key</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\"key\":\"d3e8b5b6-397b-48db-b594-013f1ca5790c\"}\n</code></pre>","urlObject":{"protocol":"https","port":"8081","path":["api","ephemeral_storage","d3e8b5b6-397b-48db-b594-013f1ca5790c"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"1fa4d837-3ee0-486c-af5d-53aa735cc2e4"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/callback/3","id":"8e1b25b3-c2b0-4823-8475-34593889480b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\"hostname\": \"rpc.ssvm.secondstate.io\",\"path\": \"/api/run/5/reverse/bytes\",\"method\": \"POST\",\"port\": 8081,\"headers\":{\"Content-Type\": \"application/octet-stream\"}}","options":{"raw":{"language":"json"}}},"url":"https://rpc.ssvm.secondstate.io:8081/api/callback/3","description":"<p>Update the callback object of a Wasm executable</p>\n<p>The default for the callback object is <code>{}</code> i.e. a blank object is created when a new Wasm executable is added to the system.</p>\n","urlObject":{"protocol":"https","port":"8081","path":["api","callback","3"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8e1b25b3-c2b0-4823-8475-34593889480b"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/keys/16/usage_key","id":"ae99a59f-5087-49a6-ab79-225dc6683688","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"SSVM_Admin_key","type":"text","value":"eae0db3b-4761-4b2e-b916-21727e79e1b0"}],"url":"https://rpc.ssvm.secondstate.io:8081/api/keys/16/usage_key","description":"<p>Using the DELETE verb, when actioning the /api/keys/:wasm_id/usage_keys endpoint, will set the SSVM_Usage_Key to a zeroed out value (publicly available)</p>\n","urlObject":{"protocol":"https","port":"8081","path":["api","keys","16","usage_key"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"ae99a59f-5087-49a6-ab79-225dc6683688"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/keys/17/usage_key","id":"0b03fb98-5b80-4758-9d88-5dfff28868da","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"SSVM_Admin_Key","value":"8741ec91-79d4-4718-bce9-d073438ea582","type":"text"}],"url":"https://rpc.ssvm.secondstate.io:8081/api/keys/17/usage_key","description":"<p>Using the PUT verb, when actioning the /api/keys/:wasm_id/usage_key endpoint will generate a new SSVM_Usage_Key which will supersede all previous SSVM_Usage_Key values for that Wasm executable.\nAs with the DELETE verb, to this endpoint, you must pass the SSVM_Admin_Key into the request headers as shown here.</p>\n","urlObject":{"protocol":"https","port":"8081","path":["api","keys","17","usage_key"],"host":["rpc","ssvm","secondstate","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"0b03fb98-5b80-4758-9d88-5dfff28868da"},{"name":"https://rpc.ssvm.secondstate.io:8081/api/executables/1","id":"0022997f-9ee5-49c9-8af6-eee68c7c061c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://rpc.ssvm.secondstate.io:8081/api/executables/4?filterBy=[\"wasm_as_buffer\"]","urlObject":{"protocol":"https","port":"8081","path":["api","executables","4"],"host":["rpc","ssvm","secondstate","io"],"query":[{"key":"filterBy","value":"[\"wasm_as_buffer\"]"}],"variable":[]}},"response":[],"_postman_id":"0022997f-9ee5-49c9-8af6-eee68c7c061c"}]}