This is a demo application that utilizes the Streamr JavaScript Client to subscribe to a data stream. Streamr is a decentralized P2P real-time data pub/sub network. By running this demo application, you will be operating a light Streamr node that subscribes to an existing data stream.
- Install npm (if you don't have this in your environment):
brew install node && brew install npm
- Clone this repository:
git clone https://github.com/DIMO-Network/dimo-streams-demo.git
- Install the dependencies for this application:
The Streamr JavaScript Client uses some npm dependencies that have been deprecated in Node v21, please use a Node version < 21 to ensure a successful installation.
npm i
- Install
npx
globally:
npm i -g npx
- Start the Streamr subscriber:
npm run start
In index.ts
, update the streamId
constant to any data stream that you have access to. Since the demo uses the public DIMO Weather Stream, we generate a random 0x address to be used in the privateKey
to initiate the Streamr client. If you are subscribing to a private data stream, simply update the Streamr client call to use your own privateKey
:
const client = new StreamrClient({
auth: {
privateKey: <use_your_own_privateKey>
},
});