Entrypoint
Every guest program must opt out of the standard Rust runtime and declare its entry point. Without it, the zkVM has no function to execute.
entrypoint!
Registers a function as the zkVM entry point and opts the crate out of
the standard Rust runtime. The #![no_main] crate attribute is also
required — the zkVM has no OS to provide a default runtime or main
symbol.
ziskos::entrypoint!(fn_name)
Parameters
| Name | Type | Description |
|---|---|---|
fn_name | identifier | Name of the function to register as the guest entry point. Must have signature fn() -> (). |
Example
#![no_main]
ziskos::entrypoint!(main);
fn main() {
// guest code runs here
}
note
The #![no_main] attribute is required at the crate root. Without it, the Rust compiler generates a default main function that conflicts with the #[no_mangle] main the macro produces, causing a linker error.