mirror of
https://github.com/fluencelabs/examples
synced 2025-05-04 15:12:14 +00:00
update configs
This commit is contained in:
parent
af5cb52442
commit
eb2bfd7818
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "hello_world_compute"
|
||||
name = "hello_peer"
|
||||
version = "0.1.0"
|
||||
authors = ["Fluence Labs"]
|
||||
description = "Hello world string computation"
|
||||
@ -7,7 +7,7 @@ edition = "2018"
|
||||
publish = false
|
||||
|
||||
[[bin]]
|
||||
name = "hello_world_compute"
|
||||
name = "hello_peer"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
|
@ -1,6 +1,6 @@
|
||||
modules_dir = "artifacts/"
|
||||
|
||||
[[module]]
|
||||
name = "hello_world_compute"
|
||||
name = "hello_peer"
|
||||
mem_pages_count = 1
|
||||
logger_enabled = false
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"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": {}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
{
|
||||
"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": {}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#!/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
|
||||
marine build --release
|
||||
|
||||
mkdir -p artifacts
|
||||
rm -f artifacts/*.wasm
|
||||
cp target/wasm32-wasi/release/hello_world_compute.wasm artifacts/
|
@ -19,19 +19,19 @@ use marine_rs_sdk::module_manifest;
|
||||
|
||||
module_manifest!();
|
||||
|
||||
pub fn main() {}
|
||||
|
||||
#[marine]
|
||||
pub struct HelloComputation {
|
||||
pub struct HelloPeer {
|
||||
pub msg: String,
|
||||
pub reply: String,
|
||||
}
|
||||
|
||||
pub fn main() {}
|
||||
|
||||
#[marine]
|
||||
pub fn hello_world(from: String) -> HelloComputation {
|
||||
HelloComputation {
|
||||
pub fn hello(from: String) -> HelloPeer {
|
||||
HelloPeer {
|
||||
msg: format!("Hello from: \n{}", from),
|
||||
reply: format!("Hello back to you, \n{}", from)
|
||||
reply: format!("Hello back to you, \n{}", from),
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,13 +41,13 @@ mod tests {
|
||||
|
||||
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
|
||||
fn empty_string() {
|
||||
let actual = greeting.greeting(String::new());
|
||||
let actual = greeting.hello(String::new());
|
||||
assert_eq!(actual, "Hi, ");
|
||||
}
|
||||
|
||||
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
|
||||
fn non_empty_string() {
|
||||
let actual = greeting.greeting("name".to_string());
|
||||
let actual = greeting.hello("name".to_string());
|
||||
assert_eq!(actual, "Hi, name");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user