-
Hello! I was wondering if there's a way to be notified when the node ends the sync process? The I managed to do it myself by modifying the node launcher to work something like this: event = engine_service.next() => {
let Some(event) = event else { break };
debug!("Event: {event}");
match event {
ChainEvent::BackfillSyncFinished => {
if terminate_after_backfill {
debug!("Terminating after initial backfill");
break
}
network_handle.update_sync_state(SyncState::Idle);
// This is what I've added
sync_state_tx.send(SyncState::Idle).expect("Channel must be open");
}
ChainEvent::BackfillSyncStarted => {
network_handle.update_sync_state(SyncState::Syncing);
// And this
sync_state_tx.send(SyncState::Syncing).expect("Channel must be open");
} There's a dedicated type that receives this events and provides subscription service to be notified when sync is finished. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
we could add a helper future type for this that basically behaves like like this: reth/crates/rpc/rpc/src/eth/pubsub.rs Lines 178 to 198 in 8758d82 |
Beta Was this translation helpful? Give feedback.
-
opened #16911 |
Beta Was this translation helpful? Give feedback.
we could add a helper future type for this that basically behaves like
eth_syncing
?like this:
reth/crates/rpc/rpc/src/eth/pubsub.rs
Lines 178 to 198 in 8758d82