@xyo-network/chain-api 1.3.20 → 1.3.22
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/node/index.mjs +10 -81
- package/dist/node/index.mjs.map +1 -1
- package/package.json +31 -31
- package/src/manifest/public/Chain.json +11 -82
package/dist/node/index.mjs
CHANGED
|
@@ -138,7 +138,7 @@ var Chain_default = {
|
|
|
138
138
|
{
|
|
139
139
|
config: {
|
|
140
140
|
accountPath: "1/1'/1'",
|
|
141
|
-
name: "
|
|
141
|
+
name: "Validated",
|
|
142
142
|
payloadSdkConfig: {
|
|
143
143
|
collection: "chain_validated"
|
|
144
144
|
},
|
|
@@ -149,8 +149,15 @@ var Chain_default = {
|
|
|
149
149
|
config: {
|
|
150
150
|
accountPath: "1/1'/2'",
|
|
151
151
|
schema: "network.xyo.diviner.chain.head.validation.config",
|
|
152
|
+
eventSubscriptions: [
|
|
153
|
+
{
|
|
154
|
+
sourceEvent: "inserted",
|
|
155
|
+
sourceModule: "Chain:Submissions",
|
|
156
|
+
targetModuleFunction: "divine"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
152
159
|
inArchivist: "Chain:Submissions",
|
|
153
|
-
outArchivist: "Chain:
|
|
160
|
+
outArchivist: "Chain:Validated",
|
|
154
161
|
name: "HeadValidationDiviner"
|
|
155
162
|
}
|
|
156
163
|
},
|
|
@@ -175,52 +182,13 @@ var Chain_default = {
|
|
|
175
182
|
}
|
|
176
183
|
]
|
|
177
184
|
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
config: {
|
|
181
|
-
accountPath: "1/1'/4'",
|
|
182
|
-
max: 2e4,
|
|
183
|
-
name: "Validated",
|
|
184
|
-
schema: "network.xyo.archivist.memory.config"
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
config: {
|
|
189
|
-
accountPath: "1/1'/5'",
|
|
190
|
-
schema: "network.xyo.diviner.archivist.sync.config",
|
|
191
|
-
inArchivist: "Chain:ValidatedMongo",
|
|
192
|
-
outArchivist: "Chain:Validated",
|
|
193
|
-
name: "ValidatedSyncDiviner"
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
config: {
|
|
198
|
-
accountPath: "1/1'/6'",
|
|
199
|
-
automations: [
|
|
200
|
-
{
|
|
201
|
-
frequency: 500,
|
|
202
|
-
frequencyUnits: "millis",
|
|
203
|
-
schema: "network.xyo.automation.interval",
|
|
204
|
-
type: "interval"
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
name: "ValidatedSyncSentinel",
|
|
208
|
-
schema: "network.xyo.sentinel.config",
|
|
209
|
-
synchronous: false,
|
|
210
|
-
tasks: [
|
|
211
|
-
{
|
|
212
|
-
mod: "ValidatedSyncDiviner",
|
|
213
|
-
endPoint: "divine"
|
|
214
|
-
}
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
185
|
}
|
|
218
186
|
],
|
|
219
187
|
public: [
|
|
220
188
|
{
|
|
221
189
|
config: {
|
|
222
190
|
accountPath: "1/1/1",
|
|
223
|
-
name: "
|
|
191
|
+
name: "Submissions",
|
|
224
192
|
payloadSdkConfig: {
|
|
225
193
|
collection: "chain_submissions"
|
|
226
194
|
},
|
|
@@ -247,45 +215,6 @@ var Chain_default = {
|
|
|
247
215
|
archivist: "Chain:Validated",
|
|
248
216
|
name: "AddressBalanceDiviner"
|
|
249
217
|
}
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
config: {
|
|
253
|
-
accountPath: "1/1/4'",
|
|
254
|
-
max: 2e4,
|
|
255
|
-
name: "Submissions",
|
|
256
|
-
schema: "network.xyo.archivist.memory.config"
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
config: {
|
|
261
|
-
accountPath: "1/1/5'",
|
|
262
|
-
schema: "network.xyo.diviner.archivist.sync.config",
|
|
263
|
-
inArchivist: "Chain:SubmissionsMongo",
|
|
264
|
-
outArchivist: "Chain:Submissions",
|
|
265
|
-
name: "SubmissionsSyncDiviner"
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
config: {
|
|
270
|
-
accountPath: "1/1/6'",
|
|
271
|
-
automations: [
|
|
272
|
-
{
|
|
273
|
-
frequency: 500,
|
|
274
|
-
frequencyUnits: "millis",
|
|
275
|
-
schema: "network.xyo.automation.interval",
|
|
276
|
-
type: "interval"
|
|
277
|
-
}
|
|
278
|
-
],
|
|
279
|
-
name: "SubmissionsSyncSentinel",
|
|
280
|
-
schema: "network.xyo.sentinel.config",
|
|
281
|
-
synchronous: false,
|
|
282
|
-
tasks: [
|
|
283
|
-
{
|
|
284
|
-
mod: "SubmissionsSyncDiviner",
|
|
285
|
-
endPoint: "divine"
|
|
286
|
-
}
|
|
287
|
-
]
|
|
288
|
-
}
|
|
289
218
|
}
|
|
290
219
|
]
|
|
291
220
|
}
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/app.ts","../../src/manifest/getLocator.ts","../../src/manifest/getNode.ts","../../src/manifest/node.json","../../src/manifest/nodeManifest.ts","../../src/manifest/private/index.ts","../../src/manifest/public/Chain.json","../../src/manifest/public/Pending.json","../../src/manifest/public/index.ts","../../src/server/instrumentation.ts","../../src/server/routes/address/addNodeRoutes.ts","../../src/server/routes/address/get/get.ts","../../src/server/routes/address/post/post.ts","../../src/server/routes/address/post/getQueryConfig.ts","../../src/server/routes/rpc/routes/addRpcRoutes.ts","../../src/server/routes/addRoutes.ts","../../src/server/server.ts"],"sourcesContent":["import {\n customPoweredByHeader,\n disableCaseSensitiveRouting,\n disableExpressDefaultPoweredByHeader,\n getJsonBodyParser,\n getJsonBodyParserOptions,\n responseProfiler,\n standardErrors,\n standardResponses,\n} from '@xylabs/express'\nimport type { MemoryNode } from '@xyo-network/node-memory'\nimport compression from 'compression'\nimport cors from 'cors'\nimport type { Express } from 'express'\nimport express from 'express'\n\nimport { getNode } from '../manifest/index.ts'\nimport { addInstrumentation } from './instrumentation.ts'\nimport { addRoutes } from './routes/index.ts'\n\nexport const getApp = async (node?: MemoryNode): Promise<Express> => {\n node = node ?? (await getNode())\n addInstrumentation()\n const app = express()\n app.set('etag', false)\n // eslint-disable-next-line sonarjs/cors\n app.use(cors())\n app.use(compression())\n app.use(responseProfiler)\n app.use(getJsonBodyParser(getJsonBodyParserOptions({ limit: '1mb' })))\n app.use(standardResponses)\n disableExpressDefaultPoweredByHeader(app)\n app.use(customPoweredByHeader)\n disableCaseSensitiveRouting(app)\n app.node = node\n addRoutes(app)\n app.use(standardErrors)\n return app\n}\n","import { assertEx } from '@xylabs/assert'\nimport { asAddress } from '@xylabs/hex'\nimport { MemoryArchivist } from '@xyo-network/archivist-memory'\nimport { MongoDBArchivistV2 } from '@xyo-network/archivist-mongodb'\nimport { ViewArchivist } from '@xyo-network/archivist-view'\nimport {\n AddressBalanceDiviner, ArchivistSyncDiviner, HeadValidationDiviner,\n} from '@xyo-network/chain-modules'\nimport { initTelemetry } from '@xyo-network/chain-telemetry'\nimport { PayloadPointerDiviner } from '@xyo-network/diviner-payload-pointer'\nimport {\n TemporalIndexingDiviner,\n TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner,\n TemporalIndexingDivinerIndexCandidateToIndexDiviner,\n TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner,\n TemporalIndexingDivinerStateToIndexCandidateDiviner,\n} from '@xyo-network/diviner-temporal-indexing'\nimport { hasMongoDBConfig } from '@xyo-network/module-abstract-mongodb'\nimport { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport { MemorySentinel } from '@xyo-network/sentinel-memory'\nimport { TimestampWitness } from '@xyo-network/witness-timestamp'\n\n/**\n * Used for retrieving a locator with the necessary modules registered for testing\n * operation of the node (entirely in memory)\n * @returns A locator with the necessary modules registered\n */\nexport const getLocator = async () => {\n const { traceProvider, meterProvider } = await initTelemetry({\n attributes: {\n serviceName: 'xl1-api',\n serviceVersion: '1.0.0',\n },\n metricsConfig: {\n endpoint: '/metrics',\n port: 9465,\n },\n })\n const locator = new ModuleFactoryLocator()\n // If there's a MongoDB configuration\n if (hasMongoDBConfig()) {\n // Register the MongoDB Archivist & Diviners as the defaults\n locator.register(MongoDBArchivistV2.factory(\n { traceProvider, meterProvider },\n ))\n }\n locator.register(AddressBalanceDiviner)\n locator.register(HeadValidationDiviner.factory({\n traceProvider,\n meterProvider,\n chainIdentification: {\n id: assertEx(\n asAddress(process.env.XYO_EVM_STAKING_CONTRACT_ADDRESS),\n () => 'XYO_EVM_STAKING_CONTRACT_ADDRESS is required and must be an Address',\n ),\n },\n }))\n locator.register(MemoryArchivist.factory({ traceProvider, meterProvider }))\n locator.register(MemorySentinel.factory({ traceProvider, meterProvider }))\n locator.register(PayloadPointerDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerIndexCandidateToIndexDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerStateToIndexCandidateDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TimestampWitness.factory({ traceProvider, meterProvider }))\n locator.register(ViewArchivist.factory({ traceProvider, meterProvider }))\n locator.register(ArchivistSyncDiviner.factory({ traceProvider, meterProvider }))\n return locator\n}\n","import { ManifestWrapper } from '@xyo-network/manifest-wrapper'\nimport type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport { HDWallet } from '@xyo-network/wallet'\n\nimport { getLocator } from './getLocator.ts'\nimport { NodeManifest } from './nodeManifest.ts'\nimport { PrivateChildManifests } from './private/index.ts'\nimport { PublicChildManifests } from './public/index.ts'\n\n/**\n * Creates a node with the xyo-chain modules registered\n * @param locator The locator to use for the node\n * @returns A node with the xyo-chain modules registered\n */\nexport const getNode = async (locator?: ModuleFactoryLocator) => {\n locator = locator ?? await getLocator()\n const mnemonic = process.env.MNEMONIC\n const wallet = await (mnemonic === undefined ? HDWallet.random() : HDWallet.fromPhrase(mnemonic))\n const wrapper = new ManifestWrapper(NodeManifest, wallet, locator, PublicChildManifests, PrivateChildManifests)\n const [node, ...childNodes] = await wrapper.loadNodes()\n if (childNodes?.length > 0) {\n await Promise.all(childNodes.map(childNode => node.register(childNode)))\n await Promise.all(childNodes.map(childNode => node.attach(childNode.address, true)))\n }\n console.log(await node.state())\n return node\n}\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"44'/60'/1\",\n \"name\": \"XYOChain\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": []\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}\n","import type { PackageManifestPayload } from '@xyo-network/manifest-model'\n\nimport node from './node.json' with { type: 'json' }\n\n/**\n * Root Node Manifest\n */\nexport const NodeManifest = node as PackageManifestPayload\n","/**\n * Private Child Manifests\n */\nexport const PrivateChildManifests = []\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"1\",\n \"name\": \"Chain\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [\n {\n \"config\": {\n \"accountPath\": \"1/1'/1'\",\n \"name\": \"ValidatedMongo\",\n \"payloadSdkConfig\": {\n \"collection\": \"chain_validated\"\n },\n \"schema\": \"network.xyo.archivist.mongodb.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/2'\",\n \"schema\": \"network.xyo.diviner.chain.head.validation.config\",\n \"inArchivist\": \"Chain:Submissions\",\n \"outArchivist\": \"Chain:ValidatedMongo\",\n \"name\": \"HeadValidationDiviner\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/3'\",\n \"automations\": [\n {\n \"frequency\": 500,\n \"frequencyUnits\": \"millis\",\n \"schema\": \"network.xyo.automation.interval\",\n \"type\": \"interval\"\n }\n ],\n \"name\": \"ChainValidationSentinel\",\n \"schema\": \"network.xyo.sentinel.config\",\n \"synchronous\": false,\n \"tasks\": [\n {\n \"mod\": \"HeadValidationDiviner\",\n \"endPoint\": \"divine\"\n }\n ]\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/4'\",\n \"max\": 20000,\n \"name\": \"Validated\",\n \"schema\": \"network.xyo.archivist.memory.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/5'\",\n \"schema\": \"network.xyo.diviner.archivist.sync.config\",\n \"inArchivist\": \"Chain:ValidatedMongo\",\n \"outArchivist\": \"Chain:Validated\",\n \"name\": \"ValidatedSyncDiviner\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/6'\",\n \"automations\": [\n {\n \"frequency\": 500,\n \"frequencyUnits\": \"millis\",\n \"schema\": \"network.xyo.automation.interval\",\n \"type\": \"interval\"\n }\n ],\n \"name\": \"ValidatedSyncSentinel\",\n \"schema\": \"network.xyo.sentinel.config\",\n \"synchronous\": false,\n \"tasks\": [\n {\n \"mod\": \"ValidatedSyncDiviner\",\n \"endPoint\": \"divine\"\n }\n ]\n }\n }\n ],\n \"public\": [\n {\n \"config\": {\n \"accountPath\": \"1/1/1\",\n \"name\": \"SubmissionsMongo\",\n \"payloadSdkConfig\": {\n \"collection\": \"chain_submissions\"\n },\n \"schema\": \"network.xyo.archivist.mongodb.config\",\n \"sourceArchivist\": \"inArchivist\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/2\",\n \"allowedQueries\": [\n \"network.xyo.query.archivist.get\",\n \"network.xyo.query.archivist.next\"\n ],\n \"originArchivist\": \"Chain:Validated\",\n \"name\": \"Finalized\",\n \"schema\": \"network.xyo.archivist.view.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/3\",\n \"schema\": \"network.xyo.diviner.chain.address.balance.config\",\n \"archivist\": \"Chain:Validated\",\n \"name\": \"AddressBalanceDiviner\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/4'\",\n \"max\": 20000,\n \"name\": \"Submissions\",\n \"schema\": \"network.xyo.archivist.memory.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/5'\",\n \"schema\": \"network.xyo.diviner.archivist.sync.config\",\n \"inArchivist\": \"Chain:SubmissionsMongo\",\n \"outArchivist\": \"Chain:Submissions\",\n \"name\": \"SubmissionsSyncDiviner\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/6'\",\n \"automations\": [\n {\n \"frequency\": 500,\n \"frequencyUnits\": \"millis\",\n \"schema\": \"network.xyo.automation.interval\",\n \"type\": \"interval\"\n }\n ],\n \"name\": \"SubmissionsSyncSentinel\",\n \"schema\": \"network.xyo.sentinel.config\",\n \"synchronous\": false,\n \"tasks\": [\n {\n \"mod\": \"SubmissionsSyncDiviner\",\n \"endPoint\": \"divine\"\n }\n ]\n }\n }\n ]\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"2\",\n \"name\": \"Pending\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [\n {\n \"config\": {\n \"accountPath\": \"2/1'/1'\",\n \"name\": \"TimestampWitness\",\n \"schema\": \"network.xyo.witness.timestamp.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"2/1'/3'\",\n \"archiving\": {\n \"archivists\": [\n \"Pending:PendingTransactions\"\n ]\n },\n \"automations\": [\n {\n \"frequency\": 1,\n \"frequencyUnits\": \"minute\",\n \"schema\": \"network.xyo.automation.interval\",\n \"type\": \"interval\"\n }\n ],\n \"name\": \"TimeTransactionSentinel\",\n \"schema\": \"network.xyo.sentinel.config\",\n \"synchronous\": false,\n \"tasks\": [\n {\n \"input\": true,\n \"mod\": \"TimestampWitness\"\n },\n {\n \"input\": [\n \"TimestampWitness\"\n ],\n \"mod\": \"AdHocChainTransactionWitness\"\n }\n ]\n }\n }\n ],\n \"public\": [\n {\n \"config\": {\n \"accountPath\": \"2/1/1\",\n \"labels\": {\n \"network.xyo.storage.class\": \"mongodb\"\n },\n \"language\": \"javascript\",\n \"name\": \"PendingTransactions\",\n \"payloadSdkConfig\": {\n \"collection\": \"pending\"\n },\n \"schema\": \"network.xyo.archivist.config\"\n }\n }\n ]\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}","import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/manifest-model'\n\nimport Chain from './Chain.json' with { type: 'json' }\nimport Pending from './Pending.json' with { type: 'json' }\n\n/**\n * Chain Node Manifest\n */\nexport const ChainNodeManifest = Chain as PackageManifestPayload\n/**\n * Pending Node Manifest\n */\nexport const PendingNodeManifest = Pending as PackageManifestPayload\n/**\n * Public Child Manifests\n */\nexport const PublicChildManifests: ModuleManifest[] = [\n ...ChainNodeManifest.nodes,\n ...PendingNodeManifest.nodes,\n]\n","import { registerInstrumentations } from '@opentelemetry/instrumentation'\nimport { ExpressInstrumentation } from '@opentelemetry/instrumentation-express'\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http'\n\n/**\n * Registers OpenTelemetry instrumentations for HTTP and Express.\n * This function is used to set up the necessary instrumentations for monitoring\n * HTTP requests and Express applications. Since it monkey patches the Express\n * router & middleware system, it should be called before any Express applications\n * are defined.\n *\n * @returns {void}\n */\nexport const addInstrumentation = () => {\n const instrumentations = [new HttpInstrumentation(), new ExpressInstrumentation()]\n registerInstrumentations({ instrumentations })\n}\n","import type { Express } from 'express'\nimport { StatusCodes } from 'http-status-codes'\n\nimport { getAddress } from './get/index.ts'\nimport { postAddress } from './post/index.ts'\n\nexport const addNodeRoutes = (app: Express) => {\n const defaultModule = app.node\n const address = defaultModule.address\n const defaultModuleEndpoint = `/${address}`\n app.get('/', (_req, res) => res.redirect(StatusCodes.MOVED_TEMPORARILY, defaultModuleEndpoint))\n app.post('/', (_req, res) => res.redirect(StatusCodes.TEMPORARY_REDIRECT, defaultModuleEndpoint))\n app.get('/:address', getAddress)\n app.post('/:address', postAddress)\n app.get('/:hash', (_req, res) => {\n res.sendStatus(StatusCodes.NOT_FOUND)\n })\n app.post('/:hash', (_req, res) => {\n res.sendStatus(StatusCodes.NOT_FOUND)\n })\n}\n","import { assertEx } from '@xylabs/assert'\nimport { asyncHandler } from '@xylabs/express'\nimport { asAddress } from '@xylabs/hex'\nimport { isModuleIdentifierPart } from '@xyo-network/module-model'\nimport { trimAddressPrefix } from '@xyo-network/node-core-lib'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { RequestHandler } from 'express'\nimport { StatusCodes } from 'http-status-codes'\n\nimport type { AddressPathParams } from '../AddressPathParams.ts'\n\nconst handler: RequestHandler<AddressPathParams, Payload[]> = async (req, res, next) => {\n const { address: rawAddress } = req.params\n const { node } = req.app\n const address = asAddress(rawAddress)\n if (address !== undefined) {\n let mod = node.address === address ? node : (await node.resolve(address, { direction: 'down' }))\n if (mod) {\n res.json(await mod.state())\n return\n }\n }\n if (isModuleIdentifierPart(rawAddress)) {\n const moduleIdentifier = trimAddressPrefix(rawAddress)\n const mod = await node.resolve(moduleIdentifier, { direction: 'down' })\n if (mod) {\n const moduleAddress = assertEx(mod?.address, () => 'Error redirecting to module by address')\n res.redirect(StatusCodes.MOVED_TEMPORARILY, `/${moduleAddress}`)\n return\n }\n }\n next('route')\n}\nexport const getAddress = asyncHandler(handler)\n","import { assertEx } from '@xylabs/assert'\nimport { asyncHandler } from '@xylabs/express'\nimport {\n type Address, asAddress, isAddress,\n} from '@xylabs/hex'\nimport type { JsonObject } from '@xylabs/object'\nimport { isQueryBoundWitness, type QueryBoundWitness } from '@xyo-network/boundwitness-model'\nimport { ModuleErrorBuilder } from '@xyo-network/module-abstract'\nimport type { Module, ModuleQueryResult } from '@xyo-network/module-model'\nimport { trimAddressPrefix } from '@xyo-network/node-core-lib'\nimport type { ModuleError, Payload } from '@xyo-network/payload-model'\nimport type { RequestHandler } from 'express'\nimport { StatusCodes } from 'http-status-codes'\n\nimport type { AddressPathParams } from '../AddressPathParams.ts'\nimport { getQueryConfig } from './getQueryConfig.ts'\n\ntype PostAddressRequestBody = [QueryBoundWitness, undefined | Payload[]]\n\nconst handler: RequestHandler<AddressPathParams, ModuleQueryResult | ModuleError, PostAddressRequestBody> = async (req, res, next) => {\n const returnError = (code: number, message = 'An error occurred', details?: JsonObject) => {\n const error = new ModuleErrorBuilder().message(message).details(details).build()\n res.locals.rawResponse = false\n res.status(code).json(error)\n next()\n }\n\n const { address } = req.params\n const { node } = req.app\n const [bw, payloads] = Array.isArray(req.body) ? req.body : []\n if (!isAddress(address)) {\n return returnError(StatusCodes.BAD_REQUEST, 'Missing address')\n }\n\n if (!bw) {\n return returnError(StatusCodes.BAD_REQUEST, 'Missing boundwitness')\n }\n\n if (!isQueryBoundWitness(bw)) {\n return returnError(StatusCodes.BAD_REQUEST, 'Invalid query boundwitness')\n }\n\n let modules: Module[] = []\n const normalizedAddress = trimAddressPrefix(address) as Address\n if (node.address === normalizedAddress) modules = [node]\n else {\n const typedAddress = asAddress(address)\n const byAddress = (typedAddress === undefined) ? undefined : await node.resolve(typedAddress, { maxDepth: 10 })\n\n if (byAddress) modules = [byAddress]\n else {\n const byName = await node.resolve(address, { direction: 'down' })\n if (byName) {\n const moduleAddress = assertEx(byName?.address, () => 'Error redirecting to module by address')\n res.redirect(StatusCodes.TEMPORARY_REDIRECT, `/${moduleAddress}`)\n return\n } else {\n return returnError(StatusCodes.NOT_FOUND, 'Module not found', { address })\n }\n }\n }\n\n if (modules.length > 0) {\n const mod = modules[0]\n const queryConfig = await getQueryConfig(mod, req, bw, payloads)\n try {\n const queryResult = await mod.query(bw, payloads, queryConfig)\n res.json(queryResult)\n } catch (ex) {\n return returnError(StatusCodes.INTERNAL_SERVER_ERROR, 'Query Failed', { message: (ex as Error)?.message ?? 'Unknown Error' })\n }\n } else {\n return returnError(StatusCodes.NOT_FOUND, 'Module not found', { address })\n }\n}\n\nexport const postAddress = asyncHandler(handler)\n","import { isString } from '@xylabs/typeof'\nimport type { BoundWitness, QueryBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { AbstractModule } from '@xyo-network/module-abstract'\nimport type { Module, ModuleConfig } from '@xyo-network/module-model'\nimport { ModuleConfigSchema } from '@xyo-network/module-model'\nimport type { ArchiveModuleConfig } from '@xyo-network/node-core-model'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { Request } from 'express'\n\nconst DEFAULT_DEPTH = 5 as const\n\nexport const getQueryConfig = async (mod: Module, req: Request, bw: QueryBoundWitness, payloads?: Payload[]): Promise<ModuleConfig | undefined> => {\n const archivist = mod as unknown as AbstractModule\n const config = archivist?.config as unknown as ArchiveModuleConfig\n const archive = config?.archive\n // TODO: Filter based on query addresses?\n const requestCanAccessArchive = await Promise.resolve(true)\n if (isString(archive) && requestCanAccessArchive) {\n // Recurse through payloads for nested BWs\n const nestedBwAddresses\n = payloads\n ?.flat(DEFAULT_DEPTH)\n .filter<BoundWitness>((payload): payload is BoundWitness => payload?.schema === BoundWitnessSchema)\n .map(bw => bw.addresses) || []\n // TODO: Do we want to end up with a list of addresses or a list of address lists?\n const addresses = [bw.addresses, ...nestedBwAddresses].filter(address => address.length > 0)\n const allowed = addresses.length > 0 ? Object.fromEntries(archivist.queries.map(schema => [schema, addresses])) : {}\n const security = { allowed }\n return { schema: ModuleConfigSchema, security }\n }\n}\n","import { setRawResponseFormat } from '@xylabs/express'\nimport { NodeXyoViewer } from '@xyo-network/chain-rpc'\nimport {\n MemoryXyoProvider, NodeXyoRunner, rpcEngineFromProvider,\n} from '@xyo-network/xl1-rpc'\nimport type { Express } from 'express'\n\nexport const addRpcRoutes = (app: Express) => {\n const { node } = app\n const runner = new NodeXyoRunner(node)\n const viewer = new NodeXyoViewer(node)\n const provider = new MemoryXyoProvider({ runner, viewer })\n const engine = rpcEngineFromProvider(provider)\n\n app.post('/rpc', (req, res) => {\n setRawResponseFormat(res)\n engine.handle(req.body, (_, rpcResponse) => {\n res.json(rpcResponse)\n })\n })\n}\n","import type { Express } from 'express'\n\nimport { addNodeRoutes } from './address/index.ts'\nimport { addRpcRoutes } from './rpc/index.ts'\n\nexport const addRoutes = (app: Express) => {\n addRpcRoutes(app)\n addNodeRoutes(app)\n}\n","import { tryParseInt } from '@xylabs/express'\nimport type { MemoryNode } from '@xyo-network/node-memory'\n\nimport { getApp } from './app.ts'\n\nconst hostname = '::'\n// const hostname = '0.0.0.0'\n\nexport const getServer = async (port?: number, node?: MemoryNode) => {\n const appPort = port ?? tryParseInt(process.env.APP_PORT) ?? 80\n const app = await getApp(node)\n const server = app.listen(appPort, hostname, () => console.log(`Server listening at http://${hostname}:${appPort}`))\n server.setTimeout(20_000)\n return server\n}\n"],"mappings":";;;;AAAA,SACEA,uBACAC,6BACAC,sCACAC,mBACAC,0BACAC,kBACAC,gBACAC,yBACK;AAEP,OAAOC,iBAAiB;AACxB,OAAOC,UAAU;AAEjB,OAAOC,aAAa;;;ACdpB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAChC,SAASC,0BAA0B;AACnC,SAASC,qBAAqB;AAC9B,SACEC,uBAAuBC,sBAAsBC,6BACxC;AACP,SAASC,qBAAqB;AAC9B,SAASC,6BAA6B;AACtC,SACEC,yBACAC,wDACAC,qDACAC,wEACAC,2DACK;AACP,SAASC,wBAAwB;AACjC,SAASC,4BAA4B;AACrC,SAASC,sBAAsB;AAC/B,SAASC,wBAAwB;AAO1B,IAAMC,aA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AAIM,KAAKD,WAAAA;IACX,CAAA;EACF,CAAA;AACF,GAb4B;;;ACFrB,IAAME,YAAY,wBAACC,QAAAA;AACxBC,eAAaD,GAAAA;AACbE,gBAAcF,GAAAA;AAChB,GAHyB;;;AfelB,IAAMG,SAAS,8BAAOC,SAAAA;AAC3BA,SAAOA,QAAS,MAAMC,QAAAA;AACtBC,qBAAAA;AACA,QAAMC,MAAMC,QAAAA;AACZD,MAAIE,IAAI,QAAQ,KAAA;AAEhBF,MAAIG,IAAIC,KAAAA,CAAAA;AACRJ,MAAIG,IAAIE,YAAAA,CAAAA;AACRL,MAAIG,IAAIG,gBAAAA;AACRN,MAAIG,IAAII,kBAAkBC,yBAAyB;IAAEC,OAAO;EAAM,CAAA,CAAA,CAAA;AAClET,MAAIG,IAAIO,iBAAAA;AACRC,uCAAqCX,GAAAA;AACrCA,MAAIG,IAAIS,qBAAAA;AACRC,8BAA4Bb,GAAAA;AAC5BA,MAAIH,OAAOA;AACXiB,YAAUd,GAAAA;AACVA,MAAIG,IAAIY,cAAAA;AACR,SAAOf;AACT,GAlBsB;;;AgBpBtB,SAASgB,mBAAmB;AAK5B,IAAMC,WAAW;AAGV,IAAMC,YAAY,8BAAOC,MAAeC,SAAAA;AAC7C,QAAMC,UAAUF,QAAQG,YAAYC,QAAQC,IAAIC,QAAQ,KAAK;AAC7D,QAAMC,MAAM,MAAMC,OAAOP,IAAAA;AACzB,QAAMQ,SAASF,IAAIG,OAAOR,SAASJ,UAAU,MAAMa,QAAQC,IAAI,8BAA8Bd,QAAAA,IAAYI,OAAAA,EAAS,CAAA;AAClHO,SAAOI,WAAW,GAAA;AAClB,SAAOJ;AACT,GANyB;","names":["customPoweredByHeader","disableCaseSensitiveRouting","disableExpressDefaultPoweredByHeader","getJsonBodyParser","getJsonBodyParserOptions","responseProfiler","standardErrors","standardResponses","compression","cors","express","assertEx","asAddress","MemoryArchivist","MongoDBArchivistV2","ViewArchivist","AddressBalanceDiviner","ArchivistSyncDiviner","HeadValidationDiviner","initTelemetry","PayloadPointerDiviner","TemporalIndexingDiviner","TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner","TemporalIndexingDivinerIndexCandidateToIndexDiviner","TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner","TemporalIndexingDivinerStateToIndexCandidateDiviner","hasMongoDBConfig","ModuleFactoryLocator","MemorySentinel","TimestampWitness","getLocator","traceProvider","meterProvider","initTelemetry","attributes","serviceName","serviceVersion","metricsConfig","endpoint","port","locator","ModuleFactoryLocator","hasMongoDBConfig","register","MongoDBArchivistV2","factory","AddressBalanceDiviner","HeadValidationDiviner","chainIdentification","id","assertEx","asAddress","process","env","XYO_EVM_STAKING_CONTRACT_ADDRESS","MemoryArchivist","MemorySentinel","PayloadPointerDiviner","TemporalIndexingDiviner","TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner","TemporalIndexingDivinerIndexCandidateToIndexDiviner","TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner","TemporalIndexingDivinerStateToIndexCandidateDiviner","TimestampWitness","ViewArchivist","ArchivistSyncDiviner","ManifestWrapper","HDWallet","NodeManifest","node","PrivateChildManifests","ChainNodeManifest","Chain","PendingNodeManifest","Pending","PublicChildManifests","nodes","getNode","locator","getLocator","mnemonic","process","env","MNEMONIC","wallet","undefined","HDWallet","random","fromPhrase","wrapper","ManifestWrapper","NodeManifest","PublicChildManifests","PrivateChildManifests","node","childNodes","loadNodes","length","Promise","all","map","childNode","register","attach","address","console","log","state","registerInstrumentations","ExpressInstrumentation","HttpInstrumentation","addInstrumentation","instrumentations","HttpInstrumentation","ExpressInstrumentation","registerInstrumentations","StatusCodes","assertEx","asyncHandler","asAddress","isModuleIdentifierPart","trimAddressPrefix","StatusCodes","handler","req","res","next","address","rawAddress","params","node","app","asAddress","undefined","mod","resolve","direction","json","state","isModuleIdentifierPart","moduleIdentifier","trimAddressPrefix","moduleAddress","assertEx","redirect","StatusCodes","MOVED_TEMPORARILY","getAddress","asyncHandler","assertEx","asyncHandler","asAddress","isAddress","isQueryBoundWitness","ModuleErrorBuilder","trimAddressPrefix","StatusCodes","isString","BoundWitnessSchema","ModuleConfigSchema","DEFAULT_DEPTH","getQueryConfig","mod","req","bw","payloads","archivist","config","archive","requestCanAccessArchive","Promise","resolve","isString","nestedBwAddresses","flat","filter","payload","schema","BoundWitnessSchema","map","addresses","address","length","allowed","Object","fromEntries","queries","security","ModuleConfigSchema","handler","req","res","next","returnError","code","message","details","error","ModuleErrorBuilder","build","locals","rawResponse","status","json","address","params","node","app","bw","payloads","Array","isArray","body","isAddress","StatusCodes","BAD_REQUEST","isQueryBoundWitness","modules","normalizedAddress","trimAddressPrefix","typedAddress","asAddress","byAddress","undefined","resolve","maxDepth","byName","direction","moduleAddress","assertEx","redirect","TEMPORARY_REDIRECT","NOT_FOUND","length","mod","queryConfig","getQueryConfig","queryResult","query","ex","INTERNAL_SERVER_ERROR","postAddress","asyncHandler","addNodeRoutes","app","defaultModule","node","address","defaultModuleEndpoint","get","_req","res","redirect","StatusCodes","MOVED_TEMPORARILY","post","TEMPORARY_REDIRECT","getAddress","postAddress","sendStatus","NOT_FOUND","setRawResponseFormat","NodeXyoViewer","MemoryXyoProvider","NodeXyoRunner","rpcEngineFromProvider","addRpcRoutes","app","node","runner","NodeXyoRunner","viewer","NodeXyoViewer","provider","MemoryXyoProvider","engine","rpcEngineFromProvider","post","req","res","setRawResponseFormat","handle","body","_","rpcResponse","json","addRoutes","app","addRpcRoutes","addNodeRoutes","getApp","node","getNode","addInstrumentation","app","express","set","use","cors","compression","responseProfiler","getJsonBodyParser","getJsonBodyParserOptions","limit","standardResponses","disableExpressDefaultPoweredByHeader","customPoweredByHeader","disableCaseSensitiveRouting","addRoutes","standardErrors","tryParseInt","hostname","getServer","port","node","appPort","tryParseInt","process","env","APP_PORT","app","getApp","server","listen","console","log","setTimeout"]}
|
|
1
|
+
{"version":3,"sources":["../../src/server/app.ts","../../src/manifest/getLocator.ts","../../src/manifest/getNode.ts","../../src/manifest/node.json","../../src/manifest/nodeManifest.ts","../../src/manifest/private/index.ts","../../src/manifest/public/Chain.json","../../src/manifest/public/Pending.json","../../src/manifest/public/index.ts","../../src/server/instrumentation.ts","../../src/server/routes/address/addNodeRoutes.ts","../../src/server/routes/address/get/get.ts","../../src/server/routes/address/post/post.ts","../../src/server/routes/address/post/getQueryConfig.ts","../../src/server/routes/rpc/routes/addRpcRoutes.ts","../../src/server/routes/addRoutes.ts","../../src/server/server.ts"],"sourcesContent":["import {\n customPoweredByHeader,\n disableCaseSensitiveRouting,\n disableExpressDefaultPoweredByHeader,\n getJsonBodyParser,\n getJsonBodyParserOptions,\n responseProfiler,\n standardErrors,\n standardResponses,\n} from '@xylabs/express'\nimport type { MemoryNode } from '@xyo-network/node-memory'\nimport compression from 'compression'\nimport cors from 'cors'\nimport type { Express } from 'express'\nimport express from 'express'\n\nimport { getNode } from '../manifest/index.ts'\nimport { addInstrumentation } from './instrumentation.ts'\nimport { addRoutes } from './routes/index.ts'\n\nexport const getApp = async (node?: MemoryNode): Promise<Express> => {\n node = node ?? (await getNode())\n addInstrumentation()\n const app = express()\n app.set('etag', false)\n // eslint-disable-next-line sonarjs/cors\n app.use(cors())\n app.use(compression())\n app.use(responseProfiler)\n app.use(getJsonBodyParser(getJsonBodyParserOptions({ limit: '1mb' })))\n app.use(standardResponses)\n disableExpressDefaultPoweredByHeader(app)\n app.use(customPoweredByHeader)\n disableCaseSensitiveRouting(app)\n app.node = node\n addRoutes(app)\n app.use(standardErrors)\n return app\n}\n","import { assertEx } from '@xylabs/assert'\nimport { asAddress } from '@xylabs/hex'\nimport { MemoryArchivist } from '@xyo-network/archivist-memory'\nimport { MongoDBArchivistV2 } from '@xyo-network/archivist-mongodb'\nimport { ViewArchivist } from '@xyo-network/archivist-view'\nimport {\n AddressBalanceDiviner, ArchivistSyncDiviner, HeadValidationDiviner,\n} from '@xyo-network/chain-modules'\nimport { initTelemetry } from '@xyo-network/chain-telemetry'\nimport { PayloadPointerDiviner } from '@xyo-network/diviner-payload-pointer'\nimport {\n TemporalIndexingDiviner,\n TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner,\n TemporalIndexingDivinerIndexCandidateToIndexDiviner,\n TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner,\n TemporalIndexingDivinerStateToIndexCandidateDiviner,\n} from '@xyo-network/diviner-temporal-indexing'\nimport { hasMongoDBConfig } from '@xyo-network/module-abstract-mongodb'\nimport { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport { MemorySentinel } from '@xyo-network/sentinel-memory'\nimport { TimestampWitness } from '@xyo-network/witness-timestamp'\n\n/**\n * Used for retrieving a locator with the necessary modules registered for testing\n * operation of the node (entirely in memory)\n * @returns A locator with the necessary modules registered\n */\nexport const getLocator = async () => {\n const { traceProvider, meterProvider } = await initTelemetry({\n attributes: {\n serviceName: 'xl1-api',\n serviceVersion: '1.0.0',\n },\n metricsConfig: {\n endpoint: '/metrics',\n port: 9465,\n },\n })\n const locator = new ModuleFactoryLocator()\n // If there's a MongoDB configuration\n if (hasMongoDBConfig()) {\n // Register the MongoDB Archivist & Diviners as the defaults\n locator.register(MongoDBArchivistV2.factory(\n { traceProvider, meterProvider },\n ))\n }\n locator.register(AddressBalanceDiviner)\n locator.register(HeadValidationDiviner.factory({\n traceProvider,\n meterProvider,\n chainIdentification: {\n id: assertEx(\n asAddress(process.env.XYO_EVM_STAKING_CONTRACT_ADDRESS),\n () => 'XYO_EVM_STAKING_CONTRACT_ADDRESS is required and must be an Address',\n ),\n },\n }))\n locator.register(MemoryArchivist.factory({ traceProvider, meterProvider }))\n locator.register(MemorySentinel.factory({ traceProvider, meterProvider }))\n locator.register(PayloadPointerDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerIndexCandidateToIndexDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TemporalIndexingDivinerStateToIndexCandidateDiviner.factory({ traceProvider, meterProvider }))\n locator.register(TimestampWitness.factory({ traceProvider, meterProvider }))\n locator.register(ViewArchivist.factory({ traceProvider, meterProvider }))\n locator.register(ArchivistSyncDiviner.factory({ traceProvider, meterProvider }))\n return locator\n}\n","import { ManifestWrapper } from '@xyo-network/manifest-wrapper'\nimport type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport { HDWallet } from '@xyo-network/wallet'\n\nimport { getLocator } from './getLocator.ts'\nimport { NodeManifest } from './nodeManifest.ts'\nimport { PrivateChildManifests } from './private/index.ts'\nimport { PublicChildManifests } from './public/index.ts'\n\n/**\n * Creates a node with the xyo-chain modules registered\n * @param locator The locator to use for the node\n * @returns A node with the xyo-chain modules registered\n */\nexport const getNode = async (locator?: ModuleFactoryLocator) => {\n locator = locator ?? await getLocator()\n const mnemonic = process.env.MNEMONIC\n const wallet = await (mnemonic === undefined ? HDWallet.random() : HDWallet.fromPhrase(mnemonic))\n const wrapper = new ManifestWrapper(NodeManifest, wallet, locator, PublicChildManifests, PrivateChildManifests)\n const [node, ...childNodes] = await wrapper.loadNodes()\n if (childNodes?.length > 0) {\n await Promise.all(childNodes.map(childNode => node.register(childNode)))\n await Promise.all(childNodes.map(childNode => node.attach(childNode.address, true)))\n }\n console.log(await node.state())\n return node\n}\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"44'/60'/1\",\n \"name\": \"XYOChain\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": []\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}\n","import type { PackageManifestPayload } from '@xyo-network/manifest-model'\n\nimport node from './node.json' with { type: 'json' }\n\n/**\n * Root Node Manifest\n */\nexport const NodeManifest = node as PackageManifestPayload\n","/**\n * Private Child Manifests\n */\nexport const PrivateChildManifests = []\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"1\",\n \"name\": \"Chain\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [\n {\n \"config\": {\n \"accountPath\": \"1/1'/1'\",\n \"name\": \"Validated\",\n \"payloadSdkConfig\": {\n \"collection\": \"chain_validated\"\n },\n \"schema\": \"network.xyo.archivist.mongodb.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/2'\",\n \"schema\": \"network.xyo.diviner.chain.head.validation.config\",\n \"eventSubscriptions\": [\n {\n \"sourceEvent\": \"inserted\",\n \"sourceModule\": \"Chain:Submissions\",\n \"targetModuleFunction\": \"divine\"\n }\n ],\n \"inArchivist\": \"Chain:Submissions\",\n \"outArchivist\": \"Chain:Validated\",\n \"name\": \"HeadValidationDiviner\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1'/3'\",\n \"automations\": [\n {\n \"frequency\": 500,\n \"frequencyUnits\": \"millis\",\n \"schema\": \"network.xyo.automation.interval\",\n \"type\": \"interval\"\n }\n ],\n \"name\": \"ChainValidationSentinel\",\n \"schema\": \"network.xyo.sentinel.config\",\n \"synchronous\": false,\n \"tasks\": [\n {\n \"mod\": \"HeadValidationDiviner\",\n \"endPoint\": \"divine\"\n }\n ]\n }\n }\n ],\n \"public\": [\n {\n \"config\": {\n \"accountPath\": \"1/1/1\",\n \"name\": \"Submissions\",\n \"payloadSdkConfig\": {\n \"collection\": \"chain_submissions\"\n },\n \"schema\": \"network.xyo.archivist.mongodb.config\",\n \"sourceArchivist\": \"inArchivist\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/2\",\n \"allowedQueries\": [\n \"network.xyo.query.archivist.get\",\n \"network.xyo.query.archivist.next\"\n ],\n \"originArchivist\": \"Chain:Validated\",\n \"name\": \"Finalized\",\n \"schema\": \"network.xyo.archivist.view.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"1/1/3\",\n \"schema\": \"network.xyo.diviner.chain.address.balance.config\",\n \"archivist\": \"Chain:Validated\",\n \"name\": \"AddressBalanceDiviner\"\n }\n }\n ]\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"2\",\n \"name\": \"Pending\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [\n {\n \"config\": {\n \"accountPath\": \"2/1'/1'\",\n \"name\": \"TimestampWitness\",\n \"schema\": \"network.xyo.witness.timestamp.config\"\n }\n },\n {\n \"config\": {\n \"accountPath\": \"2/1'/3'\",\n \"archiving\": {\n \"archivists\": [\n \"Pending:PendingTransactions\"\n ]\n },\n \"automations\": [\n {\n \"frequency\": 1,\n \"frequencyUnits\": \"minute\",\n \"schema\": \"network.xyo.automation.interval\",\n \"type\": \"interval\"\n }\n ],\n \"name\": \"TimeTransactionSentinel\",\n \"schema\": \"network.xyo.sentinel.config\",\n \"synchronous\": false,\n \"tasks\": [\n {\n \"input\": true,\n \"mod\": \"TimestampWitness\"\n },\n {\n \"input\": [\n \"TimestampWitness\"\n ],\n \"mod\": \"AdHocChainTransactionWitness\"\n }\n ]\n }\n }\n ],\n \"public\": [\n {\n \"config\": {\n \"accountPath\": \"2/1/1\",\n \"labels\": {\n \"network.xyo.storage.class\": \"mongodb\"\n },\n \"language\": \"javascript\",\n \"name\": \"PendingTransactions\",\n \"payloadSdkConfig\": {\n \"collection\": \"pending\"\n },\n \"schema\": \"network.xyo.archivist.config\"\n }\n }\n ]\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}","import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/manifest-model'\n\nimport Chain from './Chain.json' with { type: 'json' }\nimport Pending from './Pending.json' with { type: 'json' }\n\n/**\n * Chain Node Manifest\n */\nexport const ChainNodeManifest = Chain as PackageManifestPayload\n/**\n * Pending Node Manifest\n */\nexport const PendingNodeManifest = Pending as PackageManifestPayload\n/**\n * Public Child Manifests\n */\nexport const PublicChildManifests: ModuleManifest[] = [\n ...ChainNodeManifest.nodes,\n ...PendingNodeManifest.nodes,\n]\n","import { registerInstrumentations } from '@opentelemetry/instrumentation'\nimport { ExpressInstrumentation } from '@opentelemetry/instrumentation-express'\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http'\n\n/**\n * Registers OpenTelemetry instrumentations for HTTP and Express.\n * This function is used to set up the necessary instrumentations for monitoring\n * HTTP requests and Express applications. Since it monkey patches the Express\n * router & middleware system, it should be called before any Express applications\n * are defined.\n *\n * @returns {void}\n */\nexport const addInstrumentation = () => {\n const instrumentations = [new HttpInstrumentation(), new ExpressInstrumentation()]\n registerInstrumentations({ instrumentations })\n}\n","import type { Express } from 'express'\nimport { StatusCodes } from 'http-status-codes'\n\nimport { getAddress } from './get/index.ts'\nimport { postAddress } from './post/index.ts'\n\nexport const addNodeRoutes = (app: Express) => {\n const defaultModule = app.node\n const address = defaultModule.address\n const defaultModuleEndpoint = `/${address}`\n app.get('/', (_req, res) => res.redirect(StatusCodes.MOVED_TEMPORARILY, defaultModuleEndpoint))\n app.post('/', (_req, res) => res.redirect(StatusCodes.TEMPORARY_REDIRECT, defaultModuleEndpoint))\n app.get('/:address', getAddress)\n app.post('/:address', postAddress)\n app.get('/:hash', (_req, res) => {\n res.sendStatus(StatusCodes.NOT_FOUND)\n })\n app.post('/:hash', (_req, res) => {\n res.sendStatus(StatusCodes.NOT_FOUND)\n })\n}\n","import { assertEx } from '@xylabs/assert'\nimport { asyncHandler } from '@xylabs/express'\nimport { asAddress } from '@xylabs/hex'\nimport { isModuleIdentifierPart } from '@xyo-network/module-model'\nimport { trimAddressPrefix } from '@xyo-network/node-core-lib'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { RequestHandler } from 'express'\nimport { StatusCodes } from 'http-status-codes'\n\nimport type { AddressPathParams } from '../AddressPathParams.ts'\n\nconst handler: RequestHandler<AddressPathParams, Payload[]> = async (req, res, next) => {\n const { address: rawAddress } = req.params\n const { node } = req.app\n const address = asAddress(rawAddress)\n if (address !== undefined) {\n let mod = node.address === address ? node : (await node.resolve(address, { direction: 'down' }))\n if (mod) {\n res.json(await mod.state())\n return\n }\n }\n if (isModuleIdentifierPart(rawAddress)) {\n const moduleIdentifier = trimAddressPrefix(rawAddress)\n const mod = await node.resolve(moduleIdentifier, { direction: 'down' })\n if (mod) {\n const moduleAddress = assertEx(mod?.address, () => 'Error redirecting to module by address')\n res.redirect(StatusCodes.MOVED_TEMPORARILY, `/${moduleAddress}`)\n return\n }\n }\n next('route')\n}\nexport const getAddress = asyncHandler(handler)\n","import { assertEx } from '@xylabs/assert'\nimport { asyncHandler } from '@xylabs/express'\nimport {\n type Address, asAddress, isAddress,\n} from '@xylabs/hex'\nimport type { JsonObject } from '@xylabs/object'\nimport { isQueryBoundWitness, type QueryBoundWitness } from '@xyo-network/boundwitness-model'\nimport { ModuleErrorBuilder } from '@xyo-network/module-abstract'\nimport type { Module, ModuleQueryResult } from '@xyo-network/module-model'\nimport { trimAddressPrefix } from '@xyo-network/node-core-lib'\nimport type { ModuleError, Payload } from '@xyo-network/payload-model'\nimport type { RequestHandler } from 'express'\nimport { StatusCodes } from 'http-status-codes'\n\nimport type { AddressPathParams } from '../AddressPathParams.ts'\nimport { getQueryConfig } from './getQueryConfig.ts'\n\ntype PostAddressRequestBody = [QueryBoundWitness, undefined | Payload[]]\n\nconst handler: RequestHandler<AddressPathParams, ModuleQueryResult | ModuleError, PostAddressRequestBody> = async (req, res, next) => {\n const returnError = (code: number, message = 'An error occurred', details?: JsonObject) => {\n const error = new ModuleErrorBuilder().message(message).details(details).build()\n res.locals.rawResponse = false\n res.status(code).json(error)\n next()\n }\n\n const { address } = req.params\n const { node } = req.app\n const [bw, payloads] = Array.isArray(req.body) ? req.body : []\n if (!isAddress(address)) {\n return returnError(StatusCodes.BAD_REQUEST, 'Missing address')\n }\n\n if (!bw) {\n return returnError(StatusCodes.BAD_REQUEST, 'Missing boundwitness')\n }\n\n if (!isQueryBoundWitness(bw)) {\n return returnError(StatusCodes.BAD_REQUEST, 'Invalid query boundwitness')\n }\n\n let modules: Module[] = []\n const normalizedAddress = trimAddressPrefix(address) as Address\n if (node.address === normalizedAddress) modules = [node]\n else {\n const typedAddress = asAddress(address)\n const byAddress = (typedAddress === undefined) ? undefined : await node.resolve(typedAddress, { maxDepth: 10 })\n\n if (byAddress) modules = [byAddress]\n else {\n const byName = await node.resolve(address, { direction: 'down' })\n if (byName) {\n const moduleAddress = assertEx(byName?.address, () => 'Error redirecting to module by address')\n res.redirect(StatusCodes.TEMPORARY_REDIRECT, `/${moduleAddress}`)\n return\n } else {\n return returnError(StatusCodes.NOT_FOUND, 'Module not found', { address })\n }\n }\n }\n\n if (modules.length > 0) {\n const mod = modules[0]\n const queryConfig = await getQueryConfig(mod, req, bw, payloads)\n try {\n const queryResult = await mod.query(bw, payloads, queryConfig)\n res.json(queryResult)\n } catch (ex) {\n return returnError(StatusCodes.INTERNAL_SERVER_ERROR, 'Query Failed', { message: (ex as Error)?.message ?? 'Unknown Error' })\n }\n } else {\n return returnError(StatusCodes.NOT_FOUND, 'Module not found', { address })\n }\n}\n\nexport const postAddress = asyncHandler(handler)\n","import { isString } from '@xylabs/typeof'\nimport type { BoundWitness, QueryBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { AbstractModule } from '@xyo-network/module-abstract'\nimport type { Module, ModuleConfig } from '@xyo-network/module-model'\nimport { ModuleConfigSchema } from '@xyo-network/module-model'\nimport type { ArchiveModuleConfig } from '@xyo-network/node-core-model'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { Request } from 'express'\n\nconst DEFAULT_DEPTH = 5 as const\n\nexport const getQueryConfig = async (mod: Module, req: Request, bw: QueryBoundWitness, payloads?: Payload[]): Promise<ModuleConfig | undefined> => {\n const archivist = mod as unknown as AbstractModule\n const config = archivist?.config as unknown as ArchiveModuleConfig\n const archive = config?.archive\n // TODO: Filter based on query addresses?\n const requestCanAccessArchive = await Promise.resolve(true)\n if (isString(archive) && requestCanAccessArchive) {\n // Recurse through payloads for nested BWs\n const nestedBwAddresses\n = payloads\n ?.flat(DEFAULT_DEPTH)\n .filter<BoundWitness>((payload): payload is BoundWitness => payload?.schema === BoundWitnessSchema)\n .map(bw => bw.addresses) || []\n // TODO: Do we want to end up with a list of addresses or a list of address lists?\n const addresses = [bw.addresses, ...nestedBwAddresses].filter(address => address.length > 0)\n const allowed = addresses.length > 0 ? Object.fromEntries(archivist.queries.map(schema => [schema, addresses])) : {}\n const security = { allowed }\n return { schema: ModuleConfigSchema, security }\n }\n}\n","import { setRawResponseFormat } from '@xylabs/express'\nimport { NodeXyoViewer } from '@xyo-network/chain-rpc'\nimport {\n MemoryXyoProvider, NodeXyoRunner, rpcEngineFromProvider,\n} from '@xyo-network/xl1-rpc'\nimport type { Express } from 'express'\n\nexport const addRpcRoutes = (app: Express) => {\n const { node } = app\n const runner = new NodeXyoRunner(node)\n const viewer = new NodeXyoViewer(node)\n const provider = new MemoryXyoProvider({ runner, viewer })\n const engine = rpcEngineFromProvider(provider)\n\n app.post('/rpc', (req, res) => {\n setRawResponseFormat(res)\n engine.handle(req.body, (_, rpcResponse) => {\n res.json(rpcResponse)\n })\n })\n}\n","import type { Express } from 'express'\n\nimport { addNodeRoutes } from './address/index.ts'\nimport { addRpcRoutes } from './rpc/index.ts'\n\nexport const addRoutes = (app: Express) => {\n addRpcRoutes(app)\n addNodeRoutes(app)\n}\n","import { tryParseInt } from '@xylabs/express'\nimport type { MemoryNode } from '@xyo-network/node-memory'\n\nimport { getApp } from './app.ts'\n\nconst hostname = '::'\n// const hostname = '0.0.0.0'\n\nexport const getServer = async (port?: number, node?: MemoryNode) => {\n const appPort = port ?? tryParseInt(process.env.APP_PORT) ?? 80\n const app = await getApp(node)\n const server = app.listen(appPort, hostname, () => console.log(`Server listening at http://${hostname}:${appPort}`))\n server.setTimeout(20_000)\n return server\n}\n"],"mappings":";;;;AAAA,SACEA,uBACAC,6BACAC,sCACAC,mBACAC,0BACAC,kBACAC,gBACAC,yBACK;AAEP,OAAOC,iBAAiB;AACxB,OAAOC,UAAU;AAEjB,OAAOC,aAAa;;;ACdpB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAChC,SAASC,0BAA0B;AACnC,SAASC,qBAAqB;AAC9B,SACEC,uBAAuBC,sBAAsBC,6BACxC;AACP,SAASC,qBAAqB;AAC9B,SAASC,6BAA6B;AACtC,SACEC,yBACAC,wDACAC,qDACAC,wEACAC,2DACK;AACP,SAASC,wBAAwB;AACjC,SAASC,4BAA4B;AACrC,SAASC,sBAAsB;AAC/B,SAASC,wBAAwB;AAO1B,IAAMC,aAAa,mCAAA;AACxB,QAAM,EAAEC,eAAeC,cAAa,IAAK,MAAMC,cAAc;IAC3DC,YAAY;MACVC,aAAa;MACbC,gBAAgB;IAClB;IACAC,eAAe;MACbC,UAAU;MACVC,MAAM;IACR;EACF,CAAA;AACA,QAAMC,UAAU,IAAIC,qBAAAA;AAEpB,MAAIC,iBAAAA,GAAoB;AAEtBF,YAAQG,SAASC,mBAAmBC,QAClC;MAAEd;MAAeC;IAAc,CAAA,CAAA;EAEnC;AACAQ,UAAQG,SAASG,qBAAAA;AACjBN,UAAQG,SAASI,sBAAsBF,QAAQ;IAC7Cd;IACAC;IACAgB,qBAAqB;MACnBC,IAAIC,SACFC,UAAUC,QAAQC,IAAIC,gCAAgC,GACtD,MAAM,qEAAA;IAEV;EACF,CAAA,CAAA;AACAd,UAAQG,SAASY,gB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IAAIE,YAAAA,CAAAA;AACRL,MAAIG,IAAIG,gBAAAA;AACRN,MAAIG,IAAII,kBAAkBC,yBAAyB;IAAEC,OAAO;EAAM,CAAA,CAAA,CAAA;AAClET,MAAIG,IAAIO,iBAAAA;AACRC,uCAAqCX,GAAAA;AACrCA,MAAIG,IAAIS,qBAAAA;AACRC,8BAA4Bb,GAAAA;AAC5BA,MAAIH,OAAOA;AACXiB,YAAUd,GAAAA;AACVA,MAAIG,IAAIY,cAAAA;AACR,SAAOf;AACT,GAlBsB;;;AgBpBtB,SAASgB,mBAAmB;AAK5B,IAAMC,WAAW;AAGV,IAAMC,YAAY,8BAAOC,MAAeC,SAAAA;AAC7C,QAAMC,UAAUF,QAAQG,YAAYC,QAAQC,IAAIC,QAAQ,KAAK;AAC7D,QAAMC,MAAM,MAAMC,OAAOP,IAAAA;AACzB,QAAMQ,SAASF,IAAIG,OAAOR,SAASJ,UAAU,MAAMa,QAAQC,IAAI,8BAA8Bd,QAAAA,IAAYI,OAAAA,EAAS,CAAA;AAClHO,SAAOI,WAAW,GAAA;AAClB,SAAOJ;AACT,GANyB;","names":["customPoweredByHeader","disableCaseSensitiveRouting","disableExpressDefaultPoweredByHeader","getJsonBodyParser","getJsonBodyParserOptions","responseProfiler","standardErrors","standardResponses","compression","cors","express","assertEx","asAddress","MemoryArchivist","MongoDBArchivistV2","ViewArchivist","AddressBalanceDiviner","ArchivistSyncDiviner","HeadValidationDiviner","initTelemetry","PayloadPointerDiviner","TemporalIndexingDiviner","TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner","TemporalIndexingDivinerIndexCandidateToIndexDiviner","TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner","TemporalIndexingDivinerStateToIndexCandidateDiviner","hasMongoDBConfig","ModuleFactoryLocator","MemorySentinel","TimestampWitness","getLocator","traceProvider","meterProvider","initTelemetry","attributes","serviceName","serviceVersion","metricsConfig","endpoint","port","locator","ModuleFactoryLocator","hasMongoDBConfig","register","MongoDBArchivistV2","factory","AddressBalanceDiviner","HeadValidationDiviner","chainIdentification","id","assertEx","asAddress","process","env","XYO_EVM_STAKING_CONTRACT_ADDRESS","MemoryArchivist","MemorySentinel","PayloadPointerDiviner","TemporalIndexingDiviner","TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner","TemporalIndexingDivinerIndexCandidateToIndexDiviner","TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner","TemporalIndexingDivinerStateToIndexCandidateDiviner","TimestampWitness","ViewArchivist","ArchivistSyncDiviner","ManifestWrapper","HDWallet","NodeManifest","node","PrivateChildManifests","ChainNodeManifest","Chain","PendingNodeManifest","Pending","PublicChildManifests","nodes","getNode","locator","getLocator","mnemonic","process","env","MNEMONIC","wallet","undefined","HDWallet","random","fromPhrase","wrapper","ManifestWrapper","NodeManifest","PublicChildManifests","PrivateChildManifests","node","childNodes","loadNodes","length","Promise","all","map","childNode","register","attach","address","console","log","state","registerInstrumentations","ExpressInstrumentation","HttpInstrumentation","addInstrumentation","instrumentations","HttpInstrumentation","ExpressInstrumentation","registerInstrumentations","StatusCodes","assertEx","asyncHandler","asAddress","isModuleIdentifierPart","trimAddressPrefix","StatusCodes","handler","req","res","next","address","rawAddress","params","node","app","asAddress","undefined","mod","resolve","direction","json","state","isModuleIdentifierPart","moduleIdentifier","trimAddressPrefix","moduleAddress","assertEx","redirect","StatusCodes","MOVED_TEMPORARILY","getAddress","asyncHandler","assertEx","asyncHandler","asAddress","isAddress","isQueryBoundWitness","ModuleErrorBuilder","trimAddressPrefix","StatusCodes","isString","BoundWitnessSchema","ModuleConfigSchema","DEFAULT_DEPTH","getQueryConfig","mod","req","bw","payloads","archivist","config","archive","requestCanAccessArchive","Promise","resolve","isString","nestedBwAddresses","flat","filter","payload","schema","BoundWitnessSchema","map","addresses","address","length","allowed","Object","fromEntries","queries","security","ModuleConfigSchema","handler","req","res","next","returnError","code","message","details","error","ModuleErrorBuilder","build","locals","rawResponse","status","json","address","params","node","app","bw","payloads","Array","isArray","body","isAddress","StatusCodes","BAD_REQUEST","isQueryBoundWitness","modules","normalizedAddress","trimAddressPrefix","typedAddress","asAddress","byAddress","undefined","resolve","maxDepth","byName","direction","moduleAddress","assertEx","redirect","TEMPORARY_REDIRECT","NOT_FOUND","length","mod","queryConfig","getQueryConfig","queryResult","query","ex","INTERNAL_SERVER_ERROR","postAddress","asyncHandler","addNodeRoutes","app","defaultModule","node","address","defaultModuleEndpoint","get","_req","res","redirect","StatusCodes","MOVED_TEMPORARILY","post","TEMPORARY_REDIRECT","getAddress","postAddress","sendStatus","NOT_FOUND","setRawResponseFormat","NodeXyoViewer","MemoryXyoProvider","NodeXyoRunner","rpcEngineFromProvider","addRpcRoutes","app","node","runner","NodeXyoRunner","viewer","NodeXyoViewer","provider","MemoryXyoProvider","engine","rpcEngineFromProvider","post","req","res","setRawResponseFormat","handle","body","_","rpcResponse","json","addRoutes","app","addRpcRoutes","addNodeRoutes","getApp","node","getNode","addInstrumentation","app","express","set","use","cors","compression","responseProfiler","getJsonBodyParser","getJsonBodyParserOptions","limit","standardResponses","disableExpressDefaultPoweredByHeader","customPoweredByHeader","disableCaseSensitiveRouting","addRoutes","standardErrors","tryParseInt","hostname","getServer","port","node","appPort","tryParseInt","process","env","APP_PORT","app","getApp","server","listen","console","log","setTimeout"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/chain-api",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.22",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -44,32 +44,32 @@
|
|
|
44
44
|
"@opentelemetry/instrumentation": "^0.49.1",
|
|
45
45
|
"@opentelemetry/instrumentation-express": "^0.49.0",
|
|
46
46
|
"@opentelemetry/instrumentation-http": "^0.200.0",
|
|
47
|
-
"@xylabs/assert": "^4.9.
|
|
48
|
-
"@xylabs/express": "^4.9.
|
|
49
|
-
"@xylabs/hex": "^4.9.
|
|
50
|
-
"@xyo-network/archivist-memory": "^3.15.
|
|
51
|
-
"@xyo-network/archivist-mongodb": "^3.15.
|
|
52
|
-
"@xyo-network/archivist-view": "^3.15.
|
|
53
|
-
"@xyo-network/boundwitness-model": "^3.15.
|
|
54
|
-
"@xyo-network/chain-modules": "^1.3.
|
|
55
|
-
"@xyo-network/chain-rpc": "^1.3.
|
|
56
|
-
"@xyo-network/chain-telemetry": "^1.3.
|
|
57
|
-
"@xyo-network/diviner-payload-pointer": "^3.15.
|
|
58
|
-
"@xyo-network/diviner-temporal-indexing": "^3.15.
|
|
59
|
-
"@xyo-network/manifest-model": "^3.15.
|
|
60
|
-
"@xyo-network/manifest-wrapper": "^3.15.
|
|
61
|
-
"@xyo-network/module-abstract": "^3.15.
|
|
62
|
-
"@xyo-network/module-abstract-mongodb": "^3.15.
|
|
63
|
-
"@xyo-network/module-factory-locator": "^3.15.
|
|
64
|
-
"@xyo-network/module-model": "^3.15.
|
|
47
|
+
"@xylabs/assert": "^4.9.16",
|
|
48
|
+
"@xylabs/express": "^4.9.16",
|
|
49
|
+
"@xylabs/hex": "^4.9.16",
|
|
50
|
+
"@xyo-network/archivist-memory": "^3.15.6",
|
|
51
|
+
"@xyo-network/archivist-mongodb": "^3.15.6",
|
|
52
|
+
"@xyo-network/archivist-view": "^3.15.6",
|
|
53
|
+
"@xyo-network/boundwitness-model": "^3.15.6",
|
|
54
|
+
"@xyo-network/chain-modules": "^1.3.22",
|
|
55
|
+
"@xyo-network/chain-rpc": "^1.3.22",
|
|
56
|
+
"@xyo-network/chain-telemetry": "^1.3.22",
|
|
57
|
+
"@xyo-network/diviner-payload-pointer": "^3.15.6",
|
|
58
|
+
"@xyo-network/diviner-temporal-indexing": "^3.15.6",
|
|
59
|
+
"@xyo-network/manifest-model": "^3.15.6",
|
|
60
|
+
"@xyo-network/manifest-wrapper": "^3.15.6",
|
|
61
|
+
"@xyo-network/module-abstract": "^3.15.6",
|
|
62
|
+
"@xyo-network/module-abstract-mongodb": "^3.15.6",
|
|
63
|
+
"@xyo-network/module-factory-locator": "^3.15.6",
|
|
64
|
+
"@xyo-network/module-model": "^3.15.6",
|
|
65
65
|
"@xyo-network/node-core-lib": "^3.6.4",
|
|
66
|
-
"@xyo-network/node-memory": "^3.15.
|
|
67
|
-
"@xyo-network/node-model": "^3.15.
|
|
68
|
-
"@xyo-network/payload-model": "^3.15.
|
|
69
|
-
"@xyo-network/sentinel-memory": "^3.15.
|
|
70
|
-
"@xyo-network/wallet": "^3.15.
|
|
71
|
-
"@xyo-network/witness-timestamp": "^3.15.
|
|
72
|
-
"@xyo-network/xl1-rpc": "^1.3.
|
|
66
|
+
"@xyo-network/node-memory": "^3.15.6",
|
|
67
|
+
"@xyo-network/node-model": "^3.15.6",
|
|
68
|
+
"@xyo-network/payload-model": "^3.15.6",
|
|
69
|
+
"@xyo-network/sentinel-memory": "^3.15.6",
|
|
70
|
+
"@xyo-network/wallet": "^3.15.6",
|
|
71
|
+
"@xyo-network/witness-timestamp": "^3.15.6",
|
|
72
|
+
"@xyo-network/xl1-rpc": "^1.3.22",
|
|
73
73
|
"compression": "^1.8.0",
|
|
74
74
|
"cors": "^2.8.5",
|
|
75
75
|
"express": "^4.21.2",
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"@types/cors": "^2.8.18",
|
|
81
81
|
"@types/express": "5.0.1",
|
|
82
82
|
"@types/node": "^22.15.17",
|
|
83
|
-
"@xylabs/object": "^4.9.
|
|
83
|
+
"@xylabs/object": "^4.9.16",
|
|
84
84
|
"@xylabs/ts-scripts-yarn3": "^6.5.5",
|
|
85
85
|
"@xylabs/tsconfig": "^6.5.5",
|
|
86
|
-
"@xyo-network/account": "^3.15.
|
|
87
|
-
"@xyo-network/account-model": "^3.15.
|
|
88
|
-
"@xyo-network/archivist-abstract": "^3.15.
|
|
89
|
-
"@xyo-network/boundwitness-builder": "^3.15.
|
|
86
|
+
"@xyo-network/account": "^3.15.6",
|
|
87
|
+
"@xyo-network/account-model": "^3.15.6",
|
|
88
|
+
"@xyo-network/archivist-abstract": "^3.15.6",
|
|
89
|
+
"@xyo-network/boundwitness-builder": "^3.15.6",
|
|
90
90
|
"@xyo-network/node-core-model": "^3.6.4",
|
|
91
91
|
"dotenv": "^16.5.0",
|
|
92
92
|
"knip": "^5.55.1",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
{
|
|
13
13
|
"config": {
|
|
14
14
|
"accountPath": "1/1'/1'",
|
|
15
|
-
"name": "
|
|
15
|
+
"name": "Validated",
|
|
16
16
|
"payloadSdkConfig": {
|
|
17
17
|
"collection": "chain_validated"
|
|
18
18
|
},
|
|
@@ -23,8 +23,15 @@
|
|
|
23
23
|
"config": {
|
|
24
24
|
"accountPath": "1/1'/2'",
|
|
25
25
|
"schema": "network.xyo.diviner.chain.head.validation.config",
|
|
26
|
+
"eventSubscriptions": [
|
|
27
|
+
{
|
|
28
|
+
"sourceEvent": "inserted",
|
|
29
|
+
"sourceModule": "Chain:Submissions",
|
|
30
|
+
"targetModuleFunction": "divine"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
26
33
|
"inArchivist": "Chain:Submissions",
|
|
27
|
-
"outArchivist": "Chain:
|
|
34
|
+
"outArchivist": "Chain:Validated",
|
|
28
35
|
"name": "HeadValidationDiviner"
|
|
29
36
|
}
|
|
30
37
|
},
|
|
@@ -49,52 +56,13 @@
|
|
|
49
56
|
}
|
|
50
57
|
]
|
|
51
58
|
}
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"config": {
|
|
55
|
-
"accountPath": "1/1'/4'",
|
|
56
|
-
"max": 20000,
|
|
57
|
-
"name": "Validated",
|
|
58
|
-
"schema": "network.xyo.archivist.memory.config"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"config": {
|
|
63
|
-
"accountPath": "1/1'/5'",
|
|
64
|
-
"schema": "network.xyo.diviner.archivist.sync.config",
|
|
65
|
-
"inArchivist": "Chain:ValidatedMongo",
|
|
66
|
-
"outArchivist": "Chain:Validated",
|
|
67
|
-
"name": "ValidatedSyncDiviner"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"config": {
|
|
72
|
-
"accountPath": "1/1'/6'",
|
|
73
|
-
"automations": [
|
|
74
|
-
{
|
|
75
|
-
"frequency": 500,
|
|
76
|
-
"frequencyUnits": "millis",
|
|
77
|
-
"schema": "network.xyo.automation.interval",
|
|
78
|
-
"type": "interval"
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
"name": "ValidatedSyncSentinel",
|
|
82
|
-
"schema": "network.xyo.sentinel.config",
|
|
83
|
-
"synchronous": false,
|
|
84
|
-
"tasks": [
|
|
85
|
-
{
|
|
86
|
-
"mod": "ValidatedSyncDiviner",
|
|
87
|
-
"endPoint": "divine"
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
59
|
}
|
|
92
60
|
],
|
|
93
61
|
"public": [
|
|
94
62
|
{
|
|
95
63
|
"config": {
|
|
96
64
|
"accountPath": "1/1/1",
|
|
97
|
-
"name": "
|
|
65
|
+
"name": "Submissions",
|
|
98
66
|
"payloadSdkConfig": {
|
|
99
67
|
"collection": "chain_submissions"
|
|
100
68
|
},
|
|
@@ -121,49 +89,10 @@
|
|
|
121
89
|
"archivist": "Chain:Validated",
|
|
122
90
|
"name": "AddressBalanceDiviner"
|
|
123
91
|
}
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"config": {
|
|
127
|
-
"accountPath": "1/1/4'",
|
|
128
|
-
"max": 20000,
|
|
129
|
-
"name": "Submissions",
|
|
130
|
-
"schema": "network.xyo.archivist.memory.config"
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"config": {
|
|
135
|
-
"accountPath": "1/1/5'",
|
|
136
|
-
"schema": "network.xyo.diviner.archivist.sync.config",
|
|
137
|
-
"inArchivist": "Chain:SubmissionsMongo",
|
|
138
|
-
"outArchivist": "Chain:Submissions",
|
|
139
|
-
"name": "SubmissionsSyncDiviner"
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"config": {
|
|
144
|
-
"accountPath": "1/1/6'",
|
|
145
|
-
"automations": [
|
|
146
|
-
{
|
|
147
|
-
"frequency": 500,
|
|
148
|
-
"frequencyUnits": "millis",
|
|
149
|
-
"schema": "network.xyo.automation.interval",
|
|
150
|
-
"type": "interval"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
"name": "SubmissionsSyncSentinel",
|
|
154
|
-
"schema": "network.xyo.sentinel.config",
|
|
155
|
-
"synchronous": false,
|
|
156
|
-
"tasks": [
|
|
157
|
-
{
|
|
158
|
-
"mod": "SubmissionsSyncDiviner",
|
|
159
|
-
"endPoint": "divine"
|
|
160
|
-
}
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
92
|
}
|
|
164
93
|
]
|
|
165
94
|
}
|
|
166
95
|
}
|
|
167
96
|
],
|
|
168
97
|
"schema": "network.xyo.manifest"
|
|
169
|
-
}
|
|
98
|
+
}
|