New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

opacus-iot-example

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opacus-iot-example

IoT sensor data streaming with Opacus SDK - monetize your sensor data

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

opacus-iot-example

🌡️ IoT Sensor Data Streaming with Opacus SDK

Monetize your IoT sensor data with blockchain micropayments.

🚀 Features

  • 📊 Real-time sensor data streaming
  • 💰 Micropayments per data point ($0.000001)
  • 🔐 Encrypted data transmission
  • 📡 Pub/sub architecture

🎯 Quick Start

Run Sensor (Data Producer)

npm run sensor

Run Collector (Data Consumer)

npm run collector

📝 Example Code

Sensor Side

import { OpacusClient } from 'opacus-sdk';

const sensor = new OpacusClient({ network: 'testnet' });
await sensor.init();

// Create data stream
await sensor.createDAC({
  dataChannels: [{
    id: 'sensor-data',
    pricing: { perMessage: 100n } // $0.000001
  }]
});

// Stream data
setInterval(async () => {
  const data = getSensorReading();
  await sensor.sendStream('sensor-data', data);
}, 1000);

Collector Side

await collector.subscribeToChannel('sensor-data');

collector.onMessage('stream', (frame) => {
  const data = frame.payload.data;
  console.log('Sensor reading:', data);
});

💡 Use Cases

  • Environmental monitoring
  • Smart agriculture
  • Industrial IoT
  • Weather stations
  • Smart cities

📊 Data Schema

{
  "temperature": 25.4,
  "humidity": 65.2,
  "pressure": 1013.25,
  "timestamp": 1702834567890
}

🔧 Customize

Add your own sensors:

  • GPS coordinates
  • Motion sensors
  • Air quality
  • Energy meters

📚 Learn More

  • Opacus DAC Documentation
  • IoT Integration Guide

📄 License

MIT

Keywords

opacus

FAQs

Package last updated on 17 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts