@sentio/runtime 2.62.0-rc.5 → 2.62.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  providerMetrics,
31
31
  recordRuntimeInfo,
32
32
  timeoutError
33
- } from "./chunk-RPV67F56.js";
33
+ } from "./chunk-YBKSM3GO.js";
34
34
  import {
35
35
  Plugin,
36
36
  PluginManager
@@ -28,7 +28,7 @@ import {
28
28
  require_lib4,
29
29
  require_src,
30
30
  withAbort
31
- } from "./chunk-RPV67F56.js";
31
+ } from "./chunk-YBKSM3GO.js";
32
32
  import {
33
33
  ExecutionConfig,
34
34
  HandlerType,
@@ -24435,6 +24435,12 @@ var Contexts2 = class {
24435
24435
  import("node:process").then((p) => p.stdout.write(""));
24436
24436
 
24437
24437
  // src/processor-runner.ts
24438
+ import { readFileSync } from "fs";
24439
+ import { fileURLToPath } from "url";
24440
+ import { dirname, join } from "path";
24441
+ var __filename = fileURLToPath(import.meta.url);
24442
+ var __dirname = dirname(__filename);
24443
+ var packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf8"));
24438
24444
  var workerNum = 1;
24439
24445
  try {
24440
24446
  workerNum = parseInt(process.env["PROCESSOR_WORKER"]?.trim() ?? "1");
@@ -24449,7 +24455,7 @@ function myParseInt(value, dummyPrevious) {
24449
24455
  return parsedValue;
24450
24456
  }
24451
24457
  var program2 = new Command();
24452
- program2.name("processor-runner").description("Sentio Processor Runtime").version("2.0.0-development").option("--target <path>", "Path to the processor module to load").option("-p, --port <port>", "Port to listen on", "4000").option("--concurrency <number>", "Number of concurrent workers", myParseInt, 4).option("--batch-count <number>", "Batch count for processing", myParseInt, 1).option("-c, --chains-config <path>", "Path to chains configuration file", "chains-config.json").option("--chainquery-server <url>", "Chain query server URL", "").option("--pricefeed-server <url>", "Price feed server URL", "").option("--log-format <format>", "Log format (console|json)", "console").option("--debug", "Enable debug mode", false).option("--otlp-debug", "Enable OTLP debug mode", false).option("--start-action-server", "Start action server instead of processor server", false).option("--worker <number>", "Number of worker threads", myParseInt, workerNum).option("--process-timeout <seconds>", "Process timeout in seconds", myParseInt, 60).option(
24458
+ program2.allowUnknownOption().allowExcessArguments().name("processor-runner").description("Sentio Processor Runtime").version(packageJson.version).option("--target <path>", "Path to the processor module to load").option("-p, --port <port>", "Port to listen on", "4000").option("--concurrency <number>", "Number of concurrent workers", myParseInt, 4).option("--batch-count <number>", "Batch count for processing", myParseInt, 1).option("-c, --chains-config <path>", "Path to chains configuration file", "chains-config.json").option("--chainquery-server <url>", "Chain query server URL", "").option("--pricefeed-server <url>", "Price feed server URL", "").option("--log-format <format>", "Log format (console|json)", "console").option("--debug", "Enable debug mode", false).option("--otlp-debug", "Enable OTLP debug mode", false).option("--start-action-server", "Start action server instead of processor server", false).option("--worker <number>", "Number of worker threads", myParseInt, workerNum).option("--process-timeout <seconds>", "Process timeout in seconds", myParseInt, 60).option(
24453
24459
  "--worker-timeout <seconds>",
24454
24460
  "Worker timeout in seconds",
24455
24461
  myParseInt,
@@ -24469,9 +24475,9 @@ program2.name("processor-runner").description("Sentio Processor Runtime").versio
24469
24475
  program2.parse();
24470
24476
  async function startServer(options) {
24471
24477
  const logLevel = process.env["LOG_LEVEL"]?.toLowerCase();
24472
- setupLogger(options["log-format"] === "json", logLevel === "debug" ? true : options.debug);
24478
+ setupLogger(options.logFormat === "json", logLevel === "debug" ? true : options.debug);
24473
24479
  console.debug("Starting with", options.target);
24474
- await setupOTLP(options["otlp-debug"]);
24480
+ await setupOTLP(options.otlpDebug);
24475
24481
  Error.stackTraceLimit = 20;
24476
24482
  configureEndpoints(options);
24477
24483
  console.debug("Starting Server", options);
@@ -24482,7 +24488,7 @@ async function startServer(options) {
24482
24488
  console.debug("Module loaded", m);
24483
24489
  return m;
24484
24490
  };
24485
- if (options["start-action-server"]) {
24491
+ if (options.startActionServer) {
24486
24492
  server = new ActionServer(loader);
24487
24493
  server.listen(options.port);
24488
24494
  } else {