feat: add aqua-ipfs-distro crate (#72)

* add aqua-ipfs-distro crate
This commit is contained in:
Maria Kuklina 2023-04-24 11:20:55 +02:00 committed by GitHub
parent 39e86913c6
commit 01c645e8c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 71 additions and 0 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ builtin-package/*.wasm
.bic_cache .bic_cache
aqua-ipfs.tar.gz aqua-ipfs.tar.gz
**/ipfs-service/*

32
service/Cargo.lock generated
View File

@ -17,6 +17,14 @@ version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
[[package]]
name = "aqua-ipfs-distro"
version = "0.5.10"
dependencies = [
"built",
"maplit",
]
[[package]] [[package]]
name = "arrayref" name = "arrayref"
version = "0.3.6" version = "0.3.6"
@ -83,6 +91,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
[[package]]
name = "built"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b9c056b9ed43aee5e064b683aa1ec783e19c6acec7559e3ae931b7490472fbe"
dependencies = [
"cargo-lock",
]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.12.0" version = "3.12.0"
@ -104,6 +121,18 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "cargo-lock"
version = "8.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996"
dependencies = [
"semver 1.0.16",
"serde",
"toml",
"url",
]
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.78" version = "1.0.78"
@ -1508,6 +1537,9 @@ name = "semver"
version = "1.0.16" version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "semver-parser" name = "semver-parser"

View File

@ -2,4 +2,5 @@
members = [ members = [
"effector", "effector",
"pure", "pure",
"distro",
] ]

View File

@ -17,3 +17,6 @@ rm -f artifacts/*.wasm
cp target/wasm32-wasi/release/ipfs_effector.wasm artifacts/ cp target/wasm32-wasi/release/ipfs_effector.wasm artifacts/
cp target/wasm32-wasi/release/ipfs_pure.wasm artifacts/ cp target/wasm32-wasi/release/ipfs_pure.wasm artifacts/
marine aqua artifacts/ipfs_pure.wasm -s Ipfs -i aqua-ipfs >../aqua/ipfs.aqua marine aqua artifacts/ipfs_pure.wasm -s Ipfs -i aqua-ipfs >../aqua/ipfs.aqua
mkdir -p distro/ipfs-service
cp -v artifacts/ipfs_effector.wasm artifacts/ipfs_pure.wasm Config.toml distro/ipfs-service

15
service/distro/Cargo.toml Normal file
View File

@ -0,0 +1,15 @@
[package]
name = "aqua-ipfs-distro"
version = "0.5.10" # It should same as aqua-ipfs facade I guess
description = "distribution of aqua ipfs service"
edition = "2021"
build = "build.rs"
include = [ "/src", "/ipfs-service", "build.rs", "Cargo.toml" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
maplit = "1.0.2"
[build-dependencies]
built = "0.5.2"

3
service/distro/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
built::write_built_file().expect("Failed to acquire build-time information")
}

16
service/distro/src/lib.rs Normal file
View File

@ -0,0 +1,16 @@
pub const IPFS_EFFECTOR: &'static [u8] = include_bytes!("../ipfs-service/ipfs_effector.wasm");
pub const IPFS_FACADE: &'static [u8] = include_bytes!("../ipfs-service/ipfs_pure.wasm");
pub const CONFIG: &'static [u8] = include_bytes!("../ipfs-service/Config.toml");
pub mod build_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}
pub use build_info::PKG_VERSION as VERSION;
pub fn modules() -> std::collections::HashMap<&'static str, &'static [u8]> {
maplit::hashmap! {
"facade" => IPFS_FACADE,
"effector" => IPFS_EFFECTOR,
}
}