# custom_host_functions.rs - source
Source of the Rust file `docs/sdk/src/reference_docs/custom_host_functions.rs`.

#
pezkuwi_sdk_docs/reference_docs/
custom_host_functions.rs

    1//! # Custom Host Functions
    2//!
    3//! Host functions are functions that the wasm instance can use to communicate with the node. Learn
    4//! more about this in [`crate::reference_docs::wasm_meta_protocol`].
    5//!
    6//! ## Finding Host Functions
    7//!
    8//! To declare a set of functions as host functions, you need to use the `#[runtime_interface]`
    9//! ([`pezsp_runtime_interface`]) attribute macro. The most notable set of host functions are those
    10//! that allow the runtime to access the chain state, namely [`pezsp_io::storage`]. Some other
    11//! notable host functions are also defined in [`pezsp_io`].
    12//!
    13//! ## Adding New Host Functions
    14//!
    15//! > Adding a new host function is a big commitment and should be done with care. Namely, the nodes
    16//! > in the network need to support all host functions forever in order to be able to sync
    17//! > historical blocks.
    18//!
    19//! Adding host functions is only possible when you are using a node-template, so that you have
    20//! access to the boilerplate of building your node.
    21//!
    22//! A group of host functions can always be grouped to gether as a tuple:
    23#![doc = docify::embed!("../../bizinikiwi/primitives/io/src/lib.rs", BizinikiwiHostFunctions)]
    24//!
    25//! The host functions are attached to the node side's [`pezsc_executor::WasmExecutor`]. For example
    26//! in the minimal template, the setup looks as follows:
    27#![doc = docify::embed!("../../templates/minimal/node/src/service.rs", FullClient)]