Expand description
Tetcore runtime api
The Tetcore runtime api is the crucial interface between the node and the runtime.
Every call that goes into the runtime is done with a runtime api. The runtime apis are not fixed.
Every Tetcore user can define its own apis with
decl_runtime_apis
and implement them in
the runtime with impl_runtime_apis
.
Every Tetcore runtime needs to implement the Core
runtime api. This api provides the basic
functionality that every runtime needs to export.
Besides the macros and the Core
runtime api, this crates provides the Metadata
runtime
api, the ApiExt
trait, the CallApiAt
trait and the ConstructRuntimeApi
trait.
On a meta level this implies, the client calls the generated API from the client perspective.
Macros§
- decl_
runtime_ apis - Declares given traits as runtime apis.
- impl_
runtime_ apis - Tags given trait implementations as runtime apis.
- mock_
impl_ runtime_ apis - Mocks given trait implementations as runtime apis.
Structs§
- ApiError
- An error describing which API call failed.
- ApiRef
- Auxiliary wrapper that holds an api instance and binds it to the given lifetime.
- Call
ApiAt Params - Parameters for
CallApiAt::call_api_at
. - OldRuntime
Version
Enums§
- Initialize
Block - Before calling any runtime api function, the runtime need to be initialized
at the requested block. However, some functions like
execute_block
orinitialize_block
itself don’t require to have the runtime initialized at the requested block.
Constants§
- MAX_
EXTRINSIC_ DEPTH - Maximum nesting level for extrinsics.
Traits§
- ApiError
Ext - Extends the runtime api traits with an associated error type. This trait is given as super trait to every runtime api trait.
- ApiExt
- Extends the runtime api implementation with some common functionality.
- Call
ApiAt - Something that can call into the an api at a given block.
- Construct
Runtime Api - Something that can be constructed to a runtime api.
- Core
- The
Core
runtime api that every Tetcore runtime needs to implement. - Metadata
- The
Metadata
api trait that returns metadata for the runtime. - Provide
Runtime Api - Something that provides a runtime api.
- Runtime
ApiInfo - Something that provides information about a runtime api.
Type Aliases§
- ApiError
For - Extracts the
Api::Error
for a type that provides a runtime api. - Proof
Recorder - A type that records all accessed trie nodes and generates a proof out of it.
- State
Backend For - Extract the state backend type for a type that implements
ProvideRuntimeApi
. - Storage
Changes - Storage
Transaction Cache - A type that is used as cache for the storage transactions.
- Transaction
For - Extract the state backend transaction type for a type that implements
ProvideRuntimeApi
.