mirror of
https://github.com/fluencelabs/examples
synced 2025-06-22 06:11:32 +00:00
change dir name
This commit is contained in:
5
aqua-examples/decentralized-blockchain-gateway/utilities/.gitignore
vendored
Normal file
5
aqua-examples/decentralized-blockchain-gateway/utilities/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
debug/
|
||||
target/
|
||||
Cargo.lock
|
||||
**/*.bk
|
||||
**/*.bak
|
@ -0,0 +1,22 @@
|
||||
[package]
|
||||
name = "utilities"
|
||||
version = "0.1.5"
|
||||
authors = ["boneyard93501 <4523011+boneyard93501@users.noreply.github.com>"]
|
||||
edition = "2018"
|
||||
description = "utilities, a Marine wasi module"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[[bin]]
|
||||
name = "utilities"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
marine-rs-sdk = { version = "0.6.15", features = ["logger"] }
|
||||
log = "0.4.14"
|
||||
|
||||
[dev-dependencies]
|
||||
marine-rs-sdk-test = "0.6.0"
|
||||
|
||||
[dev]
|
||||
[profile.release]
|
||||
opt-level = "s"
|
@ -0,0 +1,6 @@
|
||||
modules_dir = "artifacts/"
|
||||
|
||||
[[module]]
|
||||
name = "utilities"
|
||||
max_heap_size = "10 KiB"
|
||||
logger_enabled = true
|
@ -0,0 +1,18 @@
|
||||
# Marine Starter Template
|
||||
|
||||
Get started quickly with your Wasm project with this template.
|
||||
To use this template you should have the following components available:
|
||||
|
||||
* Rust [installation instructions](https://www.rust-lang.org/tools/install)
|
||||
* Cargo Generate [installation instructions](https://github.com/cargo-generate/cargo-generate#installation)
|
||||
* Marine [installation instructions](https://github.com/cargo-generate/cargo-generate#installation)
|
||||
|
||||
Use the template with `cargo generate`:
|
||||
|
||||
```bash
|
||||
cargo generate cargo generate --git https://github.com/boneyard93501/fluence-template.git
|
||||
```
|
||||
|
||||
Which will prompt you for the project name and then generate the project, which will be your directory name. `cd` into your new directory and run `./scripts/build.sh` to compile the supplied __greeting__ function to a Wasm file ready for deployment.
|
||||
|
||||
Check out the [Fluence documentation](https://doc.fluence.dev/docs/) for more details on Marine and Aqua.
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"utilities": {
|
||||
"name": "utilities",
|
||||
"modules": [
|
||||
{
|
||||
"name": "utilities",
|
||||
"path": "./artifacts/utilities.wasm"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash -o errexit -o nounset -o pipefail
|
||||
cargo update --aggressive
|
||||
|
||||
mkdir -p artifacts
|
||||
rm -f artifacts/*.wasm
|
||||
marine build --release
|
||||
cp target/wasm32-wasi/release/utilities.wasm artifacts/
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2022 Fluence Labs Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use marine_rs_sdk::{marine, module_manifest, WasmLoggerBuilder};
|
||||
|
||||
module_manifest!();
|
||||
|
||||
pub fn main() {
|
||||
WasmLoggerBuilder::new().build().unwrap();
|
||||
}
|
||||
|
||||
#[marine]
|
||||
pub struct CustomResult {
|
||||
stdout: String,
|
||||
stderr: String,
|
||||
provider_name: String,
|
||||
error: bool,
|
||||
}
|
||||
|
||||
#[marine]
|
||||
pub fn to_struct(name: String, stdout: String, stderr: String) -> String {}
|
Reference in New Issue
Block a user