Crate zksync_node_framework

Crate zksync_node_framework 

Source
Expand description

§ZK Stack node initialization framework.

This crate provides core abstractions that allow one to compose a ZK Stack node. Main concepts used in this crate are:

  • WiringLayer - builder interface for tasks.
  • Task - a unit of work that can be executed by the node.
  • Resource - a piece of logic that can be shared between tasks. Most resources are represented by generic interfaces and also serve as points of customization for tasks.
  • ZkStackService - a container for tasks and resources that takes care of initialization, running and shutting down.
  • ZkStackServiceBuilder - a builder for the service.

Re-exports§

pub use self::resource::Resource;
pub use self::service::FromContext;
pub use self::service::IntoContext;
pub use self::service::StopReceiver;
pub use self::task::Task;
pub use self::task::TaskId;
pub use self::wiring_layer::WiringError;
pub use self::wiring_layer::WiringLayer;

Modules§

resource
service
task
Tasks define the “runnable” concept of the service, e.g. a unit of work that can be executed by the service.
wiring_layer

Derive Macros§

FromContext
Derive macro for the FromContext trait. Derive macro for the FromContext trait. Allows to automatically fetch all the resources and tasks from the context.
IntoContext
Derive macro for the IntoContext trait. Derive macro for the IntoContext trait. Allows to automatically insert all the resources in tasks created by the wiring layer into the context.