diff --git a/hello-world/1-browser-to-browser/air/getting-started.sayHello.air b/hello-world/1-browser-to-browser/air/getting-started.sayHello.air new file mode 100644 index 0000000..f785e4a --- /dev/null +++ b/hello-world/1-browser-to-browser/air/getting-started.sayHello.air @@ -0,0 +1,43 @@ +(xor + (seq + (seq + (seq + (seq + (seq + (seq + (seq + (seq + (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-) + (call %init_peer_id% ("getDataSrv" "targetPeerId") [] targetPeerId) + ) + (call %init_peer_id% ("getDataSrv" "targetRelayPeerId") [] targetRelayPeerId) + ) + (call -relay- ("op" "noop") []) + ) + (call targetRelayPeerId ("op" "noop") []) + ) + (xor + (call targetPeerId ("HelloPeer" "hello") [%init_peer_id%] res) + (seq + (seq + (seq + (call targetRelayPeerId ("op" "noop") []) + (call -relay- ("op" "noop") []) + ) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) + ) + (call -relay- ("op" "noop") []) + ) + ) + ) + (call targetRelayPeerId ("op" "noop") []) + ) + (call -relay- ("op" "noop") []) + ) + (xor + (call %init_peer_id% ("callbackSrv" "response") [res]) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) + ) + ) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3]) +) diff --git a/hello-world/2-hosted-services/configs/app_config.json b/hello-world/2-hosted-services/configs/app_config.json new file mode 100644 index 0000000..9054c4e --- /dev/null +++ b/hello-world/2-hosted-services/configs/app_config.json @@ -0,0 +1,18 @@ +{ + "services": { + "hello_world_compute": { + "dependencies": ["hello_world_compute"], + "node": "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf" + } + }, + "modules": { + "hello_world_compute": { + "file": "artifacts/hello_world_compute.wasm", + "config": { + "preopened_files": [] + } + } + }, + "scripts": {}, + "script_storage": {} +} \ No newline at end of file diff --git a/hello-world/2-hosted-services/configs/app_config_res.json b/hello-world/2-hosted-services/configs/app_config_res.json new file mode 100644 index 0000000..8ce2f63 --- /dev/null +++ b/hello-world/2-hosted-services/configs/app_config_res.json @@ -0,0 +1,26 @@ +{ + "services": { + "hello_world_compute": { + "dependencies": [ + "hello_world_compute" + ], + "node": "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf", + "hashDependencies": [ + "hash:65267bf45b564992ceec5a5f5c36eb6f17dbbb9f0a452419ffa049d2457eeb89" + ], + "blueprint_id": "81e837fc93b970155b5c2d44e2a18d79ca88a9917db9797a271a342c0ed6516e", + "id": "ba24be5b-9789-48ac-b38a-82c9d3eb0d34" + } + }, + "modules": { + "hello_world_compute": { + "file": "artifacts/hello_world_compute.wasm", + "config": { + "preopened_files": [] + }, + "hash": "65267bf45b564992ceec5a5f5c36eb6f17dbbb9f0a452419ffa049d2457eeb89" + } + }, + "scripts": {}, + "script_storage": {} +} \ No newline at end of file diff --git a/hello-world/2-hosted-services/scripts/build.sh b/hello-world/2-hosted-services/scripts/build.sh new file mode 100755 index 0000000..116825b --- /dev/null +++ b/hello-world/2-hosted-services/scripts/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail + +# This script builds all subprojects and puts all created Wasm modules in one dir +cargo update --aggressive +marine build --release + +mkdir -p artifacts +rm -f artifacts/*.wasm +cp target/wasm32-wasi/release/hello_peer.wasm artifacts/