mirror of
https://github.com/fluencelabs/examples
synced 2025-06-27 16:51:33 +00:00
update marine example
This commit is contained in:
@ -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])
|
||||||
|
)
|
18
hello-world/2-hosted-services/configs/app_config.json
Normal file
18
hello-world/2-hosted-services/configs/app_config.json
Normal file
@ -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": {}
|
||||||
|
}
|
26
hello-world/2-hosted-services/configs/app_config_res.json
Normal file
26
hello-world/2-hosted-services/configs/app_config_res.json
Normal file
@ -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": {}
|
||||||
|
}
|
10
hello-world/2-hosted-services/scripts/build.sh
Executable file
10
hello-world/2-hosted-services/scripts/build.sh
Executable file
@ -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/
|
Reference in New Issue
Block a user