developers! Detailed references and examples can be found here for how to use the HDK exposed functions to access powerful Holochain functions.
The hash of your public key.
This is your node address on the DHT.
It can be used for node-to-node messaging with
The identity string used when the chain was first initialized.
The hash of the first identity entry on your chain (The second entry on your chain). This is your peer's identity on the DHT.
The CapabilityRequest under which this wasm function is executing
The address of the DNA the Zome is embedded within. This is often useful as a fixed value that is known by all participants running the DNA.
The json string from the DNA top level properties field. Deserialize this into a serde_json::Value or a zome specific struct to access the fields
The Address of the public token (if any)
Allowed input for close_bundle()
Internal global for memory usage
Call an exposed function from another zome or another (bridged) instance running
in the same conductor.
Arguments for the called function are passed and resturned as
NOT YET AVAILABLE
Adds a capability claim to the local chain
Adds a capability grant to the local chain
Attempts to commit an entry to the local source chain. The entry will also be checked against the defined validation rules for that entry type. If the entry type is defined as public, it will also be published to the DHT. Returns either an address of the committed entry, or an error.
Attempts to commit an entry to your local source chain. The entry will have to pass the defined validation rules for that entry type. If the entry type is defined as public, will also publish the entry to the DHT.
Prints a string through the stdout of the running Conductor, and also writes that string to the logger in the execution context
decrypts a string payload using the agent's private key. Returns the message as a string.
Emits a signal that listeners can receive. (Status: MVP)
encrypts a string payload using the agent's private key. Returns the message as a string.
Reconstructs an address of the given entry data.
This is the same value that would be returned if
Retrieves latest version of an entry from the local chain or the DHT, by looking it up using the specified address. Returns None if no entry exists at the specified address or if the entry's status is DELETED. Note that if the entry was updated, the value retrieved may be of the updated entry which will have a different hash value. If you need to get the original value whatever the status, use get_entry_initial, or if you need to know the address of the updated entry use get_entry_result
Return an EntryHistory filled with all the versions of the entry from the version at the specified address to the latest. Returns None if no entry exists at the specified address.
Returns the Entry at the exact address specified, whatever its status. Returns None if no entry exists at the specified address.
Retrieves an entry and its metadata from the local chain or the DHT, by looking it up using the specified address. The data returned is configurable with the GetEntryOptions argument.
Helper function for get_links. Returns a vector with the default return results.
Helper function for get_links. Returns a vector of the entries themselves
Similar to the get_links_with_options but it allows the user to get the number of links in the dht
Retrieves data about entries linked to a base address with a given type and tag. This is the most general version of the various get_links helpers (such as get_links_and_load) and can return the linked addresses, entries, headers and sources. Also supports CRUD status_request. The data returned is configurable with the GetLinksOptions to specify links options and GetEntryOptions argument wto specify options when loading the entries.
Consumes four values; the address of an entry get get links from (the base), the type of the links
to be retrieved, an optional tag to match, and an options struct for selecting what meta data and crud status links to retrieve.
Note: the type is intended to describe the relationship between the
Creates a new derived key secret in the keystore derived from on a previously defined seed. Accepts two arguments: the keystore ID of the previously defined seed, and a keystore ID for the newly derived key.
Creates a new derived seed secret in the keystore, derived from a previously defined seed. Accepts two arguments: the keystore ID of the previously defined seed, and a keystore ID for the newly derived seed.
Returns the public key of a key secret Accepts one argument: the keystore ID of the desired public key. Fails if the id is a Seed secret.
Creates a new random "root" Seed secret in the keystore
Signs a payload using a private key from the keystore. Accepts one argument: the keystore ID of the desired private key.
Adds a named, tagged, directed link between two entries on the DHT. Consumes four values, two of which are the addresses of entries, and two of which are strings used to describe the link.
Returns a list of entries from your local source chain that match a given entry type name or names.
Commit a DeletionEntry to your local source chain that marks an entry as 'deleted' by setting
its status metadata to
Commits a LinkRemove entry to your local source chain that marks a link as 'deleted' by setting
its status metadata to
Sends a node-to-node message to the given agent, specified by their address.
Addresses of agents can be accessed using hdk::AGENT_ADDRESS.
This works in conjunction with the
Signs a string payload using the agent's private key. Returns the signature as a string.
Signs a vector of payloads with a private key that is generated and shredded. Returns the signatures of the payloads and the public key that can be used to verify the signatures.
Lets the DNA runtime sleep for the given duration.
NOT YET AVAILABLE
NOT YET AVAILABLE
Commit an entry to your local source chain that "updates" a previous entry, meaning when getting
the previous entry, the updated entry will be returned.
Verifies a provenance (public key, signature) against a payload
Returns the current