private void writeGenesisFile(
      final File directory, final String fileName, final ObjectNode genesis) throws IOException {
    LOG.info("Writing genesis file.");
    Files.write(
        directory.toPath().resolve(fileName),
        JsonUtil.getJson(genesis).getBytes(UTF_8),
        StandardOpenOption.CREATE_NEW);
  }
Write the content of the genesis to the output file.

@param directory The directory to write the file to.
@param fileName The name of the output file.
@param genesis The genesis content.
@throws IOException If the genesis file cannot be written or accessed.
app/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateBlockchainConfig.java