Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

driver-sdk

The contract between a Juno controller and a driver: the types both sides speak, the proxy contracts a driver implements, the manifest and package formats, and junodrv to check and build one.

Public, and depends on nothing of Juno's — writing a driver needs access to this repository and nothing else.

Everything you need to write one is at docs.juno.house.

[dependencies]
# Track `main`. This repository carries no tags on purpose: the contracts are still moving, and
# a pin that has to be bumped by hand is a pin that ends up years behind the contracts it
# claims to check. Your `Cargo.lock` records the exact commit.
driver-sdk = { git = "https://github.com/junohouse/driver-sdk", branch = "main" }

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

# A driver is downloaded and kept per project, and it spends its time waiting on a device
# rather than in its own code — so build it for size. Worth 30-35% on every certified driver
# measured, with no source change.
[profile.release]
opt-level = "z"
codegen-units = 1
lto = true
strip = true
rustup target add wasm32-wasip1
cargo build --release --target wasm32-wasip1

It is a sandbox. Your driver cannot open a file or a socket, read a clock, or see another driver: the controller grants five imports, which is what Rust's std needs to start, report a panic, and ask for entropy. This costs nothing in practice, because every side effect a driver has was already a HostCall it returns for the controller to perform.

About

Write a driver for a Juno controller

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages