diff --git a/README.md b/README.md index 119b730..16cb206 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # M3tering Console Setup +## Pre-setup + +- Make sure Public key is set on the M3ter contract +- Make sure the Console has been granted publish permission on the Streamr stream + ## Quick Setup 1. **Clone/Update** diff --git a/src/index.ts b/src/index.ts index 0e787c6..b58b6a1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import setupDatabase, { saveMeter, deleteMeterByPublicKey, } from "./store/sqlite"; +import "./logic/streamr"; handleUplinks(); diff --git a/src/logic/streamr.ts b/src/logic/streamr.ts index b718b2e..344a338 100644 --- a/src/logic/streamr.ts +++ b/src/logic/streamr.ts @@ -16,6 +16,12 @@ export const streamrClient = new StreamrClient({ const stream = streamrClient.getStream(STREAMR_STREAM_ID); +stream.then((stream) => { + console.log(`[Streamr] Connected to stream: ${stream.id}`); +}).catch((error) => { + console.error("[Streamr] Error connecting to stream:", error); +}); + async function getStream() { return await stream; }