zksync_node_framework/lib.rs
1//! # ZK Stack node initialization framework.
2//!
3//! This crate provides core abstractions that allow one to compose a ZK Stack node.
4//! Main concepts used in this crate are:
5//! - [`WiringLayer`](wiring_layer::WiringLayer) - builder interface for tasks.
6//! - [`Task`](task::Task) - a unit of work that can be executed by the node.
7//! - [`Resource`](resource::Resource) - a piece of logic that can be shared between tasks. Most resources are
8//! represented by generic interfaces and also serve as points of customization for tasks.
9//! - [`ZkStackService`](service::ZkStackService) - a container for tasks and resources that takes care of initialization, running
10//! and shutting down.
11//! - [`ZkStackServiceBuilder`](service::ZkStackServiceBuilder) - a builder for the service.
12
13mod metrics;
14pub mod resource;
15pub mod service;
16pub mod task;
17pub mod wiring_layer;
18
19mod sealed {
20 /// Sealed trait marker. Intentionally not re-exported publicly.
21 pub trait Sealed {}
22}
23
24/// Derive macro for the `FromContext` trait.
25pub use zksync_node_framework_derive::FromContext;
26/// Derive macro for the `IntoContext` trait.
27pub use zksync_node_framework_derive::IntoContext;
28
29pub use self::{
30 resource::Resource,
31 service::{FromContext, IntoContext, StopReceiver},
32 task::{Task, TaskId},
33 wiring_layer::{WiringError, WiringLayer},
34};