@xyo-network/chain-orchestration 1.20.29 → 1.21.2
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/dist/browser/index.mjs +120 -120
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/node/config/capabilities/Backing.d.ts +13 -0
- package/dist/browser/node/config/capabilities/Backing.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/Capability.d.ts +6 -32
- package/dist/browser/node/config/capabilities/Capability.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/ProcessSharedResources.d.ts +18 -11
- package/dist/browser/node/config/capabilities/ProcessSharedResources.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/Provider.d.ts +8 -46
- package/dist/browser/node/config/capabilities/Provider.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/backings/buildChainStoreBacking.d.ts +36 -0
- package/dist/browser/node/config/capabilities/backings/buildChainStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildDlqStoreBacking.d.ts +13 -0
- package/dist/browser/node/config/capabilities/backings/buildDlqStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts +57 -0
- package/dist/browser/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts +12 -0
- package/dist/browser/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildValidators.d.ts +14 -0
- package/dist/browser/node/config/capabilities/backings/buildValidators.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/index.d.ts +6 -0
- package/dist/browser/node/config/capabilities/backings/index.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/defaultCapabilityRegistry.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/descriptors.d.ts +4 -0
- package/dist/browser/node/config/capabilities/descriptors.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/index.d.ts +2 -0
- package/dist/browser/node/config/capabilities/index.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/locatorFromActorNeeds.d.ts +22 -3
- package/dist/browser/node/config/capabilities/locatorFromActorNeeds.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/networkTier3Descriptors.d.ts +14 -0
- package/dist/browser/node/config/capabilities/networkTier3Descriptors.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/resolveProviders.d.ts +5 -26
- package/dist/browser/node/config/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/apiLocatorFromConfig.d.ts +1 -1
- package/dist/browser/node/config/locators/actors/apiLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/rewardRedemptionLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/buildStatelessApiLocator.d.ts +20 -0
- package/dist/browser/node/config/locators/buildStatelessApiLocator.d.ts.map +1 -0
- package/dist/browser/node/config/locators/contextFromConfigWithoutLocator.d.ts +1 -1
- package/dist/browser/node/config/locators/contextFromConfigWithoutLocator.d.ts.map +1 -1
- package/dist/browser/node/config/locators/index.d.ts +1 -0
- package/dist/browser/node/config/locators/index.d.ts.map +1 -1
- package/dist/browser/node/config/locators/locatorsFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/telemetryContextFromConfig.d.ts +1 -1
- package/dist/browser/node/config/locators/telemetryContextFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/tryParseConfig.d.ts +3 -2
- package/dist/browser/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/browser/node/manifest/getLocator.d.ts +4 -2
- package/dist/browser/node/manifest/getLocator.d.ts.map +1 -1
- package/dist/browser/shared/actor/index.d.ts +0 -1
- package/dist/browser/shared/actor/index.d.ts.map +1 -1
- package/dist/browser/shared/actor/v3/ActorV3.d.ts +17 -0
- package/dist/browser/shared/actor/v3/ActorV3.d.ts.map +1 -1
- package/dist/browser/shared/command/index.d.ts +2 -0
- package/dist/browser/shared/command/index.d.ts.map +1 -0
- package/dist/browser/shared/command/types.d.ts +8 -0
- package/dist/browser/shared/command/types.d.ts.map +1 -0
- package/dist/browser/shared/config/actors/Api.d.ts +18 -6
- package/dist/browser/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Bridge.d.ts +18 -6
- package/dist/browser/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Finalizer.d.ts +6 -6
- package/dist/browser/shared/config/actors/Mempool.d.ts +6 -6
- package/dist/browser/shared/config/actors/Producer.d.ts +6 -6
- package/dist/browser/shared/config/actors/RewardRedemption.d.ts +6 -6
- package/dist/browser/shared/config/mergeConfig.d.ts +2 -1
- package/dist/browser/shared/config/mergeConfig.d.ts.map +1 -1
- package/dist/browser/shared/index.d.ts +1 -0
- package/dist/browser/shared/index.d.ts.map +1 -1
- package/dist/browser/shared/init/index.d.ts +0 -1
- package/dist/browser/shared/init/index.d.ts.map +1 -1
- package/dist/browser/shared/init/initWallet.d.ts +8 -1
- package/dist/browser/shared/init/initWallet.d.ts.map +1 -1
- package/dist/browser/shared/orchestrator/Orchestrator.d.ts +1 -2
- package/dist/browser/shared/orchestrator/Orchestrator.d.ts.map +1 -1
- package/dist/neutral/index.mjs +120 -120
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/node/config/capabilities/Backing.d.ts +13 -0
- package/dist/neutral/node/config/capabilities/Backing.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/Capability.d.ts +6 -32
- package/dist/neutral/node/config/capabilities/Capability.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/ProcessSharedResources.d.ts +18 -11
- package/dist/neutral/node/config/capabilities/ProcessSharedResources.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/Provider.d.ts +8 -46
- package/dist/neutral/node/config/capabilities/Provider.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/backings/buildChainStoreBacking.d.ts +36 -0
- package/dist/neutral/node/config/capabilities/backings/buildChainStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildDlqStoreBacking.d.ts +13 -0
- package/dist/neutral/node/config/capabilities/backings/buildDlqStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts +57 -0
- package/dist/neutral/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts +12 -0
- package/dist/neutral/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildValidators.d.ts +14 -0
- package/dist/neutral/node/config/capabilities/backings/buildValidators.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/index.d.ts +6 -0
- package/dist/neutral/node/config/capabilities/backings/index.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/defaultCapabilityRegistry.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/descriptors.d.ts +4 -0
- package/dist/neutral/node/config/capabilities/descriptors.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/index.d.ts +2 -0
- package/dist/neutral/node/config/capabilities/index.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/locatorFromActorNeeds.d.ts +22 -3
- package/dist/neutral/node/config/capabilities/locatorFromActorNeeds.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/networkTier3Descriptors.d.ts +14 -0
- package/dist/neutral/node/config/capabilities/networkTier3Descriptors.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/resolveProviders.d.ts +5 -26
- package/dist/neutral/node/config/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/apiLocatorFromConfig.d.ts +1 -1
- package/dist/neutral/node/config/locators/actors/apiLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/rewardRedemptionLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/buildStatelessApiLocator.d.ts +20 -0
- package/dist/neutral/node/config/locators/buildStatelessApiLocator.d.ts.map +1 -0
- package/dist/neutral/node/config/locators/contextFromConfigWithoutLocator.d.ts +1 -1
- package/dist/neutral/node/config/locators/contextFromConfigWithoutLocator.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/index.d.ts +1 -0
- package/dist/neutral/node/config/locators/index.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/locatorsFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/telemetryContextFromConfig.d.ts +1 -1
- package/dist/neutral/node/config/locators/telemetryContextFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/tryParseConfig.d.ts +3 -2
- package/dist/neutral/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/neutral/node/manifest/getLocator.d.ts +4 -2
- package/dist/neutral/node/manifest/getLocator.d.ts.map +1 -1
- package/dist/neutral/shared/actor/index.d.ts +0 -1
- package/dist/neutral/shared/actor/index.d.ts.map +1 -1
- package/dist/neutral/shared/actor/v3/ActorV3.d.ts +17 -0
- package/dist/neutral/shared/actor/v3/ActorV3.d.ts.map +1 -1
- package/dist/neutral/shared/command/index.d.ts +2 -0
- package/dist/neutral/shared/command/index.d.ts.map +1 -0
- package/dist/neutral/shared/command/types.d.ts +8 -0
- package/dist/neutral/shared/command/types.d.ts.map +1 -0
- package/dist/neutral/shared/config/actors/Api.d.ts +18 -6
- package/dist/neutral/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Bridge.d.ts +18 -6
- package/dist/neutral/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Finalizer.d.ts +6 -6
- package/dist/neutral/shared/config/actors/Mempool.d.ts +6 -6
- package/dist/neutral/shared/config/actors/Producer.d.ts +6 -6
- package/dist/neutral/shared/config/actors/RewardRedemption.d.ts +6 -6
- package/dist/neutral/shared/config/mergeConfig.d.ts +2 -1
- package/dist/neutral/shared/config/mergeConfig.d.ts.map +1 -1
- package/dist/neutral/shared/index.d.ts +1 -0
- package/dist/neutral/shared/index.d.ts.map +1 -1
- package/dist/neutral/shared/init/index.d.ts +0 -1
- package/dist/neutral/shared/init/index.d.ts.map +1 -1
- package/dist/neutral/shared/init/initWallet.d.ts +8 -1
- package/dist/neutral/shared/init/initWallet.d.ts.map +1 -1
- package/dist/neutral/shared/orchestrator/Orchestrator.d.ts +1 -2
- package/dist/neutral/shared/orchestrator/Orchestrator.d.ts.map +1 -1
- package/dist/node/index.mjs +456 -405
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node/config/capabilities/Backing.d.ts +13 -0
- package/dist/node/node/config/capabilities/Backing.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/Capability.d.ts +6 -32
- package/dist/node/node/config/capabilities/Capability.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/ProcessSharedResources.d.ts +18 -11
- package/dist/node/node/config/capabilities/ProcessSharedResources.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/Provider.d.ts +8 -46
- package/dist/node/node/config/capabilities/Provider.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/backings/buildChainStoreBacking.d.ts +36 -0
- package/dist/node/node/config/capabilities/backings/buildChainStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildDlqStoreBacking.d.ts +13 -0
- package/dist/node/node/config/capabilities/backings/buildDlqStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts +57 -0
- package/dist/node/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts +12 -0
- package/dist/node/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildValidators.d.ts +14 -0
- package/dist/node/node/config/capabilities/backings/buildValidators.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/index.d.ts +6 -0
- package/dist/node/node/config/capabilities/backings/index.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/defaultCapabilityRegistry.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/descriptors.d.ts +4 -0
- package/dist/node/node/config/capabilities/descriptors.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/index.d.ts +2 -0
- package/dist/node/node/config/capabilities/index.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/locatorFromActorNeeds.d.ts +22 -3
- package/dist/node/node/config/capabilities/locatorFromActorNeeds.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/networkTier3Descriptors.d.ts +14 -0
- package/dist/node/node/config/capabilities/networkTier3Descriptors.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/resolveProviders.d.ts +5 -26
- package/dist/node/node/config/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/apiLocatorFromConfig.d.ts +1 -1
- package/dist/node/node/config/locators/actors/apiLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/rewardRedemptionLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/buildStatelessApiLocator.d.ts +20 -0
- package/dist/node/node/config/locators/buildStatelessApiLocator.d.ts.map +1 -0
- package/dist/node/node/config/locators/contextFromConfigWithoutLocator.d.ts +1 -1
- package/dist/node/node/config/locators/contextFromConfigWithoutLocator.d.ts.map +1 -1
- package/dist/node/node/config/locators/index.d.ts +1 -0
- package/dist/node/node/config/locators/index.d.ts.map +1 -1
- package/dist/node/node/config/locators/locatorsFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/telemetryContextFromConfig.d.ts +1 -1
- package/dist/node/node/config/locators/telemetryContextFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/tryParseConfig.d.ts +3 -2
- package/dist/node/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/node/node/manifest/getLocator.d.ts +4 -2
- package/dist/node/node/manifest/getLocator.d.ts.map +1 -1
- package/dist/node/shared/actor/index.d.ts +0 -1
- package/dist/node/shared/actor/index.d.ts.map +1 -1
- package/dist/node/shared/actor/v3/ActorV3.d.ts +17 -0
- package/dist/node/shared/actor/v3/ActorV3.d.ts.map +1 -1
- package/dist/node/shared/command/index.d.ts +2 -0
- package/dist/node/shared/command/index.d.ts.map +1 -0
- package/dist/node/shared/command/types.d.ts +8 -0
- package/dist/node/shared/command/types.d.ts.map +1 -0
- package/dist/node/shared/config/actors/Api.d.ts +18 -6
- package/dist/node/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Bridge.d.ts +18 -6
- package/dist/node/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Finalizer.d.ts +6 -6
- package/dist/node/shared/config/actors/Mempool.d.ts +6 -6
- package/dist/node/shared/config/actors/Producer.d.ts +6 -6
- package/dist/node/shared/config/actors/RewardRedemption.d.ts +6 -6
- package/dist/node/shared/config/mergeConfig.d.ts +2 -1
- package/dist/node/shared/config/mergeConfig.d.ts.map +1 -1
- package/dist/node/shared/index.d.ts +1 -0
- package/dist/node/shared/index.d.ts.map +1 -1
- package/dist/node/shared/init/index.d.ts +0 -1
- package/dist/node/shared/init/index.d.ts.map +1 -1
- package/dist/node/shared/init/initWallet.d.ts +8 -1
- package/dist/node/shared/init/initWallet.d.ts.map +1 -1
- package/dist/node/shared/orchestrator/Orchestrator.d.ts +1 -2
- package/dist/node/shared/orchestrator/Orchestrator.d.ts.map +1 -1
- package/package.json +136 -131
- package/dist/browser/shared/actor/FinalizerActor.d.ts +0 -30
- package/dist/browser/shared/actor/FinalizerActor.d.ts.map +0 -1
- package/dist/browser/shared/init/initActorAccount.d.ts +0 -4
- package/dist/browser/shared/init/initActorAccount.d.ts.map +0 -1
- package/dist/neutral/shared/actor/FinalizerActor.d.ts +0 -30
- package/dist/neutral/shared/actor/FinalizerActor.d.ts.map +0 -1
- package/dist/neutral/shared/init/initActorAccount.d.ts +0 -4
- package/dist/neutral/shared/init/initActorAccount.d.ts.map +0 -1
- package/dist/node/shared/actor/FinalizerActor.d.ts +0 -30
- package/dist/node/shared/actor/FinalizerActor.d.ts.map +0 -1
- package/dist/node/shared/init/initActorAccount.d.ts +0 -4
- package/dist/node/shared/init/initActorAccount.d.ts.map +0 -1
package/dist/node/index.mjs
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/shared/actor/FinalizerActor.ts
|
|
5
|
-
import { creatable } from "@xylabs/sdk-js";
|
|
6
|
-
import { processPendingBlocks } from "@xyo-network/chain-sdk";
|
|
7
|
-
import { BlockValidationViewerMoniker, BlockViewerMoniker, DeadLetterQueueRunnerMoniker, FinalizationRunnerMoniker, MempoolViewerMoniker } from "@xyo-network/xl1-sdk";
|
|
8
|
-
|
|
9
4
|
// src/shared/actor/v3/ActorV3.ts
|
|
10
5
|
import { AbstractCreatable, assertEx, delay, IdLogger } from "@xylabs/sdk-js";
|
|
11
6
|
import { Semaphore } from "async-mutex";
|
|
12
7
|
import z from "zod";
|
|
8
|
+
var noopCounter = {
|
|
9
|
+
add: /* @__PURE__ */ __name(() => {
|
|
10
|
+
}, "add")
|
|
11
|
+
};
|
|
12
|
+
var noopUpDownCounter = {
|
|
13
|
+
add: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "add")
|
|
15
|
+
};
|
|
16
|
+
var noopGauge = {
|
|
17
|
+
record: /* @__PURE__ */ __name(() => {
|
|
18
|
+
}, "record")
|
|
19
|
+
};
|
|
20
|
+
var noopHistogram = {
|
|
21
|
+
record: /* @__PURE__ */ __name(() => {
|
|
22
|
+
}, "record")
|
|
23
|
+
};
|
|
13
24
|
var CreatableNameZod = z.custom((val) => typeof val === "string" && val.length > 0);
|
|
14
25
|
var StatusReporterInstanceZod = z.custom((val) => val !== null && typeof val === "object" && "report" in val);
|
|
15
26
|
var AccountInstanceZod = z.custom((val) => val !== null && typeof val === "object" && "address" in val);
|
|
@@ -185,12 +196,44 @@ var ActorV3 = class extends AbstractCreatable {
|
|
|
185
196
|
}
|
|
186
197
|
}
|
|
187
198
|
/**
|
|
199
|
+
* Create a `Counter` instrument bound to this actor's meter, or a no-op
|
|
200
|
+
* stub if telemetry is not wired. Always returns a non-undefined value so
|
|
201
|
+
* call sites can drop the optional-chain on `.add()`.
|
|
202
|
+
*
|
|
203
|
+
* TODO: in a future pass, consider folding these single-instrument helpers
|
|
204
|
+
* into a declarative `createActorMeters({ counters: {...}, gauges: {...} })`
|
|
205
|
+
* spec API for actors with many instruments.
|
|
206
|
+
*/
|
|
207
|
+
counter(name, description) {
|
|
208
|
+
return this.meter?.createCounter(name, {
|
|
209
|
+
description
|
|
210
|
+
}) ?? noopCounter;
|
|
211
|
+
}
|
|
212
|
+
/** Create a synchronous `Gauge` instrument, or a no-op stub if telemetry is not wired. */
|
|
213
|
+
gauge(name, description) {
|
|
214
|
+
return this.meter?.createGauge(name, {
|
|
215
|
+
description
|
|
216
|
+
}) ?? noopGauge;
|
|
217
|
+
}
|
|
218
|
+
/** Create a `Histogram` instrument, or a no-op stub if telemetry is not wired. */
|
|
219
|
+
histogram(name, description) {
|
|
220
|
+
return this.meter?.createHistogram(name, {
|
|
221
|
+
description
|
|
222
|
+
}) ?? noopHistogram;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
188
225
|
* Override in subclasses to prove the actor can do useful work.
|
|
189
226
|
* Default: no-op (the actor declares itself ready as soon as `start()` returns).
|
|
190
227
|
*/
|
|
191
228
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
192
229
|
async readyHandler() {
|
|
193
230
|
}
|
|
231
|
+
/** Create an `UpDownCounter` instrument, or a no-op stub if telemetry is not wired. */
|
|
232
|
+
upDownCounter(name, description) {
|
|
233
|
+
return this.meter?.createUpDownCounter(name, {
|
|
234
|
+
description
|
|
235
|
+
}) ?? noopUpDownCounter;
|
|
236
|
+
}
|
|
194
237
|
};
|
|
195
238
|
var Actor = class extends ActorV3 {
|
|
196
239
|
static {
|
|
@@ -198,94 +241,6 @@ var Actor = class extends ActorV3 {
|
|
|
198
241
|
}
|
|
199
242
|
};
|
|
200
243
|
|
|
201
|
-
// src/shared/actor/FinalizerActor.ts
|
|
202
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
203
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
204
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
205
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
206
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
207
|
-
}
|
|
208
|
-
__name(_ts_decorate, "_ts_decorate");
|
|
209
|
-
var FinalizerActor = class extends ActorV3 {
|
|
210
|
-
static {
|
|
211
|
-
__name(this, "FinalizerActor");
|
|
212
|
-
}
|
|
213
|
-
static needs = {
|
|
214
|
-
required: [
|
|
215
|
-
BlockValidationViewerMoniker,
|
|
216
|
-
BlockViewerMoniker,
|
|
217
|
-
FinalizationRunnerMoniker,
|
|
218
|
-
MempoolViewerMoniker
|
|
219
|
-
],
|
|
220
|
-
optional: [
|
|
221
|
-
DeadLetterQueueRunnerMoniker
|
|
222
|
-
]
|
|
223
|
-
};
|
|
224
|
-
_blockValidationViewer;
|
|
225
|
-
_blockViewer;
|
|
226
|
-
_deadLetterQueueRunner;
|
|
227
|
-
_finalizationRunner;
|
|
228
|
-
_mempoolViewer;
|
|
229
|
-
get allowedProducers() {
|
|
230
|
-
return this.params.config.allowedProducers ?? [];
|
|
231
|
-
}
|
|
232
|
-
get blockValidationViewer() {
|
|
233
|
-
return this._blockValidationViewer;
|
|
234
|
-
}
|
|
235
|
-
get blockViewer() {
|
|
236
|
-
return this._blockViewer;
|
|
237
|
-
}
|
|
238
|
-
get finalizationRunner() {
|
|
239
|
-
return this._finalizationRunner;
|
|
240
|
-
}
|
|
241
|
-
get mempoolViewer() {
|
|
242
|
-
return this._mempoolViewer;
|
|
243
|
-
}
|
|
244
|
-
get minCandidates() {
|
|
245
|
-
return this.params.config.minCandidates;
|
|
246
|
-
}
|
|
247
|
-
async createHandler() {
|
|
248
|
-
await super.startHandler();
|
|
249
|
-
this._blockValidationViewer = await this.locator.getInstance(BlockValidationViewerMoniker);
|
|
250
|
-
this._blockViewer = await this.locator.getInstance(BlockViewerMoniker);
|
|
251
|
-
this._finalizationRunner = await this.locator.getInstance(FinalizationRunnerMoniker);
|
|
252
|
-
this._mempoolViewer = await this.locator.getInstance(MempoolViewerMoniker);
|
|
253
|
-
this._deadLetterQueueRunner = await this.locator.tryGetInstance(DeadLetterQueueRunnerMoniker);
|
|
254
|
-
}
|
|
255
|
-
async startHandler() {
|
|
256
|
-
await super.startHandler();
|
|
257
|
-
const interval = this.params.config.finalizationCheckInterval ?? 500;
|
|
258
|
-
this.registerTimer("FinalizerActor", async () => {
|
|
259
|
-
await this.runFinalizationPass();
|
|
260
|
-
}, 2e3, interval);
|
|
261
|
-
}
|
|
262
|
-
async readyHandler() {
|
|
263
|
-
await this.runFinalizationPass();
|
|
264
|
-
}
|
|
265
|
-
async runFinalizationPass() {
|
|
266
|
-
await this.spanAsync("processPendingBlocks", async () => {
|
|
267
|
-
this.logger?.debug("FinalizerActor: Processing pending blocks...");
|
|
268
|
-
await processPendingBlocks({
|
|
269
|
-
blockValidationViewer: this.blockValidationViewer,
|
|
270
|
-
context: this.context,
|
|
271
|
-
logger: this.logger,
|
|
272
|
-
mempoolViewer: this.mempoolViewer,
|
|
273
|
-
blockViewer: this.blockViewer,
|
|
274
|
-
finalizationRunner: this.finalizationRunner,
|
|
275
|
-
allowedProducers: this.allowedProducers,
|
|
276
|
-
minCandidates: this.minCandidates,
|
|
277
|
-
deadLetterQueueRunner: this._deadLetterQueueRunner
|
|
278
|
-
});
|
|
279
|
-
}, {
|
|
280
|
-
...this.context,
|
|
281
|
-
timeBudgetLimit: 1500
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
FinalizerActor = _ts_decorate([
|
|
286
|
-
creatable()
|
|
287
|
-
], FinalizerActor);
|
|
288
|
-
|
|
289
244
|
// src/shared/buildTelemetryConfig.ts
|
|
290
245
|
function buildTelemetryConfig(config, serviceName, serviceVersion, defaultMetricsScrapePort = 9464) {
|
|
291
246
|
const { otlpEndpoint } = config.telemetry?.otel ?? {};
|
|
@@ -318,6 +273,46 @@ var ApiConfigZod = HostActorConfigZod.extend(z2.object({
|
|
|
318
273
|
description: "Whether to initialize the rewards cache on startup",
|
|
319
274
|
title: "api.initRewardsCache",
|
|
320
275
|
type: "boolean"
|
|
276
|
+
}),
|
|
277
|
+
/**
|
|
278
|
+
* When `true`, the API actor runs in stateless mode: it holds no local
|
|
279
|
+
* backing-store ownership, never loads the local LMDB/MongoDB node, and
|
|
280
|
+
* federates every JSON-RPC request to upstream owner-actors via `JsonRpc*`
|
|
281
|
+
* providers. Multiple stateless API instances can run behind a load
|
|
282
|
+
* balancer for horizontal scaling. Requires `remote.rpc` to point at the
|
|
283
|
+
* upstream API/Finalizer/Mempool/Indexer surfaces.
|
|
284
|
+
*/
|
|
285
|
+
stateless: z2.union([
|
|
286
|
+
z2.number(),
|
|
287
|
+
z2.string(),
|
|
288
|
+
z2.boolean()
|
|
289
|
+
]).transform((v) => v === "1" || v === "true" || v === true || v == 1).default(false).register(globalRegistry, {
|
|
290
|
+
description: "Run the API actor as a stateless federation node (availableBackings: [network])",
|
|
291
|
+
title: "api.stateless",
|
|
292
|
+
type: "boolean"
|
|
293
|
+
}),
|
|
294
|
+
/**
|
|
295
|
+
* Back-compat for the surface-aware route split. When `true`, `POST /rpc`
|
|
296
|
+
* serves the full `XyoConnection` (both node-surface and indexed-surface
|
|
297
|
+
* methods), preserving pre-Phase-7 behavior for clients that haven't yet
|
|
298
|
+
* migrated to `POST /rpc/indexed`. When `false`, `/rpc` is strictly
|
|
299
|
+
* node-surface only and indexed methods are 404 at `/rpc`.
|
|
300
|
+
*
|
|
301
|
+
* `/rpc/indexed` mounts independently of this flag whenever the locator's
|
|
302
|
+
* connection has any indexed branch.
|
|
303
|
+
*
|
|
304
|
+
* Default `true` for the first release that includes Phase 7 — flip to
|
|
305
|
+
* `false` per environment once external clients (explorers, wallets, dApps)
|
|
306
|
+
* have moved their indexed-method calls to `/rpc/indexed`.
|
|
307
|
+
*/
|
|
308
|
+
legacyMixedRpc: z2.union([
|
|
309
|
+
z2.number(),
|
|
310
|
+
z2.string(),
|
|
311
|
+
z2.boolean()
|
|
312
|
+
]).transform((v) => v !== "0" && v !== "false" && v !== false && v != 0).default(true).register(globalRegistry, {
|
|
313
|
+
description: "Serve the full XyoConnection at POST /rpc (no surface filter). Set false to enforce node-surface-only at /rpc; indexed methods always available at /rpc/indexed regardless.",
|
|
314
|
+
title: "api.legacyMixedRpc",
|
|
315
|
+
type: "boolean"
|
|
321
316
|
})
|
|
322
317
|
}).shape);
|
|
323
318
|
var isApiConfig = zodIsFactory(ApiConfigZod);
|
|
@@ -342,6 +337,7 @@ var DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY = toHex("0xac0974bec39a17e36
|
|
|
342
337
|
var DEFAULT_HARDHAT_TOKEN_CONTRACT = toAddress("5FbDB2315678afecb367f032d93F642f64180aa3");
|
|
343
338
|
var DEFAULT_MAX_BRIDGE_AMOUNT = toHex(XL1(1000000n) * AttoXL1ConvertFactor.xl1);
|
|
344
339
|
var DEFAULT_MIN_BRIDGE_AMOUNT = toHex(XL1(1500n) * AttoXL1ConvertFactor.xl1);
|
|
340
|
+
var DEFAULT_SCANNER_INTERVAL_MS = 3e4;
|
|
345
341
|
var BasisPointsZod = z3.coerce.number().int().nonnegative().max(1e4);
|
|
346
342
|
var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
347
343
|
escrowAddress: AddressZod.optional().register(globalRegistry2, {
|
|
@@ -390,6 +386,12 @@ var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
|
390
386
|
title: "bridge.redisPort",
|
|
391
387
|
type: "number"
|
|
392
388
|
}),
|
|
389
|
+
scannerIntervalMs: z3.coerce.number().int().positive().default(DEFAULT_SCANNER_INTERVAL_MS).register(globalRegistry2, {
|
|
390
|
+
default: DEFAULT_SCANNER_INTERVAL_MS,
|
|
391
|
+
description: "How often (ms) the EVM->XL1 scanner polls the remote bridge contract for new BridgedToRemote ids confirmed at depth.",
|
|
392
|
+
title: "bridge.scannerIntervalMs",
|
|
393
|
+
type: "number"
|
|
394
|
+
}),
|
|
393
395
|
remoteBridgeContractAddress: AddressZod.default(DEFAULT_HARDHAT_BRIDGE_CONTRACT).register(globalRegistry2, {
|
|
394
396
|
default: DEFAULT_HARDHAT_BRIDGE_CONTRACT,
|
|
395
397
|
description: "Hex representation of remote token address used for bridging",
|
|
@@ -402,6 +404,14 @@ var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
|
402
404
|
title: "bridge.remoteChainId",
|
|
403
405
|
type: "string"
|
|
404
406
|
}),
|
|
407
|
+
remoteConfirmationDepth: z3.union([
|
|
408
|
+
z3.coerce.number().int().nonnegative(),
|
|
409
|
+
z3.literal("finalized")
|
|
410
|
+
]).optional().register(globalRegistry2, {
|
|
411
|
+
description: "Block depth or BlockTag at which the remote (EVM) chain is read as canonical. Numeric: number of confirmations behind head. 'finalized': Casper FFG finalized block. Resolved per-chain by getRemoteConfirmationDepth when unset.",
|
|
412
|
+
title: "bridge.remoteConfirmationDepth",
|
|
413
|
+
type: "string"
|
|
414
|
+
}),
|
|
405
415
|
remoteTokenAddress: HexZod.default(DEFAULT_HARDHAT_TOKEN_CONTRACT).register(globalRegistry2, {
|
|
406
416
|
default: DEFAULT_HARDHAT_TOKEN_CONTRACT,
|
|
407
417
|
description: "Hex representation of remote token address used for bridging",
|
|
@@ -653,8 +663,8 @@ var ServiceLifetime = {
|
|
|
653
663
|
Transient: "Transient"
|
|
654
664
|
};
|
|
655
665
|
|
|
656
|
-
// src/shared/init/
|
|
657
|
-
import {
|
|
666
|
+
// src/shared/init/initActorSeedPhrase.ts
|
|
667
|
+
import { assertEx as assertEx2, isString } from "@xylabs/sdk-js";
|
|
658
668
|
|
|
659
669
|
// src/shared/init/walletResolution.ts
|
|
660
670
|
import { HDWallet } from "@xyo-network/sdk-js";
|
|
@@ -962,21 +972,7 @@ async function resolveWalletForActor(actorName, accountPath) {
|
|
|
962
972
|
}
|
|
963
973
|
__name(resolveWalletForActor, "resolveWalletForActor");
|
|
964
974
|
|
|
965
|
-
// src/shared/init/initActorAccount.ts
|
|
966
|
-
var actorAccountSingletons = {};
|
|
967
|
-
async function initActorAccount({ config, logger }) {
|
|
968
|
-
const actorName = config.name;
|
|
969
|
-
if (isDefined(actorAccountSingletons[actorName])) return actorAccountSingletons[actorName];
|
|
970
|
-
const accountPath = typeof config.accountPath === "string" ? config.accountPath : void 0;
|
|
971
|
-
const account = await resolveWalletForActor(actorName, accountPath);
|
|
972
|
-
logger?.debug(`[${actorName}] Using wallet address ${account.address}`);
|
|
973
|
-
actorAccountSingletons[actorName] = account;
|
|
974
|
-
return actorAccountSingletons[actorName];
|
|
975
|
-
}
|
|
976
|
-
__name(initActorAccount, "initActorAccount");
|
|
977
|
-
|
|
978
975
|
// src/shared/init/initActorSeedPhrase.ts
|
|
979
|
-
import { assertEx as assertEx2, isString } from "@xylabs/sdk-js";
|
|
980
976
|
async function initActorSeedPhrase(context, bios) {
|
|
981
977
|
const { logger, config } = context;
|
|
982
978
|
const walletKind = config.name;
|
|
@@ -1039,22 +1035,28 @@ function initStatusReporter({ logger }) {
|
|
|
1039
1035
|
__name(initStatusReporter, "initStatusReporter");
|
|
1040
1036
|
|
|
1041
1037
|
// src/shared/init/initWallet.ts
|
|
1038
|
+
import { isDefined } from "@xylabs/sdk-js";
|
|
1039
|
+
var actorAccountSingletons = {};
|
|
1042
1040
|
async function initActorWallet(context) {
|
|
1043
1041
|
const actorName = context.config.name;
|
|
1042
|
+
if (isDefined(actorAccountSingletons[actorName])) return actorAccountSingletons[actorName];
|
|
1044
1043
|
const accountPath = typeof context.config.accountPath === "string" ? context.config.accountPath : void 0;
|
|
1045
|
-
|
|
1044
|
+
const account = await resolveWalletForActor(actorName, accountPath);
|
|
1045
|
+
context.logger?.debug(`[${actorName}] Using wallet address ${account.address}`);
|
|
1046
|
+
actorAccountSingletons[actorName] = account;
|
|
1047
|
+
return actorAccountSingletons[actorName];
|
|
1046
1048
|
}
|
|
1047
1049
|
__name(initActorWallet, "initActorWallet");
|
|
1048
1050
|
|
|
1049
1051
|
// src/shared/orchestrator/Orchestrator.ts
|
|
1050
|
-
import { AbstractCreatable as AbstractCreatable2, creatable
|
|
1051
|
-
function
|
|
1052
|
+
import { AbstractCreatable as AbstractCreatable2, creatable } from "@xylabs/sdk-js";
|
|
1053
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
1052
1054
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1053
1055
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1054
1056
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1055
1057
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1056
1058
|
}
|
|
1057
|
-
__name(
|
|
1059
|
+
__name(_ts_decorate, "_ts_decorate");
|
|
1058
1060
|
var Orchestrator = class extends AbstractCreatable2 {
|
|
1059
1061
|
static {
|
|
1060
1062
|
__name(this, "Orchestrator");
|
|
@@ -1163,8 +1165,8 @@ var Orchestrator = class extends AbstractCreatable2 {
|
|
|
1163
1165
|
}
|
|
1164
1166
|
}
|
|
1165
1167
|
};
|
|
1166
|
-
Orchestrator =
|
|
1167
|
-
|
|
1168
|
+
Orchestrator = _ts_decorate([
|
|
1169
|
+
creatable()
|
|
1168
1170
|
], Orchestrator);
|
|
1169
1171
|
function isLocalActor(actor) {
|
|
1170
1172
|
return actor instanceof ActorV3;
|
|
@@ -1180,13 +1182,13 @@ __name(formatError, "formatError");
|
|
|
1180
1182
|
// src/shared/provider/SimpleRejectedTransactionsArchivistProvider.ts
|
|
1181
1183
|
import { assertEx as assertEx4 } from "@xylabs/sdk-js";
|
|
1182
1184
|
import { AbstractCreatableProvider, creatableProvider } from "@xyo-network/xl1-sdk";
|
|
1183
|
-
function
|
|
1185
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
1184
1186
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1185
1187
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1186
1188
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1187
1189
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1188
1190
|
}
|
|
1189
|
-
__name(
|
|
1191
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
1190
1192
|
var RejectedTransactionsArchivistProviderMoniker = "RejectedTransactionsArchivistProvider";
|
|
1191
1193
|
var SimpleRejectedTransactionsArchivistProvider = class _SimpleRejectedTransactionsArchivistProvider extends AbstractCreatableProvider {
|
|
1192
1194
|
static {
|
|
@@ -1208,156 +1210,147 @@ var SimpleRejectedTransactionsArchivistProvider = class _SimpleRejectedTransacti
|
|
|
1208
1210
|
};
|
|
1209
1211
|
}
|
|
1210
1212
|
};
|
|
1211
|
-
SimpleRejectedTransactionsArchivistProvider =
|
|
1213
|
+
SimpleRejectedTransactionsArchivistProvider = _ts_decorate2([
|
|
1212
1214
|
creatableProvider()
|
|
1213
1215
|
], SimpleRejectedTransactionsArchivistProvider);
|
|
1214
1216
|
|
|
1217
|
+
// src/node/config/capabilities/Backing.ts
|
|
1218
|
+
import { backingsSatisfied, unmetBackings } from "@xyo-network/xl1-protocol-sdk";
|
|
1219
|
+
|
|
1215
1220
|
// src/node/config/capabilities/Capability.ts
|
|
1216
|
-
|
|
1217
|
-
static {
|
|
1218
|
-
__name(this, "CapabilityRegistry");
|
|
1219
|
-
}
|
|
1220
|
-
_entries = /* @__PURE__ */ new Map();
|
|
1221
|
-
get(id) {
|
|
1222
|
-
const cap = this._entries.get(id);
|
|
1223
|
-
if (!cap) throw new Error(`Capability not found: ${id}`);
|
|
1224
|
-
return cap;
|
|
1225
|
-
}
|
|
1226
|
-
register(cap) {
|
|
1227
|
-
if (this._entries.has(cap.id)) {
|
|
1228
|
-
throw new Error(`Capability already registered: ${cap.id}`);
|
|
1229
|
-
}
|
|
1230
|
-
this._entries.set(cap.id, cap);
|
|
1231
|
-
return this;
|
|
1232
|
-
}
|
|
1233
|
-
toJson() {
|
|
1234
|
-
const result = {};
|
|
1235
|
-
for (const [id, cap] of this._entries.entries()) {
|
|
1236
|
-
const { id: _, ...rest } = cap;
|
|
1237
|
-
result[id] = rest;
|
|
1238
|
-
}
|
|
1239
|
-
return result;
|
|
1240
|
-
}
|
|
1241
|
-
tryGet(id) {
|
|
1242
|
-
return this._entries.get(id);
|
|
1243
|
-
}
|
|
1244
|
-
};
|
|
1245
|
-
function createCapabilityRegistry() {
|
|
1246
|
-
return new CapabilityRegistry();
|
|
1247
|
-
}
|
|
1248
|
-
__name(createCapabilityRegistry, "createCapabilityRegistry");
|
|
1221
|
+
import { createCapabilityRegistry } from "@xyo-network/xl1-protocol-sdk";
|
|
1249
1222
|
|
|
1250
1223
|
// src/node/config/capabilities/defaultCapabilityRegistry.ts
|
|
1251
|
-
import { AccountBalanceViewerMoniker, BlockRunnerMoniker, BlockValidationViewerMoniker
|
|
1224
|
+
import { AccountBalanceViewerMoniker, BlockRunnerMoniker, BlockValidationViewerMoniker, BlockViewerMoniker, ChainContractViewerMoniker, DeadLetterQueueRunnerMoniker, DeadLetterQueueViewerMoniker, FinalizationRunnerMoniker, FinalizationViewerMoniker, MempoolRunnerMoniker, MempoolViewerMoniker, StakeTotalsViewerMoniker, TimeSyncViewerMoniker, TransactionValidationViewerMoniker, TransactionViewerMoniker, WindowedBlockViewerMoniker, XyoViewerMoniker } from "@xyo-network/xl1-sdk";
|
|
1252
1225
|
var XyoConnectionMoniker = "XyoConnection";
|
|
1253
1226
|
var XyoGatewayRunnerMoniker = "XyoGatewayRunner";
|
|
1254
1227
|
var capabilities = [
|
|
1255
1228
|
{
|
|
1256
|
-
id:
|
|
1229
|
+
id: BlockViewerMoniker,
|
|
1257
1230
|
label: "Block viewer",
|
|
1258
|
-
kind: "viewer"
|
|
1231
|
+
kind: "viewer",
|
|
1232
|
+
surface: "node"
|
|
1259
1233
|
},
|
|
1260
1234
|
{
|
|
1261
1235
|
id: WindowedBlockViewerMoniker,
|
|
1262
1236
|
label: "Windowed block viewer",
|
|
1263
|
-
kind: "viewer"
|
|
1237
|
+
kind: "viewer",
|
|
1238
|
+
surface: "node"
|
|
1264
1239
|
},
|
|
1265
1240
|
{
|
|
1266
|
-
id:
|
|
1241
|
+
id: MempoolViewerMoniker,
|
|
1267
1242
|
label: "Mempool viewer",
|
|
1268
|
-
kind: "viewer"
|
|
1243
|
+
kind: "viewer",
|
|
1244
|
+
surface: "node"
|
|
1269
1245
|
},
|
|
1270
1246
|
{
|
|
1271
1247
|
id: MempoolRunnerMoniker,
|
|
1272
1248
|
label: "Mempool runner",
|
|
1273
|
-
kind: "runner"
|
|
1249
|
+
kind: "runner",
|
|
1250
|
+
surface: "node"
|
|
1274
1251
|
},
|
|
1275
1252
|
{
|
|
1276
1253
|
id: AccountBalanceViewerMoniker,
|
|
1277
1254
|
label: "Account balance viewer",
|
|
1278
|
-
kind: "viewer"
|
|
1255
|
+
kind: "viewer",
|
|
1256
|
+
surface: "node"
|
|
1279
1257
|
},
|
|
1280
1258
|
{
|
|
1281
1259
|
id: FinalizationViewerMoniker,
|
|
1282
1260
|
label: "Finalization viewer",
|
|
1283
|
-
kind: "viewer"
|
|
1261
|
+
kind: "viewer",
|
|
1262
|
+
surface: "node"
|
|
1284
1263
|
},
|
|
1285
1264
|
{
|
|
1286
|
-
id:
|
|
1265
|
+
id: FinalizationRunnerMoniker,
|
|
1287
1266
|
label: "Finalization runner",
|
|
1288
|
-
kind: "runner"
|
|
1267
|
+
kind: "runner",
|
|
1268
|
+
surface: "node"
|
|
1289
1269
|
},
|
|
1290
1270
|
{
|
|
1291
1271
|
id: TransactionViewerMoniker,
|
|
1292
1272
|
label: "Transaction viewer",
|
|
1293
|
-
kind: "viewer"
|
|
1273
|
+
kind: "viewer",
|
|
1274
|
+
surface: "node"
|
|
1294
1275
|
},
|
|
1295
1276
|
{
|
|
1296
|
-
id:
|
|
1277
|
+
id: BlockValidationViewerMoniker,
|
|
1297
1278
|
label: "Block validation viewer",
|
|
1298
|
-
kind: "viewer"
|
|
1279
|
+
kind: "viewer",
|
|
1280
|
+
surface: "node"
|
|
1299
1281
|
},
|
|
1300
1282
|
{
|
|
1301
1283
|
id: TransactionValidationViewerMoniker,
|
|
1302
1284
|
label: "Transaction validation viewer",
|
|
1303
|
-
kind: "viewer"
|
|
1285
|
+
kind: "viewer",
|
|
1286
|
+
surface: "node"
|
|
1304
1287
|
},
|
|
1305
1288
|
{
|
|
1306
1289
|
id: DeadLetterQueueViewerMoniker,
|
|
1307
1290
|
label: "Dead-letter queue viewer",
|
|
1308
|
-
kind: "viewer"
|
|
1291
|
+
kind: "viewer",
|
|
1292
|
+
surface: "node"
|
|
1309
1293
|
},
|
|
1310
1294
|
{
|
|
1311
|
-
id:
|
|
1295
|
+
id: DeadLetterQueueRunnerMoniker,
|
|
1312
1296
|
label: "Dead-letter queue runner",
|
|
1313
|
-
kind: "runner"
|
|
1297
|
+
kind: "runner",
|
|
1298
|
+
surface: "node"
|
|
1314
1299
|
},
|
|
1315
1300
|
{
|
|
1316
1301
|
id: ChainContractViewerMoniker,
|
|
1317
1302
|
label: "Chain contract viewer",
|
|
1318
|
-
kind: "viewer"
|
|
1303
|
+
kind: "viewer",
|
|
1304
|
+
surface: "node"
|
|
1319
1305
|
},
|
|
1320
1306
|
{
|
|
1321
1307
|
id: StakeTotalsViewerMoniker,
|
|
1322
1308
|
label: "Stake totals viewer",
|
|
1323
|
-
kind: "viewer"
|
|
1309
|
+
kind: "viewer",
|
|
1310
|
+
surface: "node"
|
|
1324
1311
|
},
|
|
1325
1312
|
{
|
|
1326
1313
|
id: TimeSyncViewerMoniker,
|
|
1327
1314
|
label: "Time sync viewer",
|
|
1328
|
-
kind: "viewer"
|
|
1315
|
+
kind: "viewer",
|
|
1316
|
+
surface: "node"
|
|
1329
1317
|
},
|
|
1330
1318
|
{
|
|
1331
1319
|
id: XyoViewerMoniker,
|
|
1332
1320
|
label: "XYO viewer",
|
|
1333
|
-
kind: "viewer"
|
|
1321
|
+
kind: "viewer",
|
|
1322
|
+
surface: "node"
|
|
1334
1323
|
},
|
|
1335
1324
|
{
|
|
1336
1325
|
id: XyoConnectionMoniker,
|
|
1337
1326
|
label: "XYO connection",
|
|
1338
|
-
kind: "gateway"
|
|
1327
|
+
kind: "gateway",
|
|
1328
|
+
surface: "node"
|
|
1339
1329
|
},
|
|
1340
1330
|
{
|
|
1341
1331
|
id: XyoGatewayRunnerMoniker,
|
|
1342
1332
|
label: "XYO gateway runner",
|
|
1343
|
-
kind: "gateway"
|
|
1333
|
+
kind: "gateway",
|
|
1334
|
+
surface: "node"
|
|
1344
1335
|
},
|
|
1345
1336
|
{
|
|
1346
1337
|
id: RejectedTransactionsArchivistProviderMoniker,
|
|
1347
1338
|
label: "Rejected transactions archivist provider",
|
|
1348
|
-
kind: "archivist"
|
|
1339
|
+
kind: "archivist",
|
|
1340
|
+
surface: "node"
|
|
1349
1341
|
},
|
|
1350
1342
|
{
|
|
1351
1343
|
id: BlockRunnerMoniker,
|
|
1352
1344
|
label: "Block runner",
|
|
1353
1345
|
kind: "runner",
|
|
1346
|
+
surface: "node",
|
|
1354
1347
|
implies: [
|
|
1355
1348
|
AccountBalanceViewerMoniker,
|
|
1356
|
-
|
|
1349
|
+
BlockValidationViewerMoniker,
|
|
1357
1350
|
ChainContractViewerMoniker,
|
|
1358
1351
|
FinalizationViewerMoniker,
|
|
1359
1352
|
MempoolRunnerMoniker,
|
|
1360
|
-
|
|
1353
|
+
MempoolViewerMoniker,
|
|
1361
1354
|
TimeSyncViewerMoniker
|
|
1362
1355
|
]
|
|
1363
1356
|
}
|
|
@@ -1379,6 +1372,13 @@ var localTier1Descriptors = [
|
|
|
1379
1372
|
SimpleMempoolViewer.defaultMoniker
|
|
1380
1373
|
],
|
|
1381
1374
|
tier: 1,
|
|
1375
|
+
backings: [
|
|
1376
|
+
{
|
|
1377
|
+
backing: "mempool-store",
|
|
1378
|
+
mode: "read"
|
|
1379
|
+
}
|
|
1380
|
+
],
|
|
1381
|
+
surface: "node",
|
|
1382
1382
|
preconditions: passes,
|
|
1383
1383
|
build: /* @__PURE__ */ __name((ctx) => SimpleMempoolViewer.factory(SimpleMempoolViewer.dependencies, {
|
|
1384
1384
|
pendingTransactionsArchivist: ctx.process.pendingTransactionsArchivist,
|
|
@@ -1391,6 +1391,13 @@ var localTier1Descriptors = [
|
|
|
1391
1391
|
SimpleMempoolRunner.defaultMoniker
|
|
1392
1392
|
],
|
|
1393
1393
|
tier: 1,
|
|
1394
|
+
backings: [
|
|
1395
|
+
{
|
|
1396
|
+
backing: "mempool-store",
|
|
1397
|
+
mode: "write"
|
|
1398
|
+
}
|
|
1399
|
+
],
|
|
1400
|
+
surface: "node",
|
|
1394
1401
|
preconditions: passes,
|
|
1395
1402
|
build: /* @__PURE__ */ __name((ctx) => SimpleMempoolRunner.factory(SimpleMempoolRunner.dependencies, {
|
|
1396
1403
|
pendingTransactionsArchivist: ctx.process.pendingTransactionsArchivist,
|
|
@@ -1403,6 +1410,13 @@ var localTier1Descriptors = [
|
|
|
1403
1410
|
SimpleAccountBalanceViewer.defaultMoniker
|
|
1404
1411
|
],
|
|
1405
1412
|
tier: 1,
|
|
1413
|
+
backings: [
|
|
1414
|
+
{
|
|
1415
|
+
backing: "indexer-store",
|
|
1416
|
+
mode: "read"
|
|
1417
|
+
}
|
|
1418
|
+
],
|
|
1419
|
+
surface: "node",
|
|
1406
1420
|
preconditions: passes,
|
|
1407
1421
|
build: /* @__PURE__ */ __name((ctx) => SimpleAccountBalanceViewer.factory(SimpleAccountBalanceViewer.dependencies, {
|
|
1408
1422
|
balancesSummaryMap: ctx.process.balancesSummaryMap,
|
|
@@ -1415,6 +1429,13 @@ var localTier1Descriptors = [
|
|
|
1415
1429
|
SimpleFinalizationViewer.defaultMoniker
|
|
1416
1430
|
],
|
|
1417
1431
|
tier: 1,
|
|
1432
|
+
backings: [
|
|
1433
|
+
{
|
|
1434
|
+
backing: "chain-store",
|
|
1435
|
+
mode: "read"
|
|
1436
|
+
}
|
|
1437
|
+
],
|
|
1438
|
+
surface: "node",
|
|
1418
1439
|
preconditions: passes,
|
|
1419
1440
|
build: /* @__PURE__ */ __name((ctx) => SimpleFinalizationViewer.factory(SimpleFinalizationViewer.dependencies, {
|
|
1420
1441
|
finalizedArchivist: ctx.process.readonlyChainArchivist
|
|
@@ -1426,6 +1447,13 @@ var localTier1Descriptors = [
|
|
|
1426
1447
|
SimpleBlockViewer.defaultMoniker
|
|
1427
1448
|
],
|
|
1428
1449
|
tier: 1,
|
|
1450
|
+
backings: [
|
|
1451
|
+
{
|
|
1452
|
+
backing: "chain-store",
|
|
1453
|
+
mode: "read"
|
|
1454
|
+
}
|
|
1455
|
+
],
|
|
1456
|
+
surface: "node",
|
|
1429
1457
|
preconditions: passes,
|
|
1430
1458
|
build: /* @__PURE__ */ __name((ctx) => SimpleBlockViewer.factory(SimpleBlockViewer.dependencies, {
|
|
1431
1459
|
finalizedArchivist: ctx.process.readonlyChainArchivist
|
|
@@ -1437,6 +1465,8 @@ var localTier1Descriptors = [
|
|
|
1437
1465
|
SimpleWindowedBlockViewer.defaultMoniker
|
|
1438
1466
|
],
|
|
1439
1467
|
tier: 1,
|
|
1468
|
+
backings: [],
|
|
1469
|
+
surface: "node",
|
|
1440
1470
|
preconditions: passes,
|
|
1441
1471
|
build: /* @__PURE__ */ __name(() => SimpleWindowedBlockViewer.factory(SimpleWindowedBlockViewer.dependencies, {
|
|
1442
1472
|
maxWindowSize: 1e3,
|
|
@@ -1449,6 +1479,8 @@ var localTier1Descriptors = [
|
|
|
1449
1479
|
SimpleXyoConnectionViewer.defaultMoniker
|
|
1450
1480
|
],
|
|
1451
1481
|
tier: 1,
|
|
1482
|
+
backings: [],
|
|
1483
|
+
surface: "node",
|
|
1452
1484
|
preconditions: passes,
|
|
1453
1485
|
build: /* @__PURE__ */ __name(() => SimpleXyoConnectionViewer.factory(SimpleXyoConnectionViewer.dependencies, {}), "build")
|
|
1454
1486
|
},
|
|
@@ -1458,6 +1490,8 @@ var localTier1Descriptors = [
|
|
|
1458
1490
|
SimpleTransactionViewer.defaultMoniker
|
|
1459
1491
|
],
|
|
1460
1492
|
tier: 1,
|
|
1493
|
+
backings: [],
|
|
1494
|
+
surface: "node",
|
|
1461
1495
|
preconditions: passes,
|
|
1462
1496
|
build: /* @__PURE__ */ __name(() => SimpleTransactionViewer.factory(SimpleTransactionViewer.dependencies, {}), "build")
|
|
1463
1497
|
},
|
|
@@ -1467,6 +1501,8 @@ var localTier1Descriptors = [
|
|
|
1467
1501
|
SimpleXyoViewer.defaultMoniker
|
|
1468
1502
|
],
|
|
1469
1503
|
tier: 1,
|
|
1504
|
+
backings: [],
|
|
1505
|
+
surface: "node",
|
|
1470
1506
|
preconditions: passes,
|
|
1471
1507
|
build: /* @__PURE__ */ __name(() => SimpleXyoViewer.factory(SimpleXyoViewer.dependencies, {}), "build")
|
|
1472
1508
|
},
|
|
@@ -1476,6 +1512,13 @@ var localTier1Descriptors = [
|
|
|
1476
1512
|
SimpleFinalizationRunner.defaultMoniker
|
|
1477
1513
|
],
|
|
1478
1514
|
tier: 1,
|
|
1515
|
+
backings: [
|
|
1516
|
+
{
|
|
1517
|
+
backing: "chain-store",
|
|
1518
|
+
mode: "write"
|
|
1519
|
+
}
|
|
1520
|
+
],
|
|
1521
|
+
surface: "node",
|
|
1479
1522
|
preconditions: passes,
|
|
1480
1523
|
build: /* @__PURE__ */ __name((ctx) => SimpleFinalizationRunner.factory(SimpleFinalizationRunner.dependencies, {
|
|
1481
1524
|
finalizedArchivist: ctx.process.writableChainArchivist
|
|
@@ -1487,6 +1530,8 @@ var localTier1Descriptors = [
|
|
|
1487
1530
|
SimpleBlockValidationViewer.defaultMoniker
|
|
1488
1531
|
],
|
|
1489
1532
|
tier: 1,
|
|
1533
|
+
backings: [],
|
|
1534
|
+
surface: "node",
|
|
1490
1535
|
preconditions: passes,
|
|
1491
1536
|
build: /* @__PURE__ */ __name((ctx) => SimpleBlockValidationViewer.factory(SimpleBlockValidationViewer.dependencies, {
|
|
1492
1537
|
state: ctx.process.blockStateValidator,
|
|
@@ -1499,6 +1544,8 @@ var localTier1Descriptors = [
|
|
|
1499
1544
|
SimpleTransactionValidationViewer.defaultMoniker
|
|
1500
1545
|
],
|
|
1501
1546
|
tier: 1,
|
|
1547
|
+
backings: [],
|
|
1548
|
+
surface: "node",
|
|
1502
1549
|
preconditions: passes,
|
|
1503
1550
|
build: /* @__PURE__ */ __name((ctx) => SimpleTransactionValidationViewer.factory(SimpleTransactionValidationViewer.dependencies, {
|
|
1504
1551
|
protocol: ctx.process.transactionProtocolValidator,
|
|
@@ -1511,6 +1558,13 @@ var localTier1Descriptors = [
|
|
|
1511
1558
|
SimpleDeadLetterQueueRunner.defaultMoniker
|
|
1512
1559
|
],
|
|
1513
1560
|
tier: 1,
|
|
1561
|
+
backings: [
|
|
1562
|
+
{
|
|
1563
|
+
backing: "dlq-store",
|
|
1564
|
+
mode: "write"
|
|
1565
|
+
}
|
|
1566
|
+
],
|
|
1567
|
+
surface: "node",
|
|
1514
1568
|
preconditions: passes,
|
|
1515
1569
|
build: /* @__PURE__ */ __name((ctx) => SimpleDeadLetterQueueRunner.factory(SimpleDeadLetterQueueRunner.dependencies, {
|
|
1516
1570
|
rejectedBlocksArchivist: ctx.process.rejectedBlocksArchivist,
|
|
@@ -1523,6 +1577,13 @@ var localTier1Descriptors = [
|
|
|
1523
1577
|
SimpleDeadLetterQueueViewer.defaultMoniker
|
|
1524
1578
|
],
|
|
1525
1579
|
tier: 1,
|
|
1580
|
+
backings: [
|
|
1581
|
+
{
|
|
1582
|
+
backing: "dlq-store",
|
|
1583
|
+
mode: "read"
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1586
|
+
surface: "node",
|
|
1526
1587
|
preconditions: passes,
|
|
1527
1588
|
build: /* @__PURE__ */ __name((ctx) => SimpleDeadLetterQueueViewer.factory(SimpleDeadLetterQueueViewer.dependencies, {
|
|
1528
1589
|
rejectedBlocksArchivist: ctx.process.rejectedBlocksArchivist,
|
|
@@ -1535,6 +1596,13 @@ var localTier1Descriptors = [
|
|
|
1535
1596
|
SimpleRejectedTransactionsArchivistProvider.defaultMoniker
|
|
1536
1597
|
],
|
|
1537
1598
|
tier: 1,
|
|
1599
|
+
backings: [
|
|
1600
|
+
{
|
|
1601
|
+
backing: "dlq-store",
|
|
1602
|
+
mode: "read"
|
|
1603
|
+
}
|
|
1604
|
+
],
|
|
1605
|
+
surface: "node",
|
|
1538
1606
|
preconditions: passes,
|
|
1539
1607
|
build: /* @__PURE__ */ __name((ctx) => SimpleRejectedTransactionsArchivistProvider.factory(SimpleRejectedTransactionsArchivistProvider.dependencies, {
|
|
1540
1608
|
archivist: ctx.process.rejectedTransactionsArchivist
|
|
@@ -1545,9 +1613,8 @@ var localTier1Descriptors = [
|
|
|
1545
1613
|
// src/node/config/capabilities/locatorFromActorNeeds.ts
|
|
1546
1614
|
import { ProviderFactoryLocator } from "@xyo-network/xl1-sdk";
|
|
1547
1615
|
|
|
1548
|
-
// src/node/config/capabilities/
|
|
1549
|
-
import {
|
|
1550
|
-
import { BlockCumulativeBalanceValidatorFactory, validateTransaction } from "@xyo-network/xl1-sdk";
|
|
1616
|
+
// src/node/config/capabilities/networkTier3Descriptors.ts
|
|
1617
|
+
import { indexedNetworkDescriptors, networkTier3Descriptors, nodeNetworkDescriptors } from "@xyo-network/xl1-sdk";
|
|
1551
1618
|
|
|
1552
1619
|
// src/node/init/initBalanceSummaryMap.ts
|
|
1553
1620
|
import { BaseMongoSdk } from "@xylabs/mongo";
|
|
@@ -1697,7 +1764,6 @@ import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
|
1697
1764
|
import { LmdbArchivistConfigSchema } from "@xyo-network/archivist-lmdb";
|
|
1698
1765
|
import { MongoDBArchivistV2 as MongoDBArchivistV22, MongoDBArchivistV2Deletable } from "@xyo-network/archivist-mongodb";
|
|
1699
1766
|
import { ViewArchivist } from "@xyo-network/archivist-view";
|
|
1700
|
-
import { initTelemetry } from "@xyo-network/chain-telemetry";
|
|
1701
1767
|
import { AbstractModule, LoggerModuleStatusReporter, MemoryArchivist, MemorySentinel, ModuleFactoryLocator } from "@xyo-network/sdk-js";
|
|
1702
1768
|
import { hasMongoConfig as hasMongoConfig2 } from "@xyo-network/xl1-sdk";
|
|
1703
1769
|
|
|
@@ -1726,20 +1792,7 @@ var NamedLmdbArchivist = class extends LmdbArchivist {
|
|
|
1726
1792
|
};
|
|
1727
1793
|
|
|
1728
1794
|
// src/node/manifest/getLocator.ts
|
|
1729
|
-
var getLocator = /* @__PURE__ */ __name(async ({ logger, config }) => {
|
|
1730
|
-
const { otlpEndpoint } = config.telemetry?.otel ?? {};
|
|
1731
|
-
const { path: endpoint = "/metrics", port = 9465 } = config.telemetry?.metrics?.scrape ?? {};
|
|
1732
|
-
const { traceProvider, meterProvider } = await initTelemetry({
|
|
1733
|
-
attributes: {
|
|
1734
|
-
serviceName: "xl1-api",
|
|
1735
|
-
serviceVersion: "1.0.0"
|
|
1736
|
-
},
|
|
1737
|
-
otlpEndpoint,
|
|
1738
|
-
metricsConfig: {
|
|
1739
|
-
endpoint,
|
|
1740
|
-
port
|
|
1741
|
-
}
|
|
1742
|
-
});
|
|
1795
|
+
var getLocator = /* @__PURE__ */ __name(async ({ logger, traceProvider, meterProvider, config }) => {
|
|
1743
1796
|
if (isDefined2(logger)) AbstractModule.defaultLogger = logger;
|
|
1744
1797
|
const statusReporter = logger ? new LoggerModuleStatusReporter(logger) : void 0;
|
|
1745
1798
|
const locator = new ModuleFactoryLocator();
|
|
@@ -2102,7 +2155,86 @@ async function initTransferSummaryMap({ logger, config }) {
|
|
|
2102
2155
|
}
|
|
2103
2156
|
__name(initTransferSummaryMap, "initTransferSummaryMap");
|
|
2104
2157
|
|
|
2105
|
-
// src/node/config/capabilities/
|
|
2158
|
+
// src/node/config/capabilities/backings/buildChainStoreBacking.ts
|
|
2159
|
+
import { asArchivistInstance as asArchivistInstance2 } from "@xyo-network/sdk-js";
|
|
2160
|
+
async function buildChainStoreBacking(node, mode, options) {
|
|
2161
|
+
const readonlyArchivist = asArchivistInstance2(await node.resolve("Chain:Validated"), {
|
|
2162
|
+
required: true
|
|
2163
|
+
});
|
|
2164
|
+
if (mode === "read") {
|
|
2165
|
+
return {
|
|
2166
|
+
mode,
|
|
2167
|
+
readonlyArchivist
|
|
2168
|
+
};
|
|
2169
|
+
}
|
|
2170
|
+
if (!options) {
|
|
2171
|
+
throw new Error("buildChainStoreBacking(write) requires options { actorConfig, wallet }");
|
|
2172
|
+
}
|
|
2173
|
+
const writableArchivist = asArchivistInstance2(await node.resolve("Chain:Validated"), {
|
|
2174
|
+
required: true
|
|
2175
|
+
});
|
|
2176
|
+
await initFinalizationArchivistIfNeeded(writableArchivist, options.actorConfig, options.wallet, {
|
|
2177
|
+
logger: options.logger,
|
|
2178
|
+
onInsecureGenesisConfirm: options.onInsecureGenesisConfirm
|
|
2179
|
+
});
|
|
2180
|
+
return {
|
|
2181
|
+
mode,
|
|
2182
|
+
readonlyArchivist,
|
|
2183
|
+
writableArchivist
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
__name(buildChainStoreBacking, "buildChainStoreBacking");
|
|
2187
|
+
|
|
2188
|
+
// src/node/config/capabilities/backings/buildDlqStoreBacking.ts
|
|
2189
|
+
import { asArchivistInstance as asArchivistInstance3 } from "@xyo-network/sdk-js";
|
|
2190
|
+
async function buildDlqStoreBacking(node, mode) {
|
|
2191
|
+
const rejectedBlocksArchivist = asArchivistInstance3(await node.resolve("XYOChain:DeadLetterQueue:RejectedBlocks"), {
|
|
2192
|
+
required: true
|
|
2193
|
+
});
|
|
2194
|
+
const rejectedTransactionsArchivist = asArchivistInstance3(await node.resolve("XYOChain:DeadLetterQueue:RejectedTransactions"), {
|
|
2195
|
+
required: true
|
|
2196
|
+
});
|
|
2197
|
+
return {
|
|
2198
|
+
mode,
|
|
2199
|
+
rejectedBlocksArchivist,
|
|
2200
|
+
rejectedTransactionsArchivist
|
|
2201
|
+
};
|
|
2202
|
+
}
|
|
2203
|
+
__name(buildDlqStoreBacking, "buildDlqStoreBacking");
|
|
2204
|
+
|
|
2205
|
+
// src/node/config/capabilities/backings/buildIndexerStoreBacking.ts
|
|
2206
|
+
import { assertEx as assertEx9 } from "@xylabs/sdk-js";
|
|
2207
|
+
async function buildIndexerStoreBacking(context, mode) {
|
|
2208
|
+
const balancesSummaryMap = assertEx9(await initBalanceSummaryMap(context), () => "Balance Summary Map not initialized");
|
|
2209
|
+
const transfersSummaryMap = assertEx9(await initTransferSummaryMap(context), () => "Transfer Summary Map not initialized");
|
|
2210
|
+
return {
|
|
2211
|
+
balancesSummaryMap,
|
|
2212
|
+
mode,
|
|
2213
|
+
transfersSummaryMap
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
__name(buildIndexerStoreBacking, "buildIndexerStoreBacking");
|
|
2217
|
+
|
|
2218
|
+
// src/node/config/capabilities/backings/buildMempoolStoreBacking.ts
|
|
2219
|
+
import { asArchivistInstance as asArchivistInstance4 } from "@xyo-network/sdk-js";
|
|
2220
|
+
async function buildMempoolStoreBacking(node, mode) {
|
|
2221
|
+
const pendingTransactionsArchivist = asArchivistInstance4(await node.resolve("XYOChain:Pending:Transactions"), {
|
|
2222
|
+
required: true
|
|
2223
|
+
});
|
|
2224
|
+
const pendingBlocksArchivist = asArchivistInstance4(await node.resolve("XYOChain:Pending:Blocks"), {
|
|
2225
|
+
required: true
|
|
2226
|
+
});
|
|
2227
|
+
return {
|
|
2228
|
+
mode,
|
|
2229
|
+
pendingBlocksArchivist,
|
|
2230
|
+
pendingTransactionsArchivist
|
|
2231
|
+
};
|
|
2232
|
+
}
|
|
2233
|
+
__name(buildMempoolStoreBacking, "buildMempoolStoreBacking");
|
|
2234
|
+
|
|
2235
|
+
// src/node/config/capabilities/backings/buildValidators.ts
|
|
2236
|
+
import { validateHydratedBlock, validateHydratedBlockState, validateHydratedTransactionState } from "@xyo-network/chain-validation";
|
|
2237
|
+
import { BlockCumulativeBalanceValidatorFactory, validateTransaction } from "@xyo-network/xl1-sdk";
|
|
2106
2238
|
var cumulativeBalanceValidator = BlockCumulativeBalanceValidatorFactory();
|
|
2107
2239
|
var validateHydratedBlockStateWithCumulativeBalance = /* @__PURE__ */ __name(async (context, block) => {
|
|
2108
2240
|
const [stateErrors, cumulativeErrors] = await Promise.all([
|
|
@@ -2114,196 +2246,58 @@ var validateHydratedBlockStateWithCumulativeBalance = /* @__PURE__ */ __name(asy
|
|
|
2114
2246
|
...cumulativeErrors
|
|
2115
2247
|
];
|
|
2116
2248
|
}, "validateHydratedBlockStateWithCumulativeBalance");
|
|
2117
|
-
|
|
2118
|
-
const balancesSummaryMap = await initBalanceSummaryMap(context);
|
|
2119
|
-
if (!balancesSummaryMap) throw new Error("Balance Summary Map not initialized");
|
|
2120
|
-
const transfersSummaryMap = await initTransferSummaryMap(context);
|
|
2121
|
-
if (!transfersSummaryMap) throw new Error("Transfer Summary Map not initialized");
|
|
2122
|
-
const wallet = await initActorWallet(context);
|
|
2123
|
-
const serverNode = await initServerNode(context, wallet);
|
|
2124
|
-
const { writableChainArchivist, readonlyChainArchivist, pendingTransactionsArchivist, pendingBlocksArchivist, rejectedBlocksArchivist, rejectedTransactionsArchivist } = serverNode;
|
|
2125
|
-
await initFinalizationArchivistIfNeeded(writableChainArchivist, context.config, wallet, {
|
|
2126
|
-
logger: context.logger,
|
|
2127
|
-
onInsecureGenesisConfirm: options?.onInsecureGenesisConfirm
|
|
2128
|
-
});
|
|
2249
|
+
function buildValidators() {
|
|
2129
2250
|
return {
|
|
2130
|
-
balancesSummaryMap,
|
|
2131
|
-
transfersSummaryMap,
|
|
2132
|
-
wallet,
|
|
2133
|
-
node: serverNode.node,
|
|
2134
|
-
writableChainArchivist,
|
|
2135
|
-
readonlyChainArchivist,
|
|
2136
|
-
pendingTransactionsArchivist,
|
|
2137
|
-
pendingBlocksArchivist,
|
|
2138
|
-
rejectedBlocksArchivist,
|
|
2139
|
-
rejectedTransactionsArchivist,
|
|
2140
2251
|
blockProtocolValidator: validateHydratedBlock,
|
|
2141
2252
|
blockStateValidator: validateHydratedBlockStateWithCumulativeBalance,
|
|
2142
2253
|
transactionProtocolValidator: validateTransaction,
|
|
2143
2254
|
transactionStateValidator: validateHydratedTransactionState
|
|
2144
2255
|
};
|
|
2145
2256
|
}
|
|
2146
|
-
__name(
|
|
2257
|
+
__name(buildValidators, "buildValidators");
|
|
2147
2258
|
|
|
2148
|
-
// src/node/config/capabilities/
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
}
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
const
|
|
2165
|
-
const { surviving, rejected } = filterByPreconditions(candidates, ctx);
|
|
2166
|
-
const byCapability = groupByCapability(surviving, wanted);
|
|
2167
|
-
const { bindings, selectedById } = pickWinners(wanted, byCapability, rejected, candidates);
|
|
2168
|
-
const selected = topoSort([
|
|
2169
|
-
...selectedById.values()
|
|
2170
|
-
], ctx);
|
|
2171
|
-
return {
|
|
2172
|
-
bindings,
|
|
2173
|
-
rejected,
|
|
2174
|
-
selected
|
|
2175
|
-
};
|
|
2176
|
-
}
|
|
2177
|
-
__name(resolveProviders, "resolveProviders");
|
|
2178
|
-
function expandNeeds(needs, ctx) {
|
|
2179
|
-
const wanted = new Set(needs);
|
|
2180
|
-
const stack = [
|
|
2181
|
-
...needs
|
|
2182
|
-
];
|
|
2183
|
-
while (stack.length > 0) {
|
|
2184
|
-
const moniker = stack.pop();
|
|
2185
|
-
const cap = ctx.capabilities.tryGet(moniker);
|
|
2186
|
-
if (!cap?.implies) continue;
|
|
2187
|
-
for (const dep of cap.implies) {
|
|
2188
|
-
if (!wanted.has(dep)) {
|
|
2189
|
-
wanted.add(dep);
|
|
2190
|
-
stack.push(dep);
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
return wanted;
|
|
2195
|
-
}
|
|
2196
|
-
__name(expandNeeds, "expandNeeds");
|
|
2197
|
-
function filterByPreconditions(candidates, ctx) {
|
|
2198
|
-
const surviving = [];
|
|
2199
|
-
const rejected = [];
|
|
2200
|
-
for (const descriptor of candidates) {
|
|
2201
|
-
try {
|
|
2202
|
-
if (descriptor.preconditions(ctx)) {
|
|
2203
|
-
surviving.push(descriptor);
|
|
2204
|
-
} else {
|
|
2205
|
-
rejected.push({
|
|
2206
|
-
descriptor,
|
|
2207
|
-
reason: "preconditions returned false"
|
|
2208
|
-
});
|
|
2209
|
-
}
|
|
2210
|
-
} catch (err) {
|
|
2211
|
-
rejected.push({
|
|
2212
|
-
descriptor,
|
|
2213
|
-
reason: `preconditions threw: ${err instanceof Error ? err.message : String(err)}`
|
|
2214
|
-
});
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
return {
|
|
2218
|
-
surviving,
|
|
2219
|
-
rejected
|
|
2220
|
-
};
|
|
2221
|
-
}
|
|
2222
|
-
__name(filterByPreconditions, "filterByPreconditions");
|
|
2223
|
-
function groupByCapability(surviving, wanted) {
|
|
2224
|
-
const byCapability = /* @__PURE__ */ new Map();
|
|
2225
|
-
for (const descriptor of surviving) {
|
|
2226
|
-
for (const moniker of descriptor.satisfies) {
|
|
2227
|
-
if (!wanted.has(moniker)) continue;
|
|
2228
|
-
const list = byCapability.get(moniker) ?? [];
|
|
2229
|
-
list.push(descriptor);
|
|
2230
|
-
byCapability.set(moniker, list);
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
return byCapability;
|
|
2234
|
-
}
|
|
2235
|
-
__name(groupByCapability, "groupByCapability");
|
|
2236
|
-
function pickWinners(wanted, byCapability, rejected, allCandidates) {
|
|
2237
|
-
const bindings = {};
|
|
2238
|
-
const selectedById = /* @__PURE__ */ new Map();
|
|
2239
|
-
for (const moniker of wanted) {
|
|
2240
|
-
const group = byCapability.get(moniker);
|
|
2241
|
-
if (!group || group.length === 0) {
|
|
2242
|
-
throw new MissingCapabilityError(moniker, reasonsFor(moniker, rejected, allCandidates));
|
|
2243
|
-
}
|
|
2244
|
-
const sorted = group.toSorted(compareDescriptors);
|
|
2245
|
-
const winner = sorted[0];
|
|
2246
|
-
bindings[moniker] = winner.id;
|
|
2247
|
-
selectedById.set(winner.id, winner);
|
|
2248
|
-
for (const loser of sorted.slice(1)) {
|
|
2249
|
-
rejected.push({
|
|
2250
|
-
descriptor: loser,
|
|
2251
|
-
reason: `tier ${loser.tier} lost to ${winner.id} (tier ${winner.tier}) for ${moniker}`
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
}
|
|
2259
|
+
// src/node/config/capabilities/ProcessSharedResources.ts
|
|
2260
|
+
async function buildProcessSharedResources(context, options) {
|
|
2261
|
+
const wallet = await initActorWallet(context);
|
|
2262
|
+
const serverNode = await initServerNode(context, wallet);
|
|
2263
|
+
const { node } = serverNode;
|
|
2264
|
+
const [chainStore, mempoolStore, dlqStore, indexerStore] = await Promise.all([
|
|
2265
|
+
buildChainStoreBacking(node, "write", {
|
|
2266
|
+
actorConfig: context.config,
|
|
2267
|
+
logger: context.logger,
|
|
2268
|
+
onInsecureGenesisConfirm: options?.onInsecureGenesisConfirm,
|
|
2269
|
+
wallet
|
|
2270
|
+
}),
|
|
2271
|
+
buildMempoolStoreBacking(node, "write"),
|
|
2272
|
+
buildDlqStoreBacking(node, "write"),
|
|
2273
|
+
buildIndexerStoreBacking(context, "write")
|
|
2274
|
+
]);
|
|
2275
|
+
const validators = buildValidators();
|
|
2255
2276
|
return {
|
|
2256
|
-
|
|
2257
|
-
|
|
2277
|
+
balancesSummaryMap: indexerStore.balancesSummaryMap,
|
|
2278
|
+
blockProtocolValidator: validators.blockProtocolValidator,
|
|
2279
|
+
blockStateValidator: validators.blockStateValidator,
|
|
2280
|
+
node,
|
|
2281
|
+
pendingBlocksArchivist: mempoolStore.pendingBlocksArchivist,
|
|
2282
|
+
pendingTransactionsArchivist: mempoolStore.pendingTransactionsArchivist,
|
|
2283
|
+
readonlyChainArchivist: chainStore.readonlyArchivist,
|
|
2284
|
+
rejectedBlocksArchivist: dlqStore.rejectedBlocksArchivist,
|
|
2285
|
+
rejectedTransactionsArchivist: dlqStore.rejectedTransactionsArchivist,
|
|
2286
|
+
transactionProtocolValidator: validators.transactionProtocolValidator,
|
|
2287
|
+
transactionStateValidator: validators.transactionStateValidator,
|
|
2288
|
+
transfersSummaryMap: indexerStore.transfersSummaryMap,
|
|
2289
|
+
wallet,
|
|
2290
|
+
writableChainArchivist: chainStore.writableArchivist
|
|
2258
2291
|
};
|
|
2259
2292
|
}
|
|
2260
|
-
__name(
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
return rejected.filter((r) => r.descriptor.satisfies.includes(moniker)).map((r) => `${r.descriptor.id}: ${r.reason}`);
|
|
2265
|
-
}
|
|
2266
|
-
__name(reasonsFor, "reasonsFor");
|
|
2267
|
-
function compareDescriptors(a, b) {
|
|
2268
|
-
if (a.tier !== b.tier) return a.tier - b.tier;
|
|
2269
|
-
const pa = a.priority ?? 0;
|
|
2270
|
-
const pb = b.priority ?? 0;
|
|
2271
|
-
if (pa !== pb) return pb - pa;
|
|
2272
|
-
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
2273
|
-
}
|
|
2274
|
-
__name(compareDescriptors, "compareDescriptors");
|
|
2275
|
-
function topoSort(descriptors, ctx) {
|
|
2276
|
-
const byMoniker = /* @__PURE__ */ new Map();
|
|
2277
|
-
for (const d of descriptors) for (const m of d.satisfies) byMoniker.set(m, d);
|
|
2278
|
-
const order = [];
|
|
2279
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2280
|
-
const visiting = /* @__PURE__ */ new Set();
|
|
2281
|
-
const visit = /* @__PURE__ */ __name((d) => {
|
|
2282
|
-
if (seen.has(d.id)) return;
|
|
2283
|
-
if (visiting.has(d.id)) {
|
|
2284
|
-
throw new Error(`Cycle detected through provider ${d.id}`);
|
|
2285
|
-
}
|
|
2286
|
-
visiting.add(d.id);
|
|
2287
|
-
for (const moniker of d.satisfies) {
|
|
2288
|
-
const cap = ctx.capabilities.tryGet(moniker);
|
|
2289
|
-
if (!cap?.implies) continue;
|
|
2290
|
-
for (const dep of cap.implies) {
|
|
2291
|
-
const depDesc = byMoniker.get(dep);
|
|
2292
|
-
if (depDesc) visit(depDesc);
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
visiting.delete(d.id);
|
|
2296
|
-
seen.add(d.id);
|
|
2297
|
-
order.push(d);
|
|
2298
|
-
}, "visit");
|
|
2299
|
-
for (const d of descriptors) visit(d);
|
|
2300
|
-
return order;
|
|
2301
|
-
}
|
|
2302
|
-
__name(topoSort, "topoSort");
|
|
2293
|
+
__name(buildProcessSharedResources, "buildProcessSharedResources");
|
|
2294
|
+
|
|
2295
|
+
// src/node/config/capabilities/resolveProviders.ts
|
|
2296
|
+
import { MissingCapabilityError, resolveProviders } from "@xyo-network/xl1-protocol-sdk";
|
|
2303
2297
|
|
|
2304
2298
|
// src/node/config/capabilities/locatorFromActorNeeds.ts
|
|
2305
2299
|
async function locatorFromActorNeeds(context, actorNeeds, options = {}) {
|
|
2306
|
-
const process2 = await buildProcessSharedResources(context, options);
|
|
2300
|
+
const process2 = options.process ?? await buildProcessSharedResources(context, options);
|
|
2307
2301
|
const capabilities2 = createDefaultCapabilityRegistry();
|
|
2308
2302
|
const resolutionContext = {
|
|
2309
2303
|
actorContext: context,
|
|
@@ -2313,9 +2307,12 @@ async function locatorFromActorNeeds(context, actorNeeds, options = {}) {
|
|
|
2313
2307
|
const needs = unionNeeds(actorNeeds);
|
|
2314
2308
|
const candidates = [
|
|
2315
2309
|
...localTier1Descriptors,
|
|
2310
|
+
...networkTier3Descriptors,
|
|
2316
2311
|
...options.extraDescriptors ?? []
|
|
2317
2312
|
];
|
|
2318
|
-
const plan = resolveProviders(needs, candidates, resolutionContext
|
|
2313
|
+
const plan = resolveProviders(needs, candidates, resolutionContext, {
|
|
2314
|
+
availableBackings: options.availableBackings
|
|
2315
|
+
});
|
|
2319
2316
|
const locator = new ProviderFactoryLocator(context, {}, options.validateDepsOnRegister ?? false);
|
|
2320
2317
|
const factories = plan.selected.map((d) => d.build(resolutionContext)).filter((f) => f !== void 0);
|
|
2321
2318
|
locator.registerMany(factories);
|
|
@@ -2375,12 +2372,29 @@ function basicRemoteViewerLocator(name, remoteConfig, dataLakeEndpoint, validato
|
|
|
2375
2372
|
}
|
|
2376
2373
|
__name(basicRemoteViewerLocator, "basicRemoteViewerLocator");
|
|
2377
2374
|
|
|
2375
|
+
// src/node/config/locators/buildStatelessApiLocator.ts
|
|
2376
|
+
var STATELESS_BACKINGS = [
|
|
2377
|
+
{
|
|
2378
|
+
backing: "network",
|
|
2379
|
+
mode: "read"
|
|
2380
|
+
}
|
|
2381
|
+
];
|
|
2382
|
+
async function buildStatelessApiLocator(context, needs) {
|
|
2383
|
+
const stubProcess = {};
|
|
2384
|
+
const result = await locatorFromActorNeeds(context, needs, {
|
|
2385
|
+
availableBackings: STATELESS_BACKINGS,
|
|
2386
|
+
process: stubProcess
|
|
2387
|
+
});
|
|
2388
|
+
return result.locator;
|
|
2389
|
+
}
|
|
2390
|
+
__name(buildStatelessApiLocator, "buildStatelessApiLocator");
|
|
2391
|
+
|
|
2378
2392
|
// src/node/config/locators/telemetryContextFromConfig.ts
|
|
2379
|
-
import { initTelemetry
|
|
2380
|
-
async function telemetryContextFromConfig(config, serviceName, serviceVersion) {
|
|
2393
|
+
import { initTelemetry } from "@xyo-network/chain-telemetry";
|
|
2394
|
+
async function telemetryContextFromConfig(config, serviceName, serviceVersion, defaultScrapePort = 9464) {
|
|
2381
2395
|
const { otlpEndpoint } = config.telemetry?.otel ?? {};
|
|
2382
|
-
const { path: endpoint = "/metrics", port =
|
|
2383
|
-
return await
|
|
2396
|
+
const { path: endpoint = "/metrics", port = defaultScrapePort } = config.telemetry?.metrics?.scrape ?? {};
|
|
2397
|
+
return await initTelemetry({
|
|
2384
2398
|
attributes: {
|
|
2385
2399
|
serviceName,
|
|
2386
2400
|
serviceVersion
|
|
@@ -2395,10 +2409,10 @@ async function telemetryContextFromConfig(config, serviceName, serviceVersion) {
|
|
|
2395
2409
|
__name(telemetryContextFromConfig, "telemetryContextFromConfig");
|
|
2396
2410
|
|
|
2397
2411
|
// src/node/config/locators/contextFromConfigWithoutLocator.ts
|
|
2398
|
-
async function contextFromConfigWithoutLocator(config, logger, serviceName, serviceVersion) {
|
|
2412
|
+
async function contextFromConfigWithoutLocator(config, logger, serviceName, serviceVersion, defaultScrapePort) {
|
|
2399
2413
|
const singletons = {};
|
|
2400
2414
|
const caches = {};
|
|
2401
|
-
const telemetryConfig = await telemetryContextFromConfig(config, serviceName, serviceVersion);
|
|
2415
|
+
const telemetryConfig = await telemetryContextFromConfig(config, serviceName, serviceVersion, defaultScrapePort);
|
|
2402
2416
|
const statusReporter = initStatusReporter({
|
|
2403
2417
|
logger
|
|
2404
2418
|
});
|
|
@@ -2414,19 +2428,19 @@ async function contextFromConfigWithoutLocator(config, logger, serviceName, serv
|
|
|
2414
2428
|
__name(contextFromConfigWithoutLocator, "contextFromConfigWithoutLocator");
|
|
2415
2429
|
|
|
2416
2430
|
// src/node/config/locators/localLocatorFromConfig.ts
|
|
2417
|
-
import { AccountBalanceViewerMoniker as AccountBalanceViewerMoniker2, BlockValidationViewerMoniker as
|
|
2431
|
+
import { AccountBalanceViewerMoniker as AccountBalanceViewerMoniker2, BlockValidationViewerMoniker as BlockValidationViewerMoniker2, BlockViewerMoniker as BlockViewerMoniker2, DeadLetterQueueRunnerMoniker as DeadLetterQueueRunnerMoniker2, DeadLetterQueueViewerMoniker as DeadLetterQueueViewerMoniker2, FinalizationRunnerMoniker as FinalizationRunnerMoniker2, FinalizationViewerMoniker as FinalizationViewerMoniker2, MempoolRunnerMoniker as MempoolRunnerMoniker2, MempoolViewerMoniker as MempoolViewerMoniker2, TransactionValidationViewerMoniker as TransactionValidationViewerMoniker2, TransactionViewerMoniker as TransactionViewerMoniker2, WindowedBlockViewerMoniker as WindowedBlockViewerMoniker2, XyoViewerMoniker as XyoViewerMoniker2 } from "@xyo-network/xl1-sdk";
|
|
2418
2432
|
var XyoConnectionMoniker2 = "XyoConnection";
|
|
2419
2433
|
var LOCAL_LEGACY_NEEDS = {
|
|
2420
2434
|
required: [
|
|
2421
2435
|
AccountBalanceViewerMoniker2,
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2436
|
+
BlockValidationViewerMoniker2,
|
|
2437
|
+
BlockViewerMoniker2,
|
|
2438
|
+
DeadLetterQueueRunnerMoniker2,
|
|
2425
2439
|
DeadLetterQueueViewerMoniker2,
|
|
2426
|
-
|
|
2440
|
+
FinalizationRunnerMoniker2,
|
|
2427
2441
|
FinalizationViewerMoniker2,
|
|
2428
2442
|
MempoolRunnerMoniker2,
|
|
2429
|
-
|
|
2443
|
+
MempoolViewerMoniker2,
|
|
2430
2444
|
RejectedTransactionsArchivistProviderMoniker,
|
|
2431
2445
|
TransactionValidationViewerMoniker2,
|
|
2432
2446
|
TransactionViewerMoniker2,
|
|
@@ -2450,8 +2464,31 @@ __name(localLocatorFromConfig, "localLocatorFromConfig");
|
|
|
2450
2464
|
import { deepMerge as deepMerge2 } from "@xylabs/sdk-js";
|
|
2451
2465
|
|
|
2452
2466
|
// src/node/config/locators/actors/apiLocatorFromConfig.ts
|
|
2453
|
-
import { ProviderFactoryLocator as ProviderFactoryLocator2, SimpleXyoConnectionRunner, SimpleXyoGateway, SimpleXyoRunner } from "@xyo-network/xl1-sdk";
|
|
2454
|
-
|
|
2467
|
+
import { AccountBalanceViewerMoniker as AccountBalanceViewerMoniker3, BlockViewerMoniker as BlockViewerMoniker3, FinalizationViewerMoniker as FinalizationViewerMoniker3, MempoolViewerMoniker as MempoolViewerMoniker3, ProviderFactoryLocator as ProviderFactoryLocator2, SimpleXyoConnectionRunner, SimpleXyoGateway, SimpleXyoRunner, TransactionViewerMoniker as TransactionViewerMoniker3, XyoConnectionMoniker as XyoConnectionMoniker3, XyoViewerMoniker as XyoViewerMoniker3 } from "@xyo-network/xl1-sdk";
|
|
2468
|
+
var API_NEEDS = {
|
|
2469
|
+
required: [
|
|
2470
|
+
AccountBalanceViewerMoniker3,
|
|
2471
|
+
BlockViewerMoniker3,
|
|
2472
|
+
FinalizationViewerMoniker3,
|
|
2473
|
+
MempoolViewerMoniker3,
|
|
2474
|
+
TransactionViewerMoniker3,
|
|
2475
|
+
XyoConnectionMoniker3,
|
|
2476
|
+
XyoViewerMoniker3
|
|
2477
|
+
]
|
|
2478
|
+
};
|
|
2479
|
+
async function apiLocatorFromConfig(context, parent) {
|
|
2480
|
+
if (context.config.stateless) {
|
|
2481
|
+
const locator2 = await buildStatelessApiLocator(context, [
|
|
2482
|
+
API_NEEDS
|
|
2483
|
+
]);
|
|
2484
|
+
locator2.registerMany([
|
|
2485
|
+
SimpleXyoRunner.factory(SimpleXyoRunner.dependencies, {}),
|
|
2486
|
+
SimpleXyoConnectionRunner.factory(SimpleXyoConnectionRunner.dependencies, {}),
|
|
2487
|
+
SimpleXyoGateway.factory(SimpleXyoGateway.dependencies, {})
|
|
2488
|
+
]);
|
|
2489
|
+
locator2.freeze();
|
|
2490
|
+
return locator2;
|
|
2491
|
+
}
|
|
2455
2492
|
const locator = new ProviderFactoryLocator2({
|
|
2456
2493
|
...context,
|
|
2457
2494
|
locator: parent
|
|
@@ -2476,7 +2513,7 @@ async function bridgeLocatorFromConfig(context, parent) {
|
|
|
2476
2513
|
});
|
|
2477
2514
|
const { config } = context;
|
|
2478
2515
|
const { dataLake } = config;
|
|
2479
|
-
const signerAccount = await
|
|
2516
|
+
const signerAccount = await initActorWallet(context);
|
|
2480
2517
|
if (config.remote.rpc) {
|
|
2481
2518
|
locator.registerMany([
|
|
2482
2519
|
JsonRpcMempoolViewer.factory(JsonRpcMempoolViewer.dependencies, {}),
|
|
@@ -2556,7 +2593,7 @@ import { SimpleBlockRunner } from "@xyo-network/chain-services";
|
|
|
2556
2593
|
import { ProviderFactoryLocator as ProviderFactoryLocator6 } from "@xyo-network/xl1-sdk";
|
|
2557
2594
|
async function producerLocatorFromConfig(context, parent) {
|
|
2558
2595
|
const { logger, config } = context;
|
|
2559
|
-
const account = await
|
|
2596
|
+
const account = await initActorWallet(context);
|
|
2560
2597
|
const locator = new ProviderFactoryLocator6({
|
|
2561
2598
|
...context,
|
|
2562
2599
|
locator: parent
|
|
@@ -2592,7 +2629,7 @@ async function rewardRedemptionLocatorFromConfig(context, parent) {
|
|
|
2592
2629
|
locator: parent
|
|
2593
2630
|
});
|
|
2594
2631
|
const { config } = context;
|
|
2595
|
-
const account = await
|
|
2632
|
+
const account = await initActorWallet(context);
|
|
2596
2633
|
if (config.remote.rpc) {
|
|
2597
2634
|
locator.registerMany([
|
|
2598
2635
|
JsonRpcMempoolViewer2.factory(JsonRpcMempoolViewer2.dependencies, {}),
|
|
@@ -2637,18 +2674,28 @@ async function rootLocatorFromConfig(context, validateDepsOnRegister = false, on
|
|
|
2637
2674
|
__name(rootLocatorFromConfig, "rootLocatorFromConfig");
|
|
2638
2675
|
|
|
2639
2676
|
// src/node/config/locators/locatorsFromConfig.ts
|
|
2677
|
+
function allActorsAreSelfSufficient(actors, config) {
|
|
2678
|
+
if (actors.length === 0) return false;
|
|
2679
|
+
return actors.every((actor) => {
|
|
2680
|
+
if (actor.name !== "api") return false;
|
|
2681
|
+
const merged = ApiConfigZod.parse(deepMerge2(config, actor));
|
|
2682
|
+
return merged.stateless === true;
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
__name(allActorsAreSelfSufficient, "allActorsAreSelfSufficient");
|
|
2640
2686
|
async function locatorsFromConfig(context, { actors, ...config }, onInsecureGenesisConfirm) {
|
|
2641
|
-
const
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2687
|
+
const result = {};
|
|
2688
|
+
const skipRoot = allActorsAreSelfSufficient(actors, config);
|
|
2689
|
+
if (!skipRoot) {
|
|
2690
|
+
const rootContext = {
|
|
2691
|
+
...context,
|
|
2692
|
+
config: {
|
|
2693
|
+
...config,
|
|
2694
|
+
name: "_root"
|
|
2695
|
+
}
|
|
2696
|
+
};
|
|
2697
|
+
result._root = await rootLocatorFromConfig(rootContext, false, onInsecureGenesisConfirm);
|
|
2698
|
+
}
|
|
2652
2699
|
for (const actorConfig of actors) {
|
|
2653
2700
|
switch (actorConfig.name) {
|
|
2654
2701
|
case "producer": {
|
|
@@ -2780,7 +2827,6 @@ export {
|
|
|
2780
2827
|
DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL,
|
|
2781
2828
|
DefaultServiceProvider,
|
|
2782
2829
|
DerivationPathCollisionError,
|
|
2783
|
-
FinalizerActor,
|
|
2784
2830
|
FinalizerConfigContext,
|
|
2785
2831
|
FinalizerConfigZod,
|
|
2786
2832
|
GENESIS_REWARD_AMOUNT,
|
|
@@ -2815,10 +2861,12 @@ export {
|
|
|
2815
2861
|
asRewardRedemptionConfig,
|
|
2816
2862
|
asRewardRedemptionConfigContext,
|
|
2817
2863
|
assertNoActorMnemonics,
|
|
2864
|
+
backingsSatisfied,
|
|
2818
2865
|
basicRemoteRunnerLocator,
|
|
2819
2866
|
basicRemoteViewerLocator,
|
|
2820
2867
|
buildInsecureGenesisRewardAccounts,
|
|
2821
2868
|
buildProcessSharedResources,
|
|
2869
|
+
buildStatelessApiLocator,
|
|
2822
2870
|
buildTelemetryConfig,
|
|
2823
2871
|
clearResolvedWalletReport,
|
|
2824
2872
|
contextFromConfigWithoutLocator,
|
|
@@ -2833,7 +2881,7 @@ export {
|
|
|
2833
2881
|
getInsecureGenesisRewardMnemonic,
|
|
2834
2882
|
getLocator,
|
|
2835
2883
|
getResolvedWalletReport,
|
|
2836
|
-
|
|
2884
|
+
indexedNetworkDescriptors,
|
|
2837
2885
|
initActorSeedPhrase,
|
|
2838
2886
|
initActorWallet,
|
|
2839
2887
|
initBalanceSummaryMap,
|
|
@@ -2865,6 +2913,8 @@ export {
|
|
|
2865
2913
|
locatorFromActorNeeds,
|
|
2866
2914
|
locatorsFromConfig,
|
|
2867
2915
|
mergeConfig,
|
|
2916
|
+
networkTier3Descriptors,
|
|
2917
|
+
nodeNetworkDescriptors,
|
|
2868
2918
|
resolveActorAccountPath,
|
|
2869
2919
|
resolveActorWallet,
|
|
2870
2920
|
resolveGenesisRewardAddress,
|
|
@@ -2886,6 +2936,7 @@ export {
|
|
|
2886
2936
|
toProducerConfigContext,
|
|
2887
2937
|
toRewardRedemptionConfig,
|
|
2888
2938
|
toRewardRedemptionConfigContext,
|
|
2889
|
-
tryParseConfig
|
|
2939
|
+
tryParseConfig,
|
|
2940
|
+
unmetBackings
|
|
2890
2941
|
};
|
|
2891
2942
|
//# sourceMappingURL=index.mjs.map
|