public void importChain(final String chainJson) throws IOException {
    warnIfDatabaseIsNotEmpty();

    final ChainData chainData = mapper.readValue(chainJson, ChainData.class);

    final List<Block> importedBlocks = new ArrayList<>();
    for (final BlockData blockData : chainData.getBlocks()) {
      final BlockHeader parentHeader = getParentHeader(blockData, importedBlocks);
      final Block importedBlock = processBlockData(blockData, parentHeader);
      importedBlocks.add(importedBlock);
    }

    this.warnIfImportedBlocksAreNotOnCanonicalChain(importedBlocks);
  }
Import chain.

@param chainJson the chain json
@throws IOException the io exception
app/src/main/java/org/hyperledger/besu/chainimport/JsonBlockImporter.java