@bsv/overlay-express 0.1.0

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.
@@ -0,0 +1,523 @@
1
+ import express from 'express';
2
+ import bodyParser from 'body-parser';
3
+ import { Engine, KnexStorage, KnexStorageMigrations } from '@bsv/overlay';
4
+ import { ARC, MerklePath, WhatsOnChain } from '@bsv/sdk';
5
+ import Knex from 'knex';
6
+ import { MongoClient } from 'mongodb';
7
+ import makeUserInterface from './makeUserInterface.js';
8
+ import * as DiscoveryServices from '@bsv/overlay-discovery-services';
9
+ /**
10
+ * In-memory migration source for Knex migrations.
11
+ * Allows running migrations defined in code rather than files.
12
+ */
13
+ class InMemoryMigrationSource {
14
+ migrations;
15
+ constructor(migrations) {
16
+ this.migrations = migrations;
17
+ }
18
+ /**
19
+ * Gets the list of migrations.
20
+ * @param loadExtensions - Array of file extensions to filter by (not used here)
21
+ * @returns Promise resolving to the array of migrations
22
+ */
23
+ async getMigrations(loadExtensions) {
24
+ return this.migrations;
25
+ }
26
+ /**
27
+ * Gets the name of a migration.
28
+ * @param migration - The migration object
29
+ * @returns The name of the migration
30
+ */
31
+ getMigrationName(migration) {
32
+ return migration.name || `Migration at index ${this.migrations.indexOf(migration)}`;
33
+ }
34
+ /**
35
+ * Gets the migration object.
36
+ * @param migration - The migration object
37
+ * @returns Promise resolving to the migration object
38
+ */
39
+ getMigration(migration) {
40
+ return Promise.resolve(migration);
41
+ }
42
+ }
43
+ /**
44
+ * OverlayExpress class provides an Express-based server for hosting Overlay Services.
45
+ * It allows configuration of various components like databases, topic managers, and lookup services.
46
+ * It encapsulates an Express application and provides methods to start the server.
47
+ */
48
+ export default class OverlayExpress {
49
+ name;
50
+ privateKey;
51
+ hostingURL;
52
+ // Express application
53
+ app;
54
+ // Server port
55
+ port = 3000;
56
+ // Logger (defaults to console)
57
+ logger = console;
58
+ // Knex (SQL) database
59
+ knex = undefined;
60
+ // Knex migrations to run
61
+ migrationsToRun = [];
62
+ // MongoDB database
63
+ mongoDb = undefined;
64
+ // Network ('main' or 'test')
65
+ network = 'main';
66
+ // Chain tracker
67
+ chainTracker = new WhatsOnChain(this.network);
68
+ // The Overlay Engine
69
+ engine = undefined;
70
+ // Configured Topic Managers
71
+ managers = {};
72
+ // Configured Lookup Services
73
+ services = {};
74
+ // Enable GASP Sync
75
+ enableGASPSync = true;
76
+ // ARC API Key
77
+ arcApiKey = undefined;
78
+ /**
79
+ * Constructs an instance of OverlayExpress.
80
+ * @param name - The name of the service
81
+ * @param privateKey - Private key used for signing advertisements
82
+ * @param hostingURL - The public URL where this service is hosted
83
+ */
84
+ constructor(name, privateKey, hostingURL) {
85
+ this.name = name;
86
+ this.privateKey = privateKey;
87
+ this.hostingURL = hostingURL;
88
+ this.app = express();
89
+ this.logger.log(`${name} constructed`);
90
+ }
91
+ /**
92
+ * Configures the port on which the server will listen.
93
+ * @param port - The port number
94
+ */
95
+ configurePort(port) {
96
+ this.port = port;
97
+ this.logger.log(`Server port set to ${port}`);
98
+ }
99
+ /**
100
+ * Configures the logger to be used by the server.
101
+ * @param logger - A logger object (e.g., console)
102
+ */
103
+ configureLogger(logger) {
104
+ this.logger = logger;
105
+ this.logger.log('Logger has been configured.');
106
+ }
107
+ /**
108
+ * Configures the BSV Blockchain network to be used ('main' or 'test').
109
+ * @param network - The network ('main' or 'test')
110
+ */
111
+ configureNetwork(network) {
112
+ this.network = network;
113
+ this.chainTracker = new WhatsOnChain(this.network);
114
+ this.logger.log(`Network set to ${network}`);
115
+ }
116
+ /**
117
+ * Configures the ChainTracker to be used.
118
+ * @param chainTracker - An instance of ChainTracker
119
+ */
120
+ configureChainTracker(chainTracker = new WhatsOnChain(this.network)) {
121
+ this.chainTracker = chainTracker;
122
+ this.logger.log('ChainTracker has been configured.');
123
+ }
124
+ /**
125
+ * Configures the ARC API key.
126
+ * @param apiKey - The ARC API key
127
+ */
128
+ configureArcApiKey(apiKey) {
129
+ this.arcApiKey = apiKey;
130
+ this.logger.log('ARC API key has been configured.');
131
+ }
132
+ /**
133
+ * Enables or disables GASP synchronization.
134
+ * @param enable - true to enable, false to disable
135
+ */
136
+ configureEnableGASPSync(enable) {
137
+ this.enableGASPSync = enable;
138
+ this.logger.log(`GASP synchronization ${enable ? 'enabled' : 'disabled'}.`);
139
+ }
140
+ /**
141
+ * Configures the Knex (SQL) database connection.
142
+ * @param config - Knex configuration object, or MySQL connection string (e.g. mysql://overlayAdmin:overlay123@mysql:3306/overlay).
143
+ */
144
+ async configureKnex(config) {
145
+ if (typeof config === 'string') {
146
+ config = {
147
+ client: 'mysql2',
148
+ connection: config
149
+ };
150
+ }
151
+ this.knex = Knex(config);
152
+ this.logger.log('Knex successfully configured.');
153
+ }
154
+ /**
155
+ * Configures the MongoDB database connection.
156
+ * @param connectionString - MongoDB connection string
157
+ */
158
+ async configureMongo(connectionString) {
159
+ const mongoClient = new MongoClient(connectionString);
160
+ await mongoClient.connect();
161
+ const db = mongoClient.db(`${this.name}_lookup_services`);
162
+ this.mongoDb = db;
163
+ this.logger.log('MongoDB successfully configured and connected.');
164
+ }
165
+ /**
166
+ * Configures a Topic Manager.
167
+ * @param name - The name of the Topic Manager
168
+ * @param manager - An instance of TopicManager
169
+ */
170
+ configureTopicManager(name, manager) {
171
+ this.managers[name] = manager;
172
+ this.logger.log(`Configured topic manager ${name}`);
173
+ }
174
+ /**
175
+ * Configures a Lookup Service.
176
+ * @param name - The name of the Lookup Service
177
+ * @param service - An instance of LookupService
178
+ */
179
+ configureLookupService(name, service) {
180
+ this.services[name] = service;
181
+ this.logger.log(`Configured lookup service ${name}`);
182
+ }
183
+ /**
184
+ * Configures a Lookup Service using Knex (SQL) database.
185
+ * @param name - The name of the Lookup Service
186
+ * @param serviceFactory - A factory function that creates a LookupService instance using Knex
187
+ */
188
+ configureLookupServiceWithKnex(name, serviceFactory) {
189
+ this.ensureKnex();
190
+ const factoryResult = serviceFactory(this.knex);
191
+ this.services[name] = factoryResult.service;
192
+ this.migrationsToRun.push(...factoryResult.migrations);
193
+ this.logger.log(`Configured lookup service ${name} with Knex`);
194
+ }
195
+ /**
196
+ * Configures a Lookup Service using MongoDB.
197
+ * @param name - The name of the Lookup Service
198
+ * @param serviceFactory - A factory function that creates a LookupService instance using MongoDB
199
+ */
200
+ configureLookupServiceWithMongo(name, serviceFactory) {
201
+ this.ensureMongo();
202
+ this.services[name] = serviceFactory(this.mongoDb);
203
+ this.logger.log(`Configured lookup service ${name} with MongoDB`);
204
+ }
205
+ /**
206
+ * Configures the Overlay Engine.
207
+ * @param autoConfigureShipSlap - Whether to auto-configure SHIP and SLAP services (default: true)
208
+ */
209
+ async configureEngine(autoConfigureShipSlap = true) {
210
+ this.ensureKnex();
211
+ if (autoConfigureShipSlap) {
212
+ // Auto-configure SHIP and SLAP services
213
+ this.configureTopicManager('tm_ship', new DiscoveryServices.SHIPTopicManager());
214
+ this.configureTopicManager('tm_slap', new DiscoveryServices.SLAPTopicManager());
215
+ this.configureLookupServiceWithMongo('ls_ship', (db) => new DiscoveryServices.SHIPLookupService(new DiscoveryServices.SHIPStorage(db)));
216
+ this.configureLookupServiceWithMongo('ls_slap', (db) => new DiscoveryServices.SLAPLookupService(new DiscoveryServices.SLAPStorage(db)));
217
+ }
218
+ // Sync configuration
219
+ let syncConfig = {};
220
+ if (!this.enableGASPSync) {
221
+ for (const manager of Object.keys(this.managers)) {
222
+ syncConfig[manager] = false;
223
+ }
224
+ }
225
+ const storage = new KnexStorage(this.knex);
226
+ // Include the KnexStorage migrations
227
+ this.migrationsToRun = [...KnexStorageMigrations.default, ...this.migrationsToRun];
228
+ this.engine = new Engine(this.managers, this.services, storage, this.chainTracker, this.hostingURL, undefined, undefined, this.arcApiKey ? new ARC('https://arc.taal.com', {
229
+ apiKey: this.arcApiKey
230
+ }) : undefined, new DiscoveryServices.LegacyNinjaAdvertiser(this.privateKey, 'https://dojo.babbage.systems', this.hostingURL), syncConfig);
231
+ this.logger.log('Engine has been configured.');
232
+ }
233
+ /**
234
+ * Ensures that Knex is configured.
235
+ * @throws Error if Knex is not configured
236
+ */
237
+ ensureKnex() {
238
+ if (typeof this.knex === 'undefined') {
239
+ throw new Error('You\'ll need to configure your SQL database with the .configureKnex() method first!');
240
+ }
241
+ }
242
+ /**
243
+ * Ensures that MongoDB is configured.
244
+ * @throws Error if MongoDB is not configured
245
+ */
246
+ ensureMongo() {
247
+ if (typeof this.mongoDb === 'undefined') {
248
+ throw new Error('You\'ll need to configure your MongoDB connection with the .configureMongo() method first!');
249
+ }
250
+ }
251
+ /**
252
+ * Ensures that the Overlay Engine is configured.
253
+ * @throws Error if the Engine is not configured
254
+ */
255
+ ensureEngine() {
256
+ if (typeof this.engine === 'undefined') {
257
+ throw new Error('You\'ll need to configure your Overlay Services engine with the .configureEngine() method first!');
258
+ }
259
+ }
260
+ /**
261
+ * Starts the Express server.
262
+ * Sets up routes and begins listening on the configured port.
263
+ */
264
+ async start() {
265
+ this.ensureEngine();
266
+ this.ensureKnex();
267
+ const engine = this.engine;
268
+ const knex = this.knex;
269
+ this.app.use(bodyParser.json({ limit: '1gb', type: 'application/json' }));
270
+ this.app.use(bodyParser.raw({ limit: '1gb', type: 'application/octet-stream' }));
271
+ // Enable CORS
272
+ this.app.use((req, res, next) => {
273
+ res.header('Access-Control-Allow-Origin', '*');
274
+ res.header('Access-Control-Allow-Headers', '*');
275
+ res.header('Access-Control-Allow-Methods', '*');
276
+ res.header('Access-Control-Expose-Headers', '*');
277
+ res.header('Access-Control-Allow-Private-Network', 'true');
278
+ if (req.method === 'OPTIONS') {
279
+ res.sendStatus(200);
280
+ }
281
+ else {
282
+ next();
283
+ }
284
+ });
285
+ // Serve a static documentation site or user interface
286
+ this.app.get('/', (req, res) => {
287
+ res.set('content-type', 'text/html');
288
+ res.send(makeUserInterface());
289
+ });
290
+ // List hosted topic managers and lookup services
291
+ this.app.get('/listTopicManagers', (_, res) => {
292
+ (async () => {
293
+ try {
294
+ const result = await engine.listTopicManagers();
295
+ return res.status(200).json(result);
296
+ }
297
+ catch (error) {
298
+ return res.status(400).json({
299
+ status: 'error',
300
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
301
+ });
302
+ }
303
+ })().catch(() => {
304
+ // This catch is for any unforeseen errors in the async IIFE itself
305
+ res.status(500).json({
306
+ status: 'error',
307
+ message: 'Unexpected error'
308
+ });
309
+ });
310
+ });
311
+ this.app.get('/listLookupServiceProviders', (_, res) => {
312
+ (async () => {
313
+ try {
314
+ const result = await engine.listLookupServiceProviders();
315
+ return res.status(200).json(result);
316
+ }
317
+ catch (error) {
318
+ return res.status(400).json({
319
+ status: 'error',
320
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
321
+ });
322
+ }
323
+ })().catch(() => {
324
+ res.status(500).json({
325
+ status: 'error',
326
+ message: 'Unexpected error'
327
+ });
328
+ });
329
+ });
330
+ // Host documentation for the services
331
+ this.app.get('/getDocumentationForTopicManager', (req, res) => {
332
+ (async () => {
333
+ try {
334
+ const manager = req.query.manager;
335
+ const result = await engine.getDocumentationForTopicManager(manager);
336
+ res.setHeader('Content-Type', 'text/markdown');
337
+ return res.status(200).send(result);
338
+ }
339
+ catch (error) {
340
+ return res.status(400).json({
341
+ status: 'error',
342
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
343
+ });
344
+ }
345
+ })().catch(() => {
346
+ res.status(500).json({
347
+ status: 'error',
348
+ message: 'Unexpected error'
349
+ });
350
+ });
351
+ });
352
+ this.app.get('/getDocumentationForLookupServiceProvider', (req, res) => {
353
+ (async () => {
354
+ try {
355
+ const lookupService = req.query.lookupService;
356
+ const result = await engine.getDocumentationForLookupServiceProvider(lookupService);
357
+ return res.status(200).json(result);
358
+ }
359
+ catch (error) {
360
+ return res.status(400).json({
361
+ status: 'error',
362
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
363
+ });
364
+ }
365
+ })().catch(() => {
366
+ res.status(500).json({
367
+ status: 'error',
368
+ message: 'Unexpected error'
369
+ });
370
+ });
371
+ });
372
+ // Submit transactions and facilitate lookup requests
373
+ this.app.post('/submit', (req, res) => {
374
+ (async () => {
375
+ try {
376
+ // Parse out the topics and construct the tagged BEEF
377
+ const topicsHeader = req.headers['x-topics'];
378
+ if (!topicsHeader) {
379
+ throw new Error('Missing x-topics header');
380
+ }
381
+ const topics = JSON.parse(topicsHeader);
382
+ const taggedBEEF = {
383
+ beef: Array.from(req.body),
384
+ topics
385
+ };
386
+ // Using a callback function, we can just return once our steak is ready
387
+ // instead of having to wait for all the broadcasts to occur.
388
+ await engine.submit(taggedBEEF, (steak) => {
389
+ return res.status(200).json(steak);
390
+ });
391
+ }
392
+ catch (error) {
393
+ console.error(error);
394
+ return res.status(400).json({
395
+ status: 'error',
396
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
397
+ });
398
+ }
399
+ })().catch(() => {
400
+ res.status(500).json({
401
+ status: 'error',
402
+ message: 'Unexpected error'
403
+ });
404
+ });
405
+ });
406
+ this.app.post('/lookup', (req, res) => {
407
+ (async () => {
408
+ try {
409
+ const result = await engine.lookup(req.body);
410
+ return res.status(200).json(result);
411
+ }
412
+ catch (error) {
413
+ console.error(error);
414
+ return res.status(400).json({
415
+ status: 'error',
416
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
417
+ });
418
+ }
419
+ })().catch(() => {
420
+ res.status(500).json({
421
+ status: 'error',
422
+ message: 'Unexpected error'
423
+ });
424
+ });
425
+ });
426
+ if (this.arcApiKey) {
427
+ // Route for ARC ingest
428
+ this.app.post('/arc-ingest', (req, res) => {
429
+ (async () => {
430
+ try {
431
+ const { txid, merklePath: merklePathHex, blockHeight } = req.body;
432
+ const merklePath = MerklePath.fromHex(merklePathHex);
433
+ await engine.handleNewMerkleProof(txid, merklePath, blockHeight);
434
+ return res.status(200).json({ status: 'success', message: 'Transaction status updated' });
435
+ }
436
+ catch (error) {
437
+ console.error(error);
438
+ return res.status(400).json({
439
+ status: 'error',
440
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
441
+ });
442
+ }
443
+ })().catch(() => {
444
+ res.status(500).json({
445
+ status: 'error',
446
+ message: 'Unexpected error'
447
+ });
448
+ });
449
+ });
450
+ }
451
+ else {
452
+ this.logger.warn('Disabling ARC because no ARC API key was provided.');
453
+ }
454
+ if (this.enableGASPSync) {
455
+ // Routes for GASP synchronization
456
+ this.app.post('/requestSyncResponse', (req, res) => {
457
+ (async () => {
458
+ try {
459
+ const topic = req.headers['x-bsv-topic'];
460
+ const response = await engine.provideForeignSyncResponse(req.body, topic);
461
+ return res.status(200).json(response);
462
+ }
463
+ catch (error) {
464
+ console.error(error);
465
+ return res.status(400).json({
466
+ status: 'error',
467
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
468
+ });
469
+ }
470
+ })().catch(() => {
471
+ res.status(500).json({
472
+ status: 'error',
473
+ message: 'Unexpected error'
474
+ });
475
+ });
476
+ });
477
+ this.app.post('/requestForeignGASPNode', (req, res) => {
478
+ (async () => {
479
+ try {
480
+ const { graphID, txid, outputIndex } = req.body;
481
+ const response = await engine.provideForeignGASPNode(graphID, txid, outputIndex);
482
+ return res.status(200).json(response);
483
+ }
484
+ catch (error) {
485
+ console.error(error);
486
+ return res.status(400).json({
487
+ status: 'error',
488
+ message: error instanceof Error ? error.message : 'An unknown error occurred'
489
+ });
490
+ }
491
+ })().catch(() => {
492
+ res.status(500).json({
493
+ status: 'error',
494
+ message: 'Unexpected error'
495
+ });
496
+ });
497
+ });
498
+ }
499
+ else {
500
+ this.logger.warn('GASP sync is disabled.');
501
+ }
502
+ // Automatically handle migrations
503
+ const migrationSource = new InMemoryMigrationSource(this.migrationsToRun);
504
+ const result = await knex.migrate.latest({
505
+ migrationSource
506
+ });
507
+ this.logger.log('Knex migrations run', result);
508
+ // 404 handler for all other routes
509
+ this.app.use((req, res) => {
510
+ this.logger.log('404', req.url);
511
+ res.status(404).json({
512
+ status: 'error',
513
+ code: 'ERR_ROUTE_NOT_FOUND',
514
+ description: 'Route not found.'
515
+ });
516
+ });
517
+ // Start listening on the configured port
518
+ this.app.listen(this.port, () => {
519
+ this.logger.log(`${this.name} listening on local port ${this.port}`);
520
+ });
521
+ }
522
+ }
523
+ //# sourceMappingURL=OverlayExpress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverlayExpress.js","sourceRoot":"","sources":["../../../src/OverlayExpress.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,UAAU,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,WAAW,EAA+B,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtG,OAAO,EAAE,GAAG,EAAgB,UAAU,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,WAAW,EAAM,MAAM,SAAS,CAAA;AACzC,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,iBAAiB,MAAM,iCAAiC,CAAA;AAWpE;;;GAGG;AACH,MAAM,uBAAuB;IACP;IAApB,YAAoB,UAAuB;QAAvB,eAAU,GAAV,UAAU,CAAa;IAAI,CAAC;IAEhD;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,cAAiC;QACnD,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,SAAoB;QACnC,OAAO,SAAS,CAAC,IAAI,IAAI,sBAAsB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAA;IACrF,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,SAAoB;QAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IACnC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IA+CxB;IACA;IACA;IAhDT,sBAAsB;IACtB,GAAG,CAAqB;IAExB,cAAc;IACd,IAAI,GAAW,IAAI,CAAA;IAEnB,+BAA+B;IAC/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