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

Function _publishBundle

src/atp/atpExecute.js:170–185  ·  view source on GitHub ↗
(gene, capsule)

Source from the content-addressed store, hash-verified

168}
169
170async function _publishBundle(gene, capsule) {
171 const nodeSecret = getHubNodeSecret();
172 if (!nodeSecret) return { ok: false, error: 'missing_node_secret_after_hello' };
173 const signatureInput = [gene.asset_id, capsule.asset_id].sort().join('|');
174 const signature = crypto.createHmac('sha256', nodeSecret).update(signatureInput).digest('hex');
175 const msg = {
176 protocol: 'gep-a2a',
177 protocol_version: '1.0.0',
178 message_type: 'publish',
179 message_id: 'msg_atp_' + crypto.randomBytes(8).toString('hex'),
180 timestamp: new Date().toISOString(),
181 sender_id: getNodeId(),
182 payload: { assets: [gene, capsule], signature: signature },
183 };
184 return _postJson(_publishUrl(), msg, PUBLISH_TIMEOUT_MS);
185}
186
187async function _completeTaskOnHub(taskId, assetId) {
188 const base = String(getHubUrl() || '').replace(/\/+$/, '');

Callers 1

completeAtpTaskFunction · 0.85

Calls 3

getHubNodeSecretFunction · 0.85
_postJsonFunction · 0.85
_publishUrlFunction · 0.85

Tested by

no test coverage detected