mirror of
https://github.com/fluencelabs/marine.git
synced 2025-06-26 21:21:36 +00:00
move bin to examples/wasm/artifacts
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,5 +7,5 @@ target/
|
|||||||
*.wat
|
*.wat
|
||||||
|
|
||||||
# Allowed Wasm files for the example
|
# Allowed Wasm files for the example
|
||||||
!bin/wasm_ipfs_rpc_wit.wasi.wasm
|
!/examples/ipfs_node/wasm/artifacts/wasm_ipfs_rpc_wit.wasi.wasm
|
||||||
!bin/wasm_modules/*
|
!/examples/ipfs_node/wasm/artifacts/wasm_modules/*
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
[core_module.wasi]
|
[core_module.wasi]
|
||||||
envs = []
|
envs = []
|
||||||
preopened_files = ["/Users/mike/dev/work/fluence/wasm/tmp/"]
|
preopened_files = ["./wasm/artifacts"]
|
||||||
mapped_dirs = { "tmp" = "/Users/mike/dev/work/fluence/wasm/tmp" }
|
mapped_dirs = { "tmp" = "./wasm/artifacts" }
|
||||||
|
|
||||||
[rpc_module]
|
[rpc_module]
|
||||||
mem_pages_count = 100
|
mem_pages_count = 100
|
||||||
@ -18,5 +18,5 @@
|
|||||||
|
|
||||||
[rpc_module.wasi]
|
[rpc_module.wasi]
|
||||||
envs = []
|
envs = []
|
||||||
preopened_files = ["/Users/mike/dev/work/fluence/wasm/tmp"]
|
preopened_files = ["./wasm/artifacts"]
|
||||||
mapped_dirs = { "tmp" = "/Users/mike/dev/work/fluence/wasm/tmp" }
|
mapped_dirs = { "tmp" = "./wasm/artifacts" }
|
||||||
|
@ -19,9 +19,9 @@ use fluence_faas::IValue;
|
|||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
const IPFS_MODULES_DIR: &str = "../../bin/wasm_modules";
|
const IPFS_MODULES_DIR: &str = "wasm/artifacts/wasm_modules";
|
||||||
const IPFS_MODULES_CONFIG_PATH: &str = "Config.toml";
|
const IPFS_MODULES_CONFIG_PATH: &str = "Config.toml";
|
||||||
const IPFS_RPC: &str = "../../bin/wasm_ipfs_rpc_wit.wasi.wasm";
|
const IPFS_RPC: &str = "wasm/artifacts/wasm_ipfs_rpc_wit.wasi.wasm";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let ipfs_rpc = std::fs::read(IPFS_RPC).unwrap();
|
let ipfs_rpc = std::fs::read(IPFS_RPC).unwrap();
|
||||||
@ -41,7 +41,7 @@ fn main() {
|
|||||||
println!("ipfs node addresses are:\n{:?}", node_addresses);
|
println!("ipfs node addresses are:\n{:?}", node_addresses);
|
||||||
|
|
||||||
let result = ipfs_node
|
let result = ipfs_node
|
||||||
.call_code(&ipfs_rpc, "put", &[IValue::String("hello, world!".to_string())])
|
.call_code(&ipfs_rpc, "put", &[IValue::String("Hello, world".to_string())])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
println!("execution result {:?}", result);
|
println!("execution result {:?}", result);
|
||||||
|
1
examples/ipfs_node/wasm/artifacts/ipfs_rpc_file
Normal file
1
examples/ipfs_node/wasm/artifacts/ipfs_rpc_file
Normal file
@ -0,0 +1 @@
|
|||||||
|
Hello, world
|
Reference in New Issue
Block a user