@xyo-network/xl1-cli-lib 1.15.9 → 1.15.10

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.
@@ -1,5 +1,6 @@
1
1
  export * from './api/index.ts';
2
2
  export * from './bridge/index.ts';
3
3
  export * from './producer/index.ts';
4
+ export * from './rewardRedemption/index.ts';
4
5
  export * from './validator/index.ts';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './runRewardRedemptionApi.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/rewardRedemption/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { Logger } from '@xylabs/logger';
2
+ import type { Config } from '@xyo-network/xl1-protocol-sdk';
3
+ interface RunRewardRedemptionApiContext {
4
+ config: Config;
5
+ logger?: Logger;
6
+ }
7
+ export declare function runRewardRedemptionApi(context: RunRewardRedemptionApiContext): void;
8
+ export {};
9
+ //# sourceMappingURL=runRewardRedemptionApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runRewardRedemptionApi.d.ts","sourceRoot":"","sources":["../../../../src/commands/rewardRedemption/runRewardRedemptionApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAE3D,UAAU,6BAA6B;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,QAE5E"}
@@ -532,6 +532,7 @@ import { asAddress as asAddress2, ZERO_HASH } from "@xylabs/hex";
532
532
  import { isDefined as isDefined14 } from "@xylabs/typeof";
533
533
  import { initTelemetry, startupSpanAsync as startupSpanAsync8, StepSizes, validateHydratedBlockState } from "@xyo-network/chain-sdk";
534
534
  import { readPayloadMapFromStore } from "@xyo-network/xl1-protocol-sdk";
535
+ import { CompletedStepRewardAddressValidatorFactory, SelfSignerValidator, TransactionTransfersValidatorFactory } from "@xyo-network/xl1-validation";
535
536
  import { Semaphore } from "async-mutex";
536
537
 
537
538
  // src/orchestration/archivists/ChainFinalized/archivist.ts
@@ -1185,7 +1186,7 @@ var getFirstBlockForNewChain = /* @__PURE__ */ __name(async (forkBlock, account,
1185
1186
  ],
1186
1187
  txs: [],
1187
1188
  protocol,
1188
- stepRewardAddress: XYO_STEP_REWARD_ADDRESS,
1189
+ chainStepRewardAddress: XYO_STEP_REWARD_ADDRESS,
1189
1190
  stepRewardPoolBalance: AttoXL1(0n)
1190
1191
  };
1191
1192
  return await buildBlock(options);
@@ -1507,6 +1508,7 @@ var initServices = /* @__PURE__ */ __name(async (context) => {
1507
1508
  startupSpanAsync8("initTelemetry", () => initTelemetry(telemetryConfig)),
1508
1509
  startupSpanAsync8("initAccount", () => initAccount(context))
1509
1510
  ]);
1511
+ const allowedRewardRedeemers = config3.validation?.allowedRewardRedeemers ?? [];
1510
1512
  const initParams = {
1511
1513
  config: config3,
1512
1514
  logger,
@@ -1540,6 +1542,12 @@ var initServices = /* @__PURE__ */ __name(async (context) => {
1540
1542
  chainSubmissionsArchivistWrite,
1541
1543
  chainService
1542
1544
  }));
1545
+ const additionalPendingTransactionValidators = [
1546
+ TransactionTransfersValidatorFactory([
1547
+ SelfSignerValidator,
1548
+ CompletedStepRewardAddressValidatorFactory(allowedRewardRedeemers)
1549
+ ])
1550
+ ];
1543
1551
  const [pendingTransactionsService, rewardService, chainIterator, balanceService] = await Promise.all([
1544
1552
  startupSpanAsync8("PendingTransactions", () => initPendingTransactions({
1545
1553
  name: "PendingTransactionsService",
@@ -1547,6 +1555,7 @@ var initServices = /* @__PURE__ */ __name(async (context) => {
1547
1555
  chainId,
1548
1556
  pendingBundledTransactionsArchivist,
1549
1557
  rejectedTransactionsArchivist,
1558
+ additionalPendingTransactionValidators,
1550
1559
  ...initParams
1551
1560
  })),
1552
1561
  startupSpanAsync8("RewardService", () => initBlockRewardService({
@@ -1658,7 +1667,8 @@ var initServices = /* @__PURE__ */ __name(async (context) => {
1658
1667
  balanceSummaryMap,
1659
1668
  ...Object.values(result)
1660
1669
  ].filter(isStartable);
1661
- await Promise.all(startableServices.map((service) => service.start()));
1670
+ assertEx18((await Promise.all(startableServices.map((service) => service.start()))).every(Boolean), () => "One or more services failed to start");
1671
+ logger?.log("All services started successfully.");
1662
1672
  return result;
1663
1673
  }, "initServices");
1664
1674
 
@@ -1708,6 +1718,13 @@ var runProducer = /* @__PURE__ */ __name(async (context) => {
1708
1718
  await orchestrator.start();
1709
1719
  }, "runProducer");
1710
1720
 
1721
+ // src/commands/rewardRedemption/runRewardRedemptionApi.ts
1722
+ import { getServer as getServer3 } from "@xyo-network/chain-reward-redemption";
1723
+ function runRewardRedemptionApi(context) {
1724
+ void getServer3(context);
1725
+ }
1726
+ __name(runRewardRedemptionApi, "runRewardRedemptionApi");
1727
+
1711
1728
  // src/images.ts
1712
1729
  var XL1LogoColorizedAscii = `\x1B[38;2;128;128;128m\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\x1B[0m\x1B[38;2;118;111;144m_\x1B[0m
1713
1730
  \x1B[38;2;128;128;128m\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\x1B[0m\x1B[38;2;72;32;223m\u2560\x1B[0m\x1B[38;2;66;21;234m\u2560\x1B[0m
@@ -1805,7 +1822,7 @@ var waitForHostPort = /* @__PURE__ */ __name((host, port) => {
1805
1822
 
1806
1823
  // src/runCLI.ts
1807
1824
  var config;
1808
- var version = isDefined17("1.15.8") ? "1.15.8" : "unknown";
1825
+ var version = isDefined17("1.15.9") ? "1.15.9" : "unknown";
1809
1826
  var getContextFromConfig = /* @__PURE__ */ __name((config3) => {
1810
1827
  const logger = initLogger(config3);
1811
1828
  const orchestrator = new Orchestrator(logger);
@@ -1878,6 +1895,15 @@ $0 <command> [options]`).parserConfiguration({
1878
1895
  config
1879
1896
  });
1880
1897
  });
1898
+ }).command("reward-redemption-api", "Run a XL1 Rewards Redemption API Node", (yargs2) => {
1899
+ return yargs2.command("$0", "Run a XL1 Rewards Redemption API Node", () => {
1900
+ }, () => {
1901
+ const context = getContextFromConfig(config);
1902
+ runRewardRedemptionApi({
1903
+ ...context,
1904
+ config
1905
+ });
1906
+ });
1881
1907
  }).command("$0", "Run a full XL1 Node", () => {
1882
1908
  }, async () => {
1883
1909
  const context = getContextFromConfig(config);