update config location

This commit is contained in:
boneyard93501 2021-08-04 20:45:56 -05:00
parent 704f81bb15
commit ba10a3ad74
7 changed files with 18 additions and 13 deletions

View File

@ -1,5 +1,5 @@
[package] [package]
name = "hello_peer" name = "hello-world"
version = "0.1.0" version = "0.1.0"
authors = ["Fluence Labs"] authors = ["Fluence Labs"]
description = "Hello world string computation" description = "Hello world string computation"
@ -7,7 +7,7 @@ edition = "2018"
publish = false publish = false
[[bin]] [[bin]]
name = "hello_peer" name = "hello_world"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]

View File

@ -1,6 +1,6 @@
modules_dir = "artifacts/" modules_dir = "artifacts/"
[[module]] [[module]]
name = "hello_peer" name = "hello_world"
mem_pages_count = 1 mem_pages_count = 1
logger_enabled = false logger_enabled = false

View File

@ -1,13 +1,13 @@
{ {
"services": { "services": {
"hello_world_compute": { "hello_world_compute": {
"dependencies": ["hello_world_compute"], "dependencies": ["hello_world"],
"node": "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf" "node": "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf"
} }
}, },
"modules": { "modules": {
"hello_world_compute": { "hello_world_compute": {
"file": "artifacts/hello_world_compute.wasm", "file": "artifacts/hello_world.wasm",
"config": { "config": {
"preopened_files": [] "preopened_files": []
} }

View File

@ -1,6 +1,6 @@
{ {
"services": { "services": {
"hello_world_compute": { "hello_world": {
"dependencies": [ "dependencies": [
"hello_world_compute" "hello_world_compute"
], ],
@ -14,7 +14,7 @@
}, },
"modules": { "modules": {
"hello_world_compute": { "hello_world_compute": {
"file": "artifacts/hello_world_compute.wasm", "file": "artifacts/hello_world.wasm",
"config": { "config": {
"preopened_files": [] "preopened_files": []
}, },

View File

@ -0,0 +1,5 @@
{
"name": "hello_world",
"mem_pages_count": 1,
"logger_enabled": false
}

View File

@ -7,4 +7,4 @@ marine build --release
mkdir -p artifacts mkdir -p artifacts
rm -f artifacts/*.wasm rm -f artifacts/*.wasm
cp target/wasm32-wasi/release/hello_peer.wasm artifacts/ cp target/wasm32-wasi/release/hello_world.wasm artifacts/

View File

@ -22,14 +22,14 @@ module_manifest!();
pub fn main() {} pub fn main() {}
#[marine] #[marine]
pub struct HelloPeer { pub struct HelloWorld {
pub msg: String, pub msg: String,
pub reply: String, pub reply: String,
} }
#[marine] #[marine]
pub fn hello(from: String) -> HelloPeer { pub fn hello(from: String) -> HelloWorld {
HelloPeer { HelloWorld {
msg: format!("Hello from: \n{}", from), 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")] #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
fn empty_string() { fn empty_string() {
let actual = greeting.hello(String::new()); let actual = hello_world.hello(String::new());
assert_eq!(actual, "Hi, "); assert_eq!(actual, "Hi, ");
} }
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")] #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
fn non_empty_string() { fn non_empty_string() {
let actual = greeting.hello("name".to_string()); let actual = hello_world.hello("name".to_string());
assert_eq!(actual, "Hi, name"); assert_eq!(actual, "Hi, name");
} }
} }