Skip to content

Commit

Permalink
fix(node_framework): Fix main node example (#1470)
Browse files Browse the repository at this point in the history
## What ❔

Adds missing layer that prevented main node example from running

## Why ❔

Main node example works now.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
popzxc committed Mar 21, 2024
1 parent 4bdf3ca commit ac4a744
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/node/node_framework/examples/main_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use zksync_node_framework::{
l1_gas::SequencerL1GasLayer,
metadata_calculator::MetadataCalculatorLayer,
object_store::ObjectStoreLayer,
pk_signing_eth_client::PKSigningEthClientLayer,
pools_layer::PoolsLayerBuilder,
proof_data_handler::ProofDataHandlerLayer,
query_eth_client::QueryEthClientLayer,
Expand Down Expand Up @@ -71,6 +72,15 @@ impl MainNodeBuilder {
Ok(self)
}

fn add_pk_signing_client_layer(mut self) -> anyhow::Result<Self> {
self.node.add_layer(PKSigningEthClientLayer::new(
ETHSenderConfig::from_env()?,
ContractsConfig::from_env()?,
ETHClientConfig::from_env()?,
));
Ok(self)
}

fn add_query_eth_client_layer(mut self) -> anyhow::Result<Self> {
let eth_client_config = ETHClientConfig::from_env()?;
let query_eth_client_layer = QueryEthClientLayer::new(eth_client_config.web3_url);
Expand Down Expand Up @@ -306,6 +316,7 @@ fn main() -> anyhow::Result<()> {
.add_metadata_calculator_layer()?
.add_state_keeper_layer()?
.add_eth_watch_layer()?
.add_pk_signing_client_layer()?
.add_eth_sender_layer()?
.add_proof_data_handler_layer()?
.add_healthcheck_layer()?
Expand Down

0 comments on commit ac4a744

Please sign in to comment.