Function snarkos_node_cdn::load_blocks
source · pub async fn load_blocks<N: Network>(
base_url: &str,
start_height: u32,
end_height: Option<u32>,
process: impl FnMut(Block<N>) -> Result<()> + Clone + Send + Sync + 'static
) -> Result<u32, (u32, Error)>Expand description
Loads blocks from a CDN and process them with the given function.
On success, this function returns the completed block height. On failure, this function returns the last successful block height (if any), along with the error.