Skip to content

Commit

Permalink
feat: implement ic-oss-can macro
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jul 13, 2024
1 parent cbee61f commit 4a8e5e1
Show file tree
Hide file tree
Showing 14 changed files with 1,093 additions and 64 deletions.
102 changes: 68 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ members = [
"src/ic_oss_bucket",
"src/ic_oss_cluster",
"src/ic_oss_types",
"src/ic_oss_can",
"src/ic_oss",
"src/ic_oss_cli",
"examples/ai_canister",
]
resolver = "2"

Expand Down
26 changes: 26 additions & 0 deletions examples/ai_canister/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "ai_canister"
version = "0.1.0"
edition = "2021"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib"]

[dependencies]
bytes = { workspace = true }
candid = { workspace = true }
ic-cdk = { workspace = true }
ic-cdk-timers = { workspace = true }
ic-stable-structures = { workspace = true }
base64 = { workspace = true }
ciborium = { workspace = true }
hex = { workspace = true }
coset = { workspace = true }
serde = { workspace = true }
serde_bytes = { workspace = true }
getrandom = { workspace = true }
ic-oss-types = { path = "../../src/ic_oss_types", version = "0.5" }
ic-oss-can = { path = "../../src/ic_oss_can", version = "0.5" }
21 changes: 21 additions & 0 deletions examples/ai_canister/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
BUILD_ENV := rust

.PHONY: build-wasm build-did

lint:
@cargo fmt
@cargo clippy --all-targets --all-features

fix:
@cargo clippy --fix --workspace --tests

test:
@cargo test --workspace -- --nocapture

# cargo install ic-wasm
build-wasm:
@cargo build --release --target wasm32-unknown-unknown --package ai_canister

# cargo install candid-extractor
build-did:
candid-extractor ../../target/wasm32-unknown-unknown/release/ai_canister.wasm > ai_canister.did
Loading

0 comments on commit 4a8e5e1

Please sign in to comment.