Cargo Features

[dependencies]
sp-api = { version = "34.0.0", default-features = false, features = ["std", "disable-logging", "no-metadata-docs", "frame-metadata"] }
default = std

The std feature is set by default whenever sp-api is added without default-features = false somewhere in the dependency tree.

std default = hash-db, sp-externalities, thiserror

Enables std of parity-scale-codec, log, scale-info, sp-api-proc-macro, sp-core, optional sp-externalities, optional sp-metadata-ir, sp-runtime, sp-runtime-interface, sp-state-machine, sp-trie, and sp-version

Affects sp-api::ProofRecorder, sp-api::StorageChanges, sp-api::ConstructRuntimeApi, sp-api::ApiError, sp-api::ApiExt, sp-api::CallApiAtParams, sp-api::CallApiAt, sp-api::ApiRef, sp-api::ProvideRuntimeApi, sp-api::RuntimeApiInfo

disable-logging

Special feature to disable logging completely.

By default sp-api initializes the RuntimeLogger for each runtime api function. However, logging functionality increases the code size. It is recommended to enable this feature when building a runtime for registering it on chain.

This sets the max logging level to off for log.

Enables max_level_off of log

no-metadata-docs

Do not report the documentation in the metadata.

Enables no-metadata-docs of sp-api-proc-macro

frame-metadata = sp-metadata-ir

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

sp-externalities std
sp-state-machine std
sp-trie std
hash-db std
thiserror std

Enables thiserror ^1.0.48

sp-metadata-ir frame-metadata?