@Override
  public void run() {
    LogConfigurator.setLevel("", "OFF");
    // presume ethereum mainnet for reference and state tests
    SignatureAlgorithmFactory.setDefaultInstance();
    ObjectMapper objectMapper = JsonUtils.createObjectMapper();
    final ObjectReader b11rReader = objectMapper.reader();

    ObjectNode config;
    try {
      if (header.equals(stdinPath)
          || txs.equals(stdinPath)
          || ommers.equals(stdinPath)
          || sealClique.equals(stdinPath)
          || withdrawals.equals(stdinPath)) {
        config =
            (ObjectNode)
                b11rReader.readTree(
                    new InputStreamReader(parentCommand.in, StandardCharsets.UTF_8));
      } else {
        config = objectMapper.createObjectNode();
      }

      if (!header.equals(stdinPath)) {
        try (FileReader reader = new FileReader(header.toFile(), StandardCharsets.UTF_8)) {
          config.set("header", b11rReader.readTree(reader));
        }
      }
      if (!txs.equals(stdinPath)) {
        try (FileReader reader = new FileReader(txs.toFile(), StandardCharsets.UTF_8)) {
          config.set("txs", b11rReader.readTree(reader));
        }
      }
      if (!withdrawals.equals(stdinPath)) {
        try (FileReader reader = new FileReader(withdrawals.toFile(), StandardCharsets.UTF_8)) {
          config.set("withdrawals", b11rReader.readTree(reader));
        }
      }
      if (!ommers.equals(stdinPath)) {
        try (FileReader reader = new FileReader(ommers.toFile(), StandardCharsets.UTF_8)) {
          config.set("ommers", b11rReader.readTree(reader));
        }
      }
      if (!sealClique.equals(stdinPath)) {
        try (FileReader reader = new FileReader(sealClique.toFile(), StandardCharsets.UTF_8)) {
          config.set("clique", b11rReader.readTree(reader));
        }
      }
    } catch (final JsonProcessingException jpe) {
      parentCommand.out.println("File content error: " + jpe);
      jpe.printStackTrace();
      return;
    } catch (final IOException e) {
      System.err.println("Unable to read state file");
      e.printStackTrace(System.err);
      return;
    }

    var testHeader = this.readHeader(config.get("header"), objectMapper);
    Bytes txsBytes = null;

    if (config.has("txs")) {
      String txsString = config.get("txs").textValue();
      if (!txsString.isEmpty()) {
        txsBytes = Bytes.fromHexString(txsString);
      }
    }

    var newHeader =
        BlockHeaderBuilder.fromHeader(testHeader)
            .blockHeaderFunctions(new MainnetBlockHeaderFunctions())
            .buildBlockHeader();
    BytesValueRLPOutput rlpOut = new BytesValueRLPOutput();
    rlpOut.startList();
    newHeader.writeTo(rlpOut);
    if (txsBytes != null && !txsBytes.isEmpty()) {
      rlpOut.writeRaw(txsBytes);
    } else {
      rlpOut.startList();
      rlpOut.endList();
    }
    // ommers
    rlpOut.startList();
    rlpOut.endList();

    // withdrawals
    // TODO - waiting on b11r spec to specify how withdrawals are added to blocks.

    rlpOut.endList();

    final ObjectNode resultObject = objectMapper.createObjectNode();
    resultObject.put("rlp", rlpOut.encoded().toHexString());
    resultObject.put("hash", newHeader.getHash().toHexString());
    var writer = objectMapper.writerWithDefaultPrettyPrinter();
    try {
      var resultString = writer.writeValueAsString(resultObject);
      if (outBlock.equals((stdoutPath))) {
        parentCommand.out.println(resultString);
      } else {
        try (var fileOut =
            new PrintStream(new FileOutputStream(outDir.resolve(outBlock).toFile()))) {
          fileOut.println(resultString);
        }
      }
    } catch (FileNotFoundException | JsonProcessingException e) {
      throw new RuntimeException(e);
    }
  }
Constructs a new B11rSubCommand with the given parent command.

@param parentCommand the parent command of this subcommand
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java