MCPcopy Create free account
hub / github.com/EvoMap/evolver / main

Function main

scripts/seed-merchants.js:58–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58async function main() {
59 const hubUrl = process.env.A2A_HUB_URL || process.env.EVOMAP_HUB_URL;
60 if (!hubUrl) {
61 console.error('[Seed] A2A_HUB_URL or EVOMAP_HUB_URL is required.');
62 process.exit(1);
63 }
64
65 console.log('[Seed] Hub:', hubUrl);
66 console.log('[Seed] Starting merchant with', SEED_SERVICES.length, 'services...');
67
68 await merchantAgent.start({
69 services: SEED_SERVICES,
70 onOrder: handleOrder,
71 pollMs: 30000,
72 });
73
74 console.log('[Seed] Merchant started. Polling for orders. Press Ctrl+C to stop.');
75
76 process.on('SIGINT', () => {
77 console.log('\n[Seed] Shutting down...');
78 merchantAgent.stop();
79 process.exit(0);
80 });
81
82 process.on('SIGTERM', () => {
83 merchantAgent.stop();
84 process.exit(0);
85 });
86}
87
88main().catch((err) => {
89 console.error('[Seed] Fatal:', err.message || err);

Callers 1

seed-merchants.jsFile · 0.70

Calls 2

startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected