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

    ReferenceTestWorldState initialWorldState;
    ReferenceTestEnv referenceTestEnv;
    List<Transaction> transactions = new ArrayList<>();
    List<RejectedTransaction> rejections = new ArrayList<>();
    try {
      ObjectNode config;
      if (env.equals(stdinPath) || alloc.equals(stdinPath) || txs.equals(stdinPath)) {
        try (InputStreamReader reader =
            new InputStreamReader(parentCommand.in, StandardCharsets.UTF_8)) {
          config = (ObjectNode) t8nReader.readTree(reader);
        }
      } else {
        config = objectMapper.createObjectNode();
      }

      if (!env.equals(stdinPath)) {
        try (FileReader reader = new FileReader(env.toFile(), StandardCharsets.UTF_8)) {
          config.set("env", t8nReader.readTree(reader));
        }
      }
      if (!alloc.equals(stdinPath)) {
        try (FileReader reader = new FileReader(alloc.toFile(), StandardCharsets.UTF_8)) {
          config.set("alloc", t8nReader.readTree(reader));
        }
      }
      if (!txs.equals(stdinPath)) {
        try (FileReader reader = new FileReader(txs.toFile(), StandardCharsets.UTF_8)) {
          config.set("txs", t8nReader.readTree(reader));
        }
      }

      referenceTestEnv = objectMapper.convertValue(config.get("env"), ReferenceTestEnv.class);
      Map<String, ReferenceTestWorldState.AccountMock> accounts =
          objectMapper.convertValue(config.get("alloc"), new TypeReference<>() {});
      initialWorldState = ReferenceTestWorldState.create(accounts, EvmConfiguration.DEFAULT);
      initialWorldState.persist(null);
      var node = config.get("txs");
      Iterator<JsonNode> it;
      if (node.isArray()) {
        it = config.get("txs").elements();
      } else if (node == null || node.isNull()) {
        it = Collections.emptyIterator();
      } else {
        it = List.of(node).iterator();
      }

      T8nExecutor.extractTransactions(parentCommand.out, it, transactions, rejections);
      if (!outDir.toString().isBlank()) {
        outDir.toFile().mkdirs();
      }
    } 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;
    }

    T8nExecutor.TracerManager tracerManager;
    if (parentCommand.showJsonResults) {
      tracerManager =
          new T8nExecutor.TracerManager() {
            private final Map<OperationTracer, FileOutputStream> outputStreams = new HashMap<>();

            @Override
            public OperationTracer getManagedTracer(final int txIndex, final Hash txHash)
                throws Exception {
              var traceDest =
                  new FileOutputStream(
                      outDir
                          .resolve(
                              String.format("trace-%d-%s.jsonl", txIndex, txHash.toHexString()))
                          .toFile());

              var jsonTracer =
                  new StandardJsonTracer(
                      new PrintStream(traceDest),
                      parentCommand.showMemory,
                      !parentCommand.hideStack,
                      parentCommand.showReturnData,
                      parentCommand.showStorage,
                      parentCommand.eip3155strict);
              outputStreams.put(jsonTracer, traceDest);
              return jsonTracer;
            }

            @Override
            public void disposeTracer(final OperationTracer tracer) throws IOException {
              if (outputStreams.containsKey(tracer)) {
                outputStreams.remove(tracer).close();
              }
            }
          };
    } else {
      tracerManager =
          new T8nExecutor.TracerManager() {
            @Override
            public OperationTracer getManagedTracer(final int txIndex, final Hash txHash) {
              return OperationTracer.NO_TRACING;
            }

            @Override
            public void disposeTracer(final OperationTracer tracer) {
              // single-test mode doesn't need to track tracers
            }
          };
    }
    final T8nExecutor.T8nResult result =
        T8nExecutor.runTest(
            chainId,
            fork,
            rewardString,
            objectMapper,
            referenceTestEnv,
            initialWorldState,
            transactions,
            rejections,
            tracerManager);

    try {
      ObjectWriter writer = objectMapper.writerWithDefaultPrettyPrinter();
      ObjectNode outputObject = objectMapper.createObjectNode();

      if (outAlloc.equals(stdoutPath)) {
        outputObject.set("alloc", result.allocObject());
      } else {
        try (PrintStream fileOut =
            new PrintStream(new FileOutputStream(outDir.resolve(outAlloc).toFile()))) {
          fileOut.println(writer.writeValueAsString(result.allocObject()));
        }
      }

      if (outBody.equals((stdoutPath))) {
        outputObject.set("body", result.bodyBytes());
      } else {
        try (PrintStream fileOut =
            new PrintStream(new FileOutputStream(outDir.resolve(outBody).toFile()))) {
          fileOut.print(result.bodyBytes().textValue());
        }
      }

      if (outResult.equals(stdoutPath)) {
        outputObject.set("result", result.resultObject());
      } else {
        try (PrintStream fileOut =
            new PrintStream(new FileOutputStream(outDir.resolve(outResult).toFile()))) {
          fileOut.println(writer.writeValueAsString(result.resultObject()));
        }
      }

      if (!outputObject.isEmpty()) {
        parentCommand.out.println(writer.writeValueAsString(outputObject));
      }
    } catch (IOException ioe) {
      System.err.println("Could not write results");
      ioe.printStackTrace(System.err);
    }
  }
Constructor for the T8nSubCommand class with a parent command. This constructor is required by
PicoCLI.

@param parentCommand The parent command for this sub command.
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java