diff --git a/src/lib/core/streamr/index.ts b/src/lib/core/streamr/index.ts index 4a4856a..06bb2cf 100644 --- a/src/lib/core/streamr/index.ts +++ b/src/lib/core/streamr/index.ts @@ -53,17 +53,19 @@ export default class implements Hooks { }); try { + console.log(`[streamr] Connecting to ${STREAMR_STREAM_ID}...`); const stream = await retry(() => streamrClient.getStream(STREAMR_STREAM_ID!), 3, 2000); await new Promise((resolve) => setTimeout(resolve, 2000)); + console.log(`[streamr] Connected. Publishing ${pendingTransactions.length} transactions...`); const batchPayload = buildBatchPayload(pendingTransactions); await stream.publish(batchPayload); + console.log(`[streamr] Published ${pendingTransactions.length} transactions to stream ${STREAMR_STREAM_ID}`); await new Promise((resolve) => setTimeout(resolve, 2000)); } catch (error) { - console.error(`Failed to publish to Streamr: ${(error as Error).message}`); - throw error; + console.error(`[streamr] Error publishing to Streamr:`, error); } finally { // destroy the client to free resources await streamrClient.destroy(); diff --git a/src/lib/core/streamr/ui.ts b/src/lib/core/streamr/ui.ts index 6204318..b320ae0 100644 --- a/src/lib/core/streamr/ui.ts +++ b/src/lib/core/streamr/ui.ts @@ -144,6 +144,9 @@ export default class implements UIHooks { const batchPayload = buildBatchPayload(pendingTransactions); await new Promise((resolve) => setTimeout(resolve, 2000)); await stream.publish(batchPayload); + console.log(`[streamr-ui] Published ${pendingTransactions.length} transactions to stream ${streamId}`); + } catch (error) { + console.error(`[streamr-ui] Error publishing to Streamr:`, error); } finally { await streamrClient.destroy(); }