public void importBlocks(final BesuController controller, final Path path)
      throws IOException, ExecutionException, InterruptedException, TimeoutException {
    final ProtocolSchedule protocolSchedule = controller.getProtocolSchedule();
    final BlockHeaderFunctions blockHeaderFunctions =
        ScheduleBasedBlockHeaderFunctions.create(protocolSchedule);
    final ProtocolContext context = controller.getProtocolContext();

    Era1Reader reader = new Era1Reader(new SnappyFactory());

    final List<Future<BlockHeader>> headersFutures = new ArrayList<>(ERA1_BLOCK_COUNT_MAX);
    final List<Future<BlockBody>> bodiesFutures = new ArrayList<>(ERA1_BLOCK_COUNT_MAX);
    final List<Future<List<TransactionReceipt>>> receiptsFutures =
        new ArrayList<>(ERA1_BLOCK_COUNT_MAX);
    reader.read(
        new FileInputStream(path.toFile()),
        new Era1ReaderListener() {

          @Override
          public void handleExecutionBlockHeader(
              final Era1ExecutionBlockHeader executionBlockHeader) {
            headersFutures.add(
                CompletableFuture.supplyAsync(
                    () ->
                        BlockHeader.readFrom(
                            new BytesValueRLPInput(
                                Bytes.wrap(executionBlockHeader.header()), false),
                            blockHeaderFunctions)));
          }

          @Override
          public void handleExecutionBlockBody(final Era1ExecutionBlockBody executionBlockBody) {
            bodiesFutures.add(
                CompletableFuture.supplyAsync(
                    () ->
                        BlockBody.readWrappedBodyFrom(
                            new BytesValueRLPInput(Bytes.wrap(executionBlockBody.block()), false),
                            blockHeaderFunctions,
                            true)));
          }

          @Override
          public void handleExecutionBlockReceipts(
              final Era1ExecutionBlockReceipts executionBlockReceipts) {
            receiptsFutures.add(
                CompletableFuture.supplyAsync(
                    () -> {
                      RLPInput input =
                          new BytesValueRLPInput(
                              Bytes.wrap(executionBlockReceipts.receipts()), false);
                      final List<TransactionReceipt> receiptsForBlock = new ArrayList<>();
                      input.readList(
                          (in) ->
                              receiptsForBlock.add(TransactionReceiptDecoder.readFrom(in, false)));
                      return receiptsForBlock;
                    }));
          }

          @Override
          public void handleBlockIndex(final Era1BlockIndex blockIndex) {
            // not really necessary, do nothing
          }
        });

    LOG.info("Read {} blocks, now importing", headersFutures.size());

    Block block = null;
    for (int i = 0; i < headersFutures.size(); i++) {
      BlockHeader blockHeader = headersFutures.get(i).get(10, TimeUnit.SECONDS);
      BlockImporter blockImporter =
          protocolSchedule.getByBlockHeader(blockHeader).getBlockImporter();
      block = new Block(blockHeader, bodiesFutures.get(i).get(10, TimeUnit.SECONDS));

      BlockImportResult importResult =
          blockImporter.importBlockForSyncing(
              context,
              block,
              receiptsFutures.get(i).get(10, TimeUnit.SECONDS),
              HeaderValidationMode.NONE,
              HeaderValidationMode.NONE,
              BodyValidationMode.NONE,
              false);
      if (importResult.getStatus() != BlockImportResult.BlockImportStatus.IMPORTED) {
        LOG.warn(
            "Failed to import block {} due to {}",
            blockHeader.getNumber(),
            importResult.getStatus());
      } else if (i % IMPORT_COUNT_FOR_LOG_UPDATE == 0) {
        LOG.info("{}/{} blocks imported", i, headersFutures.size());
      }
    }
    LOG.info("Done importing {} blocks", headersFutures.size());
  }
Imports the blocks, headers, and transaction receipts from the file found at the supplied path

@param controller The BesuController
@param path The path
@throws IOException IOException
@throws ExecutionException ExecutionException
@throws InterruptedException InterruptedException
@throws TimeoutException TimeoutException
app/src/main/java/org/hyperledger/besu/chainimport/Era1BlockImporter.java