mirror of
https://github.com/fluencelabs/examples
synced 2024-12-04 19:20:17 +00:00
update config location
This commit is contained in:
parent
704f81bb15
commit
ba10a3ad74
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "hello_peer"
|
||||
name = "hello-world"
|
||||
version = "0.1.0"
|
||||
authors = ["Fluence Labs"]
|
||||
description = "Hello world string computation"
|
||||
@ -7,7 +7,7 @@ edition = "2018"
|
||||
publish = false
|
||||
|
||||
[[bin]]
|
||||
name = "hello_peer"
|
||||
name = "hello_world"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
|
@ -1,6 +1,6 @@
|
||||
modules_dir = "artifacts/"
|
||||
|
||||
[[module]]
|
||||
name = "hello_peer"
|
||||
name = "hello_world"
|
||||
mem_pages_count = 1
|
||||
logger_enabled = false
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"services": {
|
||||
"hello_world_compute": {
|
||||
"dependencies": ["hello_world_compute"],
|
||||
"dependencies": ["hello_world"],
|
||||
"node": "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf"
|
||||
}
|
||||
},
|
||||
"modules": {
|
||||
"hello_world_compute": {
|
||||
"file": "artifacts/hello_world_compute.wasm",
|
||||
"file": "artifacts/hello_world.wasm",
|
||||
"config": {
|
||||
"preopened_files": []
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"services": {
|
||||
"hello_world_compute": {
|
||||
"hello_world": {
|
||||
"dependencies": [
|
||||
"hello_world_compute"
|
||||
],
|
||||
@ -14,7 +14,7 @@
|
||||
},
|
||||
"modules": {
|
||||
"hello_world_compute": {
|
||||
"file": "artifacts/hello_world_compute.wasm",
|
||||
"file": "artifacts/hello_world.wasm",
|
||||
"config": {
|
||||
"preopened_files": []
|
||||
},
|
||||
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "hello_world",
|
||||
"mem_pages_count": 1,
|
||||
"logger_enabled": false
|
||||
}
|
@ -7,4 +7,4 @@ marine build --release
|
||||
|
||||
mkdir -p artifacts
|
||||
rm -f artifacts/*.wasm
|
||||
cp target/wasm32-wasi/release/hello_peer.wasm artifacts/
|
||||
cp target/wasm32-wasi/release/hello_world.wasm artifacts/
|
||||
|
@ -22,14 +22,14 @@ module_manifest!();
|
||||
pub fn main() {}
|
||||
|
||||
#[marine]
|
||||
pub struct HelloPeer {
|
||||
pub struct HelloWorld {
|
||||
pub msg: String,
|
||||
pub reply: String,
|
||||
}
|
||||
|
||||
#[marine]
|
||||
pub fn hello(from: String) -> HelloPeer {
|
||||
HelloPeer {
|
||||
pub fn hello(from: String) -> HelloWorld {
|
||||
HelloWorld {
|
||||
msg: format!("Hello from: \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.hello(String::new());
|
||||
let actual = hello_world.hello(String::new());
|
||||
assert_eq!(actual, "Hi, ");
|
||||
}
|
||||
|
||||
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
|
||||
fn non_empty_string() {
|
||||
let actual = greeting.hello("name".to_string());
|
||||
let actual = hello_world.hello("name".to_string());
|
||||
assert_eq!(actual, "Hi, name");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user