Skip to content

A stream registry service working on top of one (or multiple) solid servers to create an intermediate caching state of the streaming data stored in the pod.

License

Notifications You must be signed in to change notification settings

SolidLabResearch/decentralized-stream-notifications-aggregator

Repository files navigation

Solid Stream Notifications Aggregator

The Solid Stream Notifications Aggregator is a service which works on top of one or more Solid Pods to provide an immediate aggregator for the clients to consume the latest streaming data stored in the Solid Pods via the Solid Notifications Protocol's WebHookChannel2023.

Architecture

Solid Stream Notifications Aggregator Architecture

Installation

To install the server, you can run the following command:

npm install

Make sure you have a Solid Server running which supports the WebHookChannel2023 for receiving notifications. We recommend using the Community Solid Server with the WebHook configuration which can be created using the CSS Config Generator.

Usage

To run the server, you can run the server using the following command:

npm run start

The interface for the service is a Websocket server with which you can interact. The server accepts a subscribe message as shown below:

{
    "subscribe": ["http://localhost:3000/aggregation_pod/aggregation/"]
}

which can be sent to the server to subscribe to the latest events from the particular LDES stream. The client can pass one or multiple LDES Streams into the subscribe message array to receive the events from the server. The server will then send the events to the client as and when they are received. A sample script for the client is shown below:

import { WebSocket } from "ws";

async function main() {
    const websocket = new WebSocket('ws://localhost:8085//', 'solid-stream-notifications-aggregator', {
        perMessageDeflate: false
    });
    websocket.once('open', () => {
        console.log('Connection to the WebSocket server was successful.');
        let message_object = {
            subscribe: ['http://localhost:3000/aggregation_pod/aggregation/']
        };
        websocket.send(JSON.stringify(message_object));
    });

    websocket.on('message', (data) => {
        console.log(data.toString());
    });
}

main()

The client will receive message such as,

{
    "stream": "stream_url",
    "published_time": "time_of_notification",
    "event": "the_notification_event"
}

License

This code is copyrighted by Ghent University - imec and released under the MIT License.

Contact

For any questions, please contact Kush or create an issue in the repository here.

About

A stream registry service working on top of one (or multiple) solid servers to create an intermediate caching state of the streaming data stored in the pod.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published