Holochain Development Kit (HDK)
The HDK helps in writing Holochain applications. Holochain DNAs need to be written in WebAssembly, or a language that compiles to Wasm, such as Rust. The HDK handles some of the low-level details of Wasm execution like memory allocation, (de)serializing data, and shuffling data and functions into and out of Wasm memory via some helper functions and Holochain-specific macros.
The HDK lets the developer focus on application logic and, as much as possible, forget about the underlying low-level implementation. It would be possible to write DNA source code without an HDK, but it would be extremely tedious!
Throughout the development process it will be helpful to click around through this reference, but the most useful places to start reading are the define_zome! macro, and the list of exposed functions that Holochain offers: the API.
developers! Detailed references and examples can be found here for how to use the HDK exposed functions to access powerful Holochain functions.
This file contains the macros used for creating validating entry type definitions, and validating links definitions within those.
This file contains defitions for Zome errors and also Zome Results.
This file contains small helper functions relating to WASM memory management and serialization used throughout the HDK.
Holds the internal/private zome API function
This file contains the define_zome! macro, and smaller helper macros.
This file contains the "secret" functions that get added to Zomes, by the HDK. These functions match expectations that Holochain has... every Zome technically needs these functions, but not every developer should have to write them. A notable function defined here is __hdk_get_json_definition which allows Holochain to retrieve JSON defining the Zome.
Types required by all but the most trivial zomes. This can greatly simplify imports for the majority of developers by simply adding use hdk::prelude::*;
Every Zome must utilize the
This structs carries information contextual for the process of validating an entry of link and is passed in to the according callbacks.
This struct carries information needed for Validating Entry Data, It is passed between callbacks and allows the user to validate using each supplied variant.
This struct carries information needed for Validating Link Data, It is passed between callbacks and allows the user to validate using each supplied variant.