referrerpolicy=no-referrer-when-downgrade

Module sc_service::client

source ·
Expand description

Substrate Client and associated logic.

The Client is one of the most important components of Substrate. It mainly comprises two parts:

  • A database containing the blocks and chain state, generally referred to as the Backend.
  • A runtime environment, generally referred to as the Executor.

§Initialization

Creating a Client is done by calling the new method and passing to it a Backend and an Executor.

The former is typically provided by the sc-client-db crate.

The latter typically requires passing one of:

  • A LocalCallExecutor running the runtime locally.
  • A RemoteCallExecutor that will ask a third-party to perform the executions.
  • A RemoteOrLocalCallExecutor combination of the two.

Additionally, the fourth generic parameter of the Client is a marker type representing the ways in which the runtime can interface with the outside. Any code that builds a Client is responsible for putting the right marker.

Structs§

Functions§

  • Create an instance of in-memory client.
  • Create a client with the explicitly provided backend. This is useful for testing backend implementations.