Expand description
Exports common types and functions according to the Rust prelude pattern.
Re-exports§
pub use crate::capability::create_cap_claim;pub use crate::capability::create_cap_grant;pub use crate::capability::delete_cap_grant;pub use crate::capability::generate_cap_secret;pub use crate::capability::update_cap_grant;pub use crate::chain::get_agent_activity;pub use crate::chain::query;pub use crate::ed25519::sign;pub use crate::ed25519::sign_ephemeral;pub use crate::ed25519::sign_ephemeral_raw;pub use crate::ed25519::sign_raw;pub use crate::entry::create;pub use crate::entry::create_entry;pub use crate::entry::delete;pub use crate::entry::delete_entry;pub use crate::entry::get;pub use crate::entry::get_details;pub use crate::entry::update;pub use crate::entry::update_entry;pub use crate::hash_path::anchor::anchor;pub use crate::hash_path::anchor::list_anchor_addresses;pub use crate::hash_path::anchor::list_anchor_type_addresses;pub use crate::hash_path::anchor::TryFromPath;pub use crate::hash_path::path::HdkPathExt;pub use crate::info::agent_info;pub use crate::info::call_info;pub use crate::link::count_links;pub use crate::link::create_link;pub use crate::link::delete_link;pub use crate::link::get_links;pub use crate::link::get_links_details;pub use crate::link::GetLinksInputBuilder;pub use crate::map_extern;pub use crate::map_extern;pub use crate::p2p::call;pub use crate::p2p::call_remote;pub use crate::p2p::emit_signal;pub use crate::p2p::send_remote_signal;pub use crate::time::schedule;pub use crate::time::sys_time;pub use crate::validation_receipt::get_validation_receipts;pub use crate::x_salsa20_poly1305::create_x25519_keypair;pub use crate::x_salsa20_poly1305::ed_25519_x_salsa20_poly1305_encrypt;pub use crate::x_salsa20_poly1305::x_25519_x_salsa20_poly1305_encrypt;pub use crate::x_salsa20_poly1305::x_salsa20_poly1305_encrypt;pub use hdi;pub use hdk_derive;pub use holo_hash;pub use holochain_zome_types;pub use tracing;pub use crate::clone::*;pub use crate::hash::*;pub use crate::hdk::*;pub use crate::random::*;
Modules§
- allocation
- builder
- conversions
- data
- encode
- Include nice string encoding methods and From impls
- encrypted_
data - genesis
- Types related to the genesis process whereby a user commits their initial records and validates them to the best of their ability. Full validation may not be possible if network access is required, so they perform a “self-check” (as in “check yourself before you wreck yourself”) before joining to ensure that they can catch any problems they can before being subject to the scrutiny of their peers and facing possible rejection.
- hash_
type - Defines the prefixes for the various HashTypes, as well as the traits which unify them
- holochain_
serialized_ bytes - instrument
- Attach a span to a
std::future::Future. - key_ref
- nonce
- op
- Dht Operations
- result
- serde_
bytes - Wrapper types to enable optimized handling of
&[u8]andVec<u8>. - x25519
Macros§
- app_
entry - Implements conversion traits to allow a struct to be handled as an app entry. If you have some need to implement custom serialization logic or metadata injection you can do so by implementing these traits manually instead.
- assert_
length - Helper for ensuring the proper number of bytes is used in various situations
- debug
- Constructs an event at the debug level.
- entry_
type - Implements a whole lot of sane defaults for a struct or enum that should behave as an entry. All the entry def fields are available as dedicated methods on the type and matching From impls are provided for each. This allows for both Foo::entry_types() and EntryDef::from(Foo::new()) style logic which are both useful in different scenarios.
- error
- Constructs an event at the error level.
- holochain_
serial - unidiomatic way to derive default trait implementations of TryFrom in/out of SerializedBytes
- host_
externs - impl_
hashable_ content - A default HashableContent implementation, suitable for content which
is already
TryInto<SerializedBytes>, and uses a PrimitiveHashType - info
- Constructs an event at the info level.
- map_
extern - Hides away the gross bit where we hook up integer pointers to length-prefixed guest memory to serialization and deserialization, and returning things to the host, and memory allocation and deallocation.
- paste
- trace
- Constructs an event at the trace level.
- try_ptr
- A simple macro to wrap
return_err_ptrin an analogy to the native rust?. - warn
- Constructs an event at the warn level.
- wasm_
error - Helper macro for returning an error from a WASM.
Structs§
- Action
Builder Common - Agent
Activity - An agent’s status and chain records returned from a
hdk::chain::get_agent_activityquery. - Agent
Info - The struct containing all information about the executing agent’s identity.
- Agent
Validation Pkg - Action for an agent validation package, used to determine whether an agent is allowed to participate in this DNA
- Anchor
- An
Anchorcan only be 1 or 2 levels deep as “type” and “text”. - AppCap
Grant Info - A list which map a cell ID to their capability grant information.
- AppEntry
Bytes - Newtype for the bytes comprising an App entry
- AppEntry
Def - Information about a class of Entries provided by the DNA
- AppEntry
DefLocation - The location of an app entry definition.
- AppEntry
Name - Identifier for an entry definition. This may be removed.
- AppSignal
- A signal emitted by an app via
emit_signal - BTree
Set - An ordered set based on a B-Tree.
- Block
- Represents a block.
Also can represent an unblock.
NOT serializable and NOT pub fields by design.
try_newMUST be the only entrypoint to build aBlockas this enforces that the start/end times are valid according to invariants the SQL queries rely on to avoid corrupting the database. - Call
- Call
Info - CapAccess
Info - Represents access info for capability grants .
- CapClaim
- System entry to hold a capability token claim for use as a caller. Stored by a claimant so they can remember what’s necessary to exercise this capability by sending the secret to the grantor.
- CapGrant
Info - Information about a capability grant.
- CapSecret
- A CapSecret is used by a caller to prove to a callee access to a committed CapGrant.
- CellId
- The unique identifier for a Cell. Cells are uniquely determined by this pair - this pair is necessary and sufficient to refer to a cell in a conductor
- Chain
Filter - Filter the contiguous chain of actions from an agent’s source chain.
- Chain
Fork - The chain has been forked by these two actions at this point. The ordering
of the values in
first_actionandsecond_actionis undefined, and in cases of three or more actions causing a fork, different peers may report different hash pairs. - Chain
Head - A pairing of an action sequence and its corresponding action hash in a chain.
This is used for both
ChainStatus::Valid, where the given value is the most recent item in a valid and contiguous chain, andChainStatus::Invalid, where the value is the first invalid item in a previously valid and contiguous chain. - Chain
Query Filter - Specifies arguments to a query of the source chain, including ordering and filtering.
This is used by both
hdk::chain::queryandhdk::chain::get_agent_activity, although the latter function ignores it ifActivityRequest::Statusis used. - CloneId
- Identifier of a clone cell, composed of the DNA’s role name and the index of the clone, starting at 0.
- Cloned
Cell - Cloned cell that was created from a provisioned cell at runtime.
- Close
Chain - When migrating to a new version of a DNA, this action is committed to the old chain to declare the migration path taken. This action can also be taken to simply close down a chain with no forward reference to a migration.
- Close
Chain Input - Input to close a chain.
- Component
- Each path component is arbitrary bytes to be hashed together in a predictable way when the path is hashed to create something that can be linked and discovered by all DHT participants.
- Composite
Hash Conversion Error - Error converting a composite hash into a subset composite hash, due to type mismatch
- Coordinator
Zome Def - Counter
Signing Agent State - Every countersigning agent must sign against their chain state. The chain must be frozen until each agent decides to sign or exit the session.
- Counter
Signing Session Data - All the data required for a countersigning session.
- Counter
Signing Session Times - Every countersigning session must complete a full set of actions between the start and end times to be valid.
- Crdt
Type - Create
- An action which “speaks” Entry content into being. The same content can be referenced by multiple such actions.
- Create
Base - Base data for Create actions.
- Create
Clone Cell Input - The arguments to create a clone of an existing cell.
- Create
Input - Zome input to create an entry.
- Create
Link - Declares that a metadata Link should be made between two hashes of anything; could be data or an op or anything that can be hashed.
- Create
Link Input - Zome IO inner type for link creation.
- Curry
Payloads - Map of zome functions to the payloads to curry into to them
- Delete
- Declare that a previously published Action should be nullified and considered deleted.
- Delete
Input - Zome input for all delete operations.
- Delete
Link - Declares that a previously made Link should be nullified and considered removed.
- Delete
Link Input - Desensitized
Zome Call CapGrant - The outbound DTO of a ZomeCall capability grant info request. CapAccess secrets are omitted, Access types and assignees are provided under CapAccessInfo.
- Disable
Clone Cell Input - Arguments to specify the clone cell to be disabled.
- Dna
- The Dna Action is always the first action in a source chain
- DnaDef
- The definition of a DNA: the hash of this data is what produces the DnaHash.
- DnaInfo
V1 - Information about the current DNA.
- DnaInfo
V2 - Information about the current DNA.
- DnaModifiers
- Modifiers of this DNA - the network seed, properties and origin time - as opposed to the actual DNA code. These modifiers are included in the DNA hash computation.
- DnaModifiers
Opt DnaModifiersoptions of which all are optional.- Ed25519X
Salsa20 Poly1305 Decrypt - Ed25519X
Salsa20 Poly1305 Encrypt - Entry
Def - Entry
DefIndex - Entry
Defs - All definitions for all entry types in an integrity zome.
- Entry
Details - An Entry with all its metadata.
- Entry
Hashes - A newtype for a collection of EntryHashes, needed for some wasm return types.
- Entry
Rate Weight - Combination of the three main rate limiting data types, for convenience
- Ephemeral
Signatures - The output of ephemeral signing. The private key for this public key has been discarded by this point. The signatures match the public key provided but cannot be reproduced or forged because the private key no longer exists. The signatures match the input items positionally in the vector, it is up to the caller to reconstruct/align/zip them back together.
- ExternIO
- Function
Name - A single function name.
- Genesis
Self Check Data V1 - Data passed into the genesis_self_check callback for verifying the initial chain entries
- Genesis
Self Check Data V2 - Data passed into the genesis_self_check callback for verifying the initial
chain entries. DnaInfo can be read with a call to
dna_infowithin the self check callback, it is elided here to minimise/stabilise the callback function signature. - GetAgent
Activity Input - GetInput
- Zome input for get and get_details calls.
- GetLinks
Input - GetOptions
- Options for controlling how get is executed.
- GetValidation
Receipts Input - Input for the get_validation_receipts host function.
- Grant
Zome Call Capability Payload - Parameters for granting a zome call capability.
- Hash
Conversion Error - Error converting a composite hash into a primitive one, due to type mismatch
- HashSet
- A hash set implemented as a
HashMapwhere the value is(). - Highest
Observed - The highest action sequence for an agent’s chain that has been
observed, but not necessarily validated and integrated, by this
authority. This struct is seen in the
AgentActivityresponse from thehdk::chain::get_agent_activityquery. It also includes the hash(es) of the action(s) at this action sequence. - Holo
Hash - A HoloHash contains a vector of 36 bytes representing a 32-byte blake2b hash plus 4 bytes representing a DHT location. It also contains a zero-sized type which specifies what it is a hash of.
- Holo
Hash B64 - A wrapper around HoloHash that
Serializes into a base64 string rather than a raw byte array. - Holo
Hashed - Represents some piece of content along with its hash representation, so that hashes need not be calculated multiple times. Provides an easy constructor which consumes the content.
- Inclusive
Timestamp Interval - It’s an interval bounded by timestamps that are not infinite.
- Init
Zomes Complete - An action which declares that all zome init functions have successfully completed, and the chain is ready for commits. Contains no explicit data.
- Integrity
Zome Def - Judged
- Data with an optional validation status.
- Link
- Link
Details - CreateLinks with and DeleteLinks on them
[CreateLink, [DeleteLink]] - Link
Query - A query for links to be used with host functions that support filtering links
- LinkTag
- Opaque tag for the link applied at the app layer, used to differentiate between different semantics and validation rules for different links
- Link
Type - Metadata
Request - Metadata that can be requested on a basis
- Must
GetAction Input - Zome input for must_get_action.
- Must
GetAgent Activity Input - Input to the
must_get_agent_activitycall. - Must
GetEntry Input - Zome input for must_get_entry.
- Must
GetValid Record Input - Zome input for must_get_valid_record.
- Open
Chain - When migrating to a new version of a DNA, this action is committed to the new chain to declare the migration path taken.
- Open
Chain Input - Input to open a chain.
- Path
- A
Pathis a vector ofComponents. - Preflight
Bytes - Every preflight request can have optional arbitrary bytes that can be agreed to.
- Preflight
Request - The same PreflightRequest is sent to every agent. Each agent signs this data as part of their PreflightResponse. Every preflight must be identical and signed by every agent for a session to be valid.
- Preflight
Response - Every agent must send back a preflight response. All the preflight response data is signed by each agent and included in the session data.
- Query
Filter - Specifies arguments to a query of the source chain, including ordering and filtering.
This is used by both
hdk::chain::queryandhdk::chain::get_agent_activity, although the latter function ignores it ifActivityRequest::Statusis used. - Rate
Weight - Combination of two rate limiting data types, for convenience
- Record
- a chain record containing the signed action along with the entry if the action type has one.
- Record
Details - A specific Record with any updates and deletes. This is all the metadata available for a record.
- Register
Agent Activity - Registers a new
Actionon an agent source chain. This is the act of creating anyActionand publishing it to the DHT. - Register
Create Link - Registers a link between two
Entrys. This is the act of creating aAction::CreateLinkand publishing it to the DHT. The authority is the entry authority for the baseEntry. - Register
Delete - Registers a deletion of an instance of an
Entryin the DHT. This is the act of creating aAction::Deleteand publishing it to the DHT. - Register
Delete Link - Deletes a link between two
Entrys. This is the act of creating aAction::DeleteLinkand publishing it to the DHT. The delete always references a specificAction::CreateLink. - Register
Update - Registers an update from an instance of an
Entryin the DHT. This is the act of creating aAction::Updateand publishing it to the DHT. Note that theAction::Updatestores an new instance of anEntryand registers it as an update to the originalEntry. This operation is only concerned with registering the update. - Remote
Signal - Remote signal many agents without waiting for responses.
- Required
Validations - The number of validations required for an entry to be considered published.
- Role
- Agents can have a role specific to each countersigning session. The role is app defined and opaque to the subconscious.
- Scheduled
Fn - A fully qualified scheduled function.
- Scoped
Zome Type - A type with the zome that it is defined in.
- Scoped
Zome Types - zome types that are in scope for the calling zome.
- Scoped
Zome Types Set - The set of
EntryDefIndexandLinkTypes in scope for the calling zome. - Serialized
Bytes - A Canonical Serialized Bytes representation for data If you have a data structure that needs a canonical byte representation use this Always round-trip through SerializedBytes via. a single TryFrom implementation. This ensures that the internal bytes of SerializedBytes are indeed canonical. The corrolary is that if bytes are NOT wrapped in SerializedBytes we can assume they are NOT canonical. Typically we need a canonical serialization when data is to be handled at the byte level by independently implemented and maintained systems.
- Shard
Strategy - A valid strategy for sharding requires both a width and a depth. At the moment sharding only works well for data that is reliably longer than width/depth. For example, sharding the username foo with width 4 doesn’t make sense. There is no magic padding or extending of the provided data to make up undersized shards.
- Sign
- Input structure for creating a signature.
- Sign
Ephemeral - Ephemerally sign a vector of bytes (i.e. a
Vec<Vec<u8>>) Each of the items of the outer vector represents something to sign and will have a corresponding Signature in the output. The public key for the ephemeral operation will be returned in the output. Structurally mirrors/complements theSignaturestruct as a new type. There we know the key on the input side, here we receive the key on the output. - Signature
- The raw bytes of a signature.
- Signed
- Some data with a signature attached.
- Signed
Hashed - Any content that has been hashed and signed.
- Store
Entry - Stores a new
Entryin the DHT. This is the act of creating a either aAction::Createor aAction::Updateand publishing it to the DHT. These actions create a new instance of anEntry. - Store
Record - Stores a new
Recordin the DHT. This is the act of creating a newActionand publishing it to the DHT. Note that not allActions contain anEntry. - Timestamp
- A microsecond-precision UTC timestamp for use in Holochain’s actions.
- Trace
Msg - Representation of message to be logged via the
debughost function - Typed
Path - A
LinkTypeapplied to aPath. - Unsafe
Bytes - UnsafeBytes the only way to implement a custom round trip through bytes for SerializedBytes It is intended to be an internal implementation in TryFrom implementations The assumption is that any code using UnsafeBytes is NOT valid messagepack data This allows us to enforce that all data round-tripping through SerializedBytes is via TryFrom and also allow for custom non-messagepack canonical representations of data types.
- Update
- An action which specifies that some new Entry content is intended to be an update to some old Entry.
- Update
Base - Base data for Update actions.
- Update
Input - Zome input type for all update operations.
- Validation
Receipt Info - Summary information for a validation receipt.
- Validation
Receipt Set - A set of validation receipts, grouped by op.
- Verify
Signature - Mirror struct for Sign that includes a signature to verify against a key and data.
- Warrant
- A Warrant is an authored, timestamped proof of wrongdoing by another agent.
- Wasm
Error - Wraps a WasmErrorInner with a file and line number.
The easiest way to generate this is with the
wasm_error!macro that will insert the correct file/line and can create strings by forwarding args to theformat!macro. - Wasm
Zome - A zome defined by Wasm bytecode
- Wrong
Action Error - X25519
PubKey - X25519X
Salsa20 Poly1305 Decrypt - X25519X
Salsa20 Poly1305 Encrypt - XSalsa20
Poly1305 Data - Data that can be encrypted with secretbox.
- XSalsa20
Poly1305 Decrypt - XSalsa20
Poly1305 Encrypt - XSalsa20
Poly1305 Encrypted Data - XSalsa20
Poly1305 KeyRef - Key refs represent shared secrets stored in the keystore. They can either be user-specified, or auto-generated at time of secret creation, or ingestion.
- XSalsa20
Poly1305 Shared Secret Export - XSalsa20
Poly1305 Shared Secret Ingest - Zome
- A Holochain Zome. Includes the ZomeDef as well as the name of the Zome.
- Zome
Call CapGrant - The entry for the ZomeCall capability grant. This data is committed to the callee’s source chain as a private entry. The remote calling agent must provide a secret and we source their pubkey from the active network connection. This must match the strictness of the CapAccess.
- Zome
Call Params - Zome calls need to be signed regardless of how they are called. This defines exactly what needs to be signed.
- Zome
Dependency Index - The index into the
ZomeIndexvec. - Zome
Index - this id is an internal reference, which also serves as a canonical ordering for zome initialization. The value should be auto-generated from the Zome Bundle def
- Zome
Info - The properties of the current dna/zome being called.
- Zome
Name - ZomeName as a String.
- Zome
Types Key - A key to the
ScopedZomeTypescontainer.
Enums§
- Action
- Action contains variants for each type of action.
- Action
Base - Enum to mirror Action for all the shared data required to build session actions. Does NOT hold any agent specific information.
- Action
Error - Action
Type - A unit enum which just maps onto the different Action variants, without containing any extra data
- Activity
Request - When calling
hdk::chain::get_agent_activity, specify whether to get either a summary of the chain’s status, or a summary plus the hashes of the chain actions that match the givenChainQueryFilter. See the notes onAgentActivityabout the perspective-dependent nature of the agent’s status and valid/rejected activity. - AnyDht
Hash Primitive - The primitive hash types represented by this composite hash
- AnyLinkable
Hash Primitive - The primitive hash types represented by this composite hash
- Block
Target - Target of a block. Each target type has an ID and associated reason.
- Block
Target Id - Block
Target Reason - Call
Target - Call
Target Cell - CapAccess
- Represents access requirements for capability grants.
- CapGrant
- Represents a potentially valid access grant to a zome call. Zome call response will be Unauthorized without a valid grant.
- Cell
Block Reason - Reason why we might want to block a cell.
- Chain
Integrity Warrant - A warrant which is sent to agent activity authorities.
- Chain
OpType - This enum is used to encode just the enum variant of ChainOp
- Chain
Query Filter Range - Defines several ways that queries can be restricted to a range. Notably hash bounded ranges disambiguate forks whereas action sequences do not as the same position can be found in many forks. The reason that this does NOT use native rust range traits is that the hash bounded queries MUST be inclusive otherwise the integrity and fork disambiguation logic is impossible. An exclusive range bound that does not include the final action tells us nothing about which fork to select between N forks of equal length that proceed it. With an inclusive hash bounded range the final action always points unambiguously at the “correct” fork that the range is over. Start hashes are not needed to provide this property so ranges can be hash terminated with a length of preceding records to return only. Technically the seq bounded ranges do not imply any fork disambiguation and so could be a range but for simplicity we left the API symmetrical in boundedness across all enum variants.
- Chain
Status - Status of the agent activity chain, as part of the return value from
hdk::chain::get_agent_activity. - Chain
TopOrdering - Clone
Cell Id - Ways of specifying a clone cell in the context of an app.
- Clone
IdError - Errors during conversion from
RoleNametoCloneId. - Counter
Signing Error - Errors related to the secure primitive macro.
- Details
- Return type for get_details calls. ActionHash returns a Record. EntryHash returns an Entry.
- Entry
- Structure holding the entry portion of a chain record.
- Entry
Creation Action - Either a
Action::Createor aAction::Update. These actions both create a new instance of anEntry. - Entry
DefId - Entry
DefLocation - Either an
EntryDefIndexor one of: - Entry
Defs Callback Result - Entry
DhtStatus - The status of an Entry in the Dht
- Entry
Error - Errors involving app entry creation
- Entry
Type - Allows Actions which reference Entries to know what type of Entry it is referencing. Useful for examining Actions without needing to fetch the corresponding Entries.
- Entry
Visibility - GetStrategy
- Set if data should be fetched from the network or only from the local databases.
- Granted
Functions - A collection of zome/function pairs
- Hashable
Content Bytes - HashableContent can be expressed as “content”, or “prehashed”, which affects how a HoloHashed type will be constructed from it.
- Holo
Hash Error - HoloHash Error Type.
- Host
FnApi Error - Anything that can go wrong while calling a HostFnApi method
- Human
Timestamp - A human-readable timestamp which is represented/serialized as an RFC3339 when possible, and a microsecond integer count otherwise. Both representations can be deserialized to this type.
- Init
Callback Result - The result of the DNA initialization callback.
- IpBlock
Reason - Reason why we might want to block an IP.
- Level
- Maps directly to the tracing Levels but here to define the interface. See https://docs.rs/tracing-core/0.1.17/tracing_core/struct.Level.html
- Limit
Conditions - Specify when to stop walking down the chain from the
chain_topaction. - Link
Type Filter - Filter on a set of
LinkTypes. - Migration
Target - Description of how to find the previous or next CellId in a migration. In a migration, of the two components of the CellId (dna and agent), always one stays fixed while the other one changes. This enum represents the component that changed.
- Op
- These are the operations that can be applied to Holochain data.
Every
Actionproduces a set of operations. These operations are each sent to an authority for validation. - Preflight
Request Acceptance - A preflight request can be accepted, or invalid, or valid but the local agent cannot accept it.
- Record
Entry - Represents the different ways the entry_address reference within an action can be interpreted
- Schedule
- Defines either a persisted or ephemeral schedule for a schedule function. Persisted schedules survive a conductor reboot, ephemeral will not. Persisted schedules continue beyond irrecoverable errors, ephemeral do not.
- Schedule
Error - Scheduling errors.
- Serialized
Bytes Error - Timestamp
Error - Unit
Enum Either - A full UnitEnum, or just the unit type of that UnitEnum
- Unresolved
Dependencies - Unresolved dependencies that are either a set of hashes or an agent activity query.
- Validate
Callback Result - Validation
Status - The validation status for an op or record much of this happens in the subconscious an entry missing validation dependencies may cycle through Pending many times before finally reaching a final validation state or being abandoned
- Warrant
Proof - The self-proving part of a Warrant which demonstrates bad behavior by another agent
- Warrant
Type - The type of warrant.
- Wasm
Error Inner - Enum of all possible ERROR states that wasm can encounter.
- Zome
Call Authorization - Zome
Call Response - Response to a zome call.
- ZomeDef
- Just the definition of a Zome, without the name included. This exists mainly for use in HashMaps where ZomeDefs are keyed by ZomeName.
- Zome
Error - Anything that can go wrong while calling a HostFnApi method
Constants§
- CAP_
SECRET_ BITS - The number of bits we want for a comfy secret.
- CAP_
SECRET_ BYTES - The number of bytes we want for a comfy secret.
- CLONE_
ID_ DELIMITER - Delimiter in a clone id that separates the base cell’s role name from the clone index.
- ENTRY_
SIZE_ LIMIT - Entries larger than this number of bytes cannot be created
- HOLO_
HASH_ CORE_ LEN - Length of the core bytes (32)
- HOLO_
HASH_ FULL_ LEN - Length of the full HoloHash bytes (39 = 3 + 32 + 4)
- HOLO_
HASH_ LOC_ LEN - Length of the location bytes (4)
- HOLO_
HASH_ PREFIX_ LEN - Length of the prefix bytes (3)
- HOLO_
HASH_ UNTYPED_ LEN - Length of the core bytes + the loc bytes (36 = 32 + 4), i.e. everything except the type prefix
- MAX_
COUNTERSIGNING_ AGENTS - 8 seems like a reasonable limit of agents to countersign.
- MAX_
HASHABLE_ CONTENT_ LEN - The maximum size to hash synchronously. Anything larger than this will take too long to hash within a single tokio context
- MAX_
REMOTE_ AGENT_ COUNT - Maximum number of remote agents that can be queried in parallel. This limit prevents abuse and excessive network load.
- MIN_
COUNTERSIGNING_ AGENTS - Need at least two to countersign.
- PERSISTED_
TIMEOUT - Expire persisted schedules after this long.
- POST_
GENESIS_ SEQ_ THRESHOLD - Any action with a action_seq less than this value is part of a record created during genesis. Anything with this seq or higher was created after genesis.
- SCHEDULER_
INTERVAL - Tick the scheduler every this many millis.
- SESSION_
ACTION_ TIME_ OFFSET - The timestamps on actions for a session use this offset relative to the session start time. This makes it easier for agents to accept a preflight request with actions that are after their current chain top, after network latency.
- SESSION_
TIME_ FUTURE_ MAX - Maximum time in the future the session start can be in the opinion of the participating agent.
As the action will be
SESSION_ACTION_TIME_OFFSETafter the session start we include that here. - SIGNATURE_
BYTES - Ed25519 signatures are always the same length, 64 bytes.
- X25519_
PUB_ KEY_ BYTES
Traits§
- Action
Builder - Builder for non-genesis Actions
- Action
Ext - Action
Hashed Container - Action
Sequence AndHash - Action
Unweighed - A trait to unify the “inner” parts of an Action, i.e. the structs inside the Action enum’s variants. This trait is used for the “unweighed” version of each struct, i.e. the version with weight information erased.
- Action
Weighed - A trait to unify the “inner” parts of an Action, i.e. the structs inside the Action enum’s variants. This trait is used for the “weighed” version of each struct, i.e. the version without weight information erased.
- Callback
Result - Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Entry
DefRegistration - Trait for binding static
EntryDefproperty access for a type. This trait maps a type to its correspondingEntryDefproperty at compile time. - Entry
Types Helper - Helper trait for deserializing
Entrys to the correct type. - HasHash
- Anything which has an owned HoloHashOf.
- HasValidation
Status - Data that requires a validation status.
- Hash
Type - Every HoloHash is generic over HashType. Additionally, every HashableContent has an associated HashType. The HashType is the glue that binds together HashableContent with its hash.
- Hashable
Content - Any implementor of HashableContent may be used in a HoloHashed to pair data with its HoloHash representation. It also has an associated HashType.
- Hashable
Content ExtAsync - Adds convenience methods for constructing HoloHash and HoloHashed from some HashableContent
- Hashable
Content ExtSync - Adds convenience methods for constructing HoloHash and HoloHashed from some HashableContent
- Host
FnApiT - Link
Type Filter Ext - An extension to obtain a link type filter.
- Link
Types Helper - A helper trait for finding the app defined link type
from a
ZomeIndexandLinkType. - OpHelper
- This trait provides a conversion to a convenience type
FlatOpfor use in the validation call back. - Primitive
Hash Type - A PrimitiveHashType is one with a multihash prefix.
In contrast, a non-primitive hash type could be one of several primitive
types, e.g. an
AnyDhtHashcan represent one of three primitive types. - Serialize
- A data structure that can be serialized into any data format supported by Serde.
- TryFrom
- Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of
TryInto. - TryFrom
DnaProperties - Trait to convert from dna properties into specified type
- TryInto
- An attempted conversion that consumes
self, which may or may not be expensive. - U8Index
- Helper trait for types that are internally
represented as
u8but need to be used as indicies into containers. - Unit
Enum - A utility trait for associating a data enum with a unit enum that has the same variants.
Functions§
- __
hc__ ⚠agent_ info_ 1 - __
hc__ ⚠call_ 1 - __
hc__ ⚠call_ info_ 1 - __
hc__ ⚠call_ remote_ 1 - __
hc__ ⚠capability_ claims_ 1 - __
hc__ ⚠capability_ grants_ 1 - __
hc__ ⚠capability_ info_ 1 - __
hc__ ⚠close_ chain_ 1 - __
hc__ ⚠count_ links_ 1 - __
hc__ ⚠create_ 1 - __
hc__ ⚠create_ clone_ cell_ 1 - __
hc__ ⚠create_ link_ 1 - __
hc__ ⚠create_ x25519_ keypair_ 1 - __
hc__ ⚠delete_ 1 - __
hc__ ⚠delete_ clone_ cell_ 1 - __
hc__ ⚠delete_ link_ 1 - __
hc__ ⚠disable_ clone_ cell_ 1 - __
hc__ ⚠dna_ info_ 1 - __
hc__ ⚠ed_ 25519_ x_ salsa20_ poly1305_ decrypt_ 1 - __
hc__ ⚠ed_ 25519_ x_ salsa20_ poly1305_ encrypt_ 1 - __
hc__ ⚠emit_ signal_ 1 - __
hc__ ⚠enable_ clone_ cell_ 1 - __
hc__ ⚠get_ 1 - __
hc__ ⚠get_ agent_ activity_ 1 - __
hc__ ⚠get_ details_ 1 - __
hc__ ⚠get_ links_ 1 - __
hc__ ⚠get_ links_ details_ 1 - __
hc__ ⚠get_ validation_ receipts_ 1 - __
hc__ ⚠must_ get_ action_ 1 - __
hc__ ⚠must_ get_ entry_ 1 - __
hc__ ⚠must_ get_ valid_ record_ 1 - __
hc__ ⚠open_ chain_ 1 - __
hc__ ⚠query_ 1 - __
hc__ ⚠random_ bytes_ 1 - __
hc__ ⚠schedule_ 1 - __
hc__ ⚠send_ remote_ signal_ 1 - __
hc__ ⚠sign_ 1 - __
hc__ ⚠sign_ ephemeral_ 1 - __
hc__ ⚠sys_ time_ 1 - __
hc__ ⚠trace_ 1 - __
hc__ ⚠unreachable_ 1 - __
hc__ ⚠update_ 1 - __
hc__ ⚠verify_ signature_ 1 - __
hc__ ⚠x_ 25519_ x_ salsa20_ poly1305_ decrypt_ 1 - __
hc__ ⚠x_ 25519_ x_ salsa20_ poly1305_ encrypt_ 1 - __
hc__ ⚠x_ salsa20_ poly1305_ decrypt_ 1 - __
hc__ ⚠x_ salsa20_ poly1305_ encrypt_ 1 - __
hc__ ⚠x_ salsa20_ poly1305_ shared_ secret_ create_ random_ 1 - __
hc__ ⚠x_ salsa20_ poly1305_ shared_ secret_ export_ 1 - __
hc__ ⚠x_ salsa20_ poly1305_ shared_ secret_ ingest_ 1 - __
hc__ ⚠zome_ info_ 1 - blake2b_
256 - internal compute a 32 byte blake2b hash
- close_
chain - Close your current source chain to indicate that you are planning to migrate to a new DNA.
- decode
- dna_
info - Get the DNA information.
There are no inputs to
dna_info. - ed_
25519_ x_ salsa20_ poly1305_ decrypt - Libsodium crypto_box decryption, but converts ed25519 signing keys into x25519 encryption keys. WARNING: Please first understand the downsides of using this function: https://doc.libsodium.org/advanced/ed25519-curve25519
- encode
- entry_
type_ matches - Check the entry variant matches the variant in the actions entry type
- holo_
hash_ decode - internal PARSE for holo hash REPR
- holo_
hash_ decode_ unchecked - internal PARSE for holo hash REPR
- holo_
hash_ encode - internal REPR for holo hash
- host_
args - Receive arguments from the host.
The guest sets the type
Othat the host needs to match. If deserialization fails then aGuestPtrto aWasmError::Deserializeis returned. The guest should immediately return anErrback to the host. TheWasmError::Deserializeenum contains the bytes that failed to deserialize so the host can unambiguously provide debug information. - host_
call - Given an extern that we expect the host to provide:
- merge_
u32 - merge_
u64 - merge_
usize - Given 2x
u32, return aDoubleUSizemerged. Works via a simple bitwise shift to move the pointer to high bits then OR the length into the low bits. - must_
get_ action - MUST get a
SignedActionHashedat a givenActionHash. - must_
get_ agent_ activity - The chain this filter produces on the given agents chain must be fetched before the validation can be completed. This allows for deterministic validation of chain activity by making a hash bounded range of an agents chain into a dependency for something that is being validated.
- must_
get_ entry - MUST get an EntryHashed at a given EntryHash.
- must_
get_ valid_ record - MUST get a VALID
Recordat a givenActionHash. - open_
chain - Indicate the DNA that you have migrated from. This should be committed to the new DNA’s source chain.
- return_
err_ ptr - Convert a
WasmErrorto aGuestPtrLenas best we can. This is not necessarily straightforward as the serialization process can error recursively. In the worst case we can’t even serialize an enum variant, in which case we panic. The casts fromusizetou32are safe as long as the guest code is compiled forwasm32-unknown-unknowntarget. - return_
ptr - Convert any serializable value into a
GuestPtrthat can be returned to the host. The host is expected to know how to consume and deserialize it. - sha2_
512 - Compute a 512-bit SHA2 hash.
- split_
u64 - split_
u128 - split_
usize - Given 2x merged
usize, split out twousize. Performs the inverse ofmerge_usize. - verify_
signature - Verify the passed signature and public key against the passed serializable input.
- verify_
signature_ raw - Verify the passed signature and public key against the literal bytes input.
- x_
25519_ x_ salsa20_ poly1305_ decrypt - Libsodium keypair based authenticated encryption: box_open
- x_
salsa20_ poly1305_ decrypt - Libsodium secret-key authenticated encryption: secretbox_open
- zome_
info - Get the zome information.
There are no inputs to
zome_info.
Type Aliases§
- Action
Hash - The hash of an action
- Action
Hash AndSig - Action hash with the signature of the action at that hash.
- Action
Hash B64 - Base64-ready version of ActionHash
- Action
Hashed - Agent
PubKey - An Agent public signing key. Not really a hash, more of an “identity hash”.
- Agent
PubKey B64 - Base64-ready version of AgentPubKey
- AnyDht
Hash - The hash of anything referrable in the DHT. This is a composite of either an EntryHash or a ActionHash
- AnyDht
Hash B64 - Base64-ready version of AnyDhtHash
- AnyLinkable
Hash - The hash of anything linkable.
- AnyLinkable
Hash B64 - Base64-ready version of AnyLinkableHash
- BoxData
- Bytes
- simply alias whatever serde bytes is already doing for
Vec<u8> - CapClaim
Entry - The data type written to the source chain to denote a capability claim
- CapGrant
Entry - The data type written to the source chain when explicitly granting a capability.
NB: this is not simply
CapGrant, because theCapGrant::ChainAuthorgrant is already implied byEntry::Agent, so that should not be committed to a chain. This is a type alias because if we add other capability types in the future, we may want to include them - CapSecret
Bytes - A fixed size array of bytes that a secret must be.
- Coordinator
Zome - Coordinator
Zomes - Ordered list of coordinator zomes in this DNA.
- Counter
Signing Agents - Alias for a list of agents and their roles.
- Delete
Clone Cell Input - Arguments to delete a disabled clone cell of an app.
- DhtOp
Hash - The hash of a DhtOp’s “unique form” representation
- DhtOp
Hash B64 - Base64-ready version of DhtOpHash
- DnaHash
- The hash of a DnaDef
- DnaHash
B64 - Base64-ready version of DnaHash
- DnaInfo
- Convenience alias to the latest
DnaInfoN. - DoubleU
Size - Enable
Clone Cell Input - Arguments to specify the clone cell to be enabled.
- Entry
Hash - The hash of an Entry.
- Entry
Hash B64 - Base64-ready version of EntryHash
- Entry
Hashed - An Entry paired with its EntryHash
- Extern
Result - Every extern must return a
WasmErrorin the case of failure. - External
Hash - The hash of some external data that can’t or doesn’t exist on the DHT.
- External
Hash B64 - Base64-ready version of ExternalHash
- Genesis
Self Check Data - Alias to the current version of
GenesisSelfCheckData. - Granted
Function - a single zome/function pair
- Guest
Ptr - A
WasmSizethat points to a position in wasm linear memory that the host and guest are sharing to communicate across function calls. - Guest
PtrLen - Enough bits to fit a pointer and length into so we can return it. The externs defined as “C” don’t support multiple return values (unlike wasm). The native Rust support for wasm externs is not stable at the time of writing.
- Holo
Hash Of - A convenience type, for specifying a hash by HashableContent rather than by its HashType
- Holo
Hash Result - HoloHash Result type
- Integrity
Zome - Integrity
Zomes - Ordered list of integrity zomes in this DNA.
- Len
- A
WasmSizeinteger that represents the size of bytes to read/write to memory. - Membrane
Proof - App-specific payload for proving membership in the membrane of the app
- Network
Seed - Placeholder for a real network seed type. See
DnaModifiers. - OpBasis
- Alias for AnyLinkableHash. This hash forms the notion of the “basis hash” of an op.
- Rate
Bucket Capacity - The amount that a bucket is “filled”
- Rate
Bucket Id - A bucket ID, for rate limiting
- Rate
Bytes - The normalized total size of this action, for rate limiting
- Rate
Units - The weight of this action, for rate limiting
- Record
Entry Ref - Alias for record with ref entry
- Role
Name - Identifier for an App Role, a foundational concept in the App manifest.
- Scoped
Entry DefIndex - An
EntryDefIndexwithin the scope of the zome where it’s defined. - Scoped
Link Type - A
LinkTypewithin the scope of the zome where it’s defined. - Secret
BoxData - Signed
Action - A combination of an action and its signature.
- Signed
Action Hashed - The hashed action and the signature that signed it
- Signed
Warrant - A signed warrant with a timestamp
- Timestamp
Result - Warrant
Hash - The hash of a Warrant
- Wasm
Hash - The hash of some wasm bytecode
- Wasm
Hash B64 - Base64-ready version of WasmHash
- Wasm
Size - Something like
usizefor wasm. Wasm has a memory limit of 4GB so offsets and lengths fit inu32. - Zome
Call Signing Key - A public key of a pair of signing keys for signing zome calls.
- Zome
Entry Types Key - A key to the
ScopedZomeTypes<EntryDefIndex>container. - Zome
Link Types Key - A key to the
ScopedZomeTypes<LinkType>container. - Zome
Result
Attribute Macros§
- dna_
properties - Helper for decoding DNA Properties into a struct.
- hdk_
dependent_ entry_ types - hdk_
dependent_ link_ types - hdk_
entry_ helper - Helper for entry data types.
- hdk_
entry_ types - Declares the integrity zome’s entry types.
- hdk_
entry_ types_ conversions - hdk_
extern - hdk_
link_ types - Implements all the required types needed for a
LinkTypesenum. - hdk_
to_ coordinates - instrument
- Instruments a function to create and enter a
tracingspan every time the function is called.