DPSN: Decentralised Pub/Sub Network
  • Introduction
  • Why Decentralized?
  • Understanding Topics
  • Architecture
    • Topics Registry
    • Configurator
    • Clusters
    • Publishers and Subscribers
    • Facilitator Brokers
    • SDK
  • Functionality
    • Message Publishing and Delivery
    • Subscription Management
    • Security Considerations
    • Topic Ownership and Access Control
    • Private Key Authentication
    • Fully Homomorphic Encryption Support
  • Advantages and Use Cases
    • Advantages of DPSN
    • Use Cases
  • Integration
    • SDK Introduction
    • Publisher
    • Subscriber
    • Delegated Addresses
    • Private Messaging
  • Integration Guides
    • Messaging Application
  • Token Use
    • Utility
    • Token Utility Model
  • DIPs
    • DIP1: Stateless Message Routing in DPSN
  • DIP2: Integration of DPSN with Model Context Protocol (MCP)
  • DIP-3: Standardizing DPSN AVS for Enhanced Security and Reliability
Powered by GitBook
On this page
  1. Integration

Publisher

Prerequisites

  • A DPSN account with a registered topic.

  • A delegated address with appropriate permissions.

  • The DPSN SDK for your preferred programming language.

Setting Up the Environment

  1. Install the SDK: Download and install the DPSN SDK for your chosen programming language (e.g., Node.js, Python, Go).

  2. Create a Delegated Address: Use the DPSN dashboard or API to create a delegated address.

  3. Configure the Environment: Set the DPSN_DELEGATED_ADDRESS_PVTKEY environment variable to the newly created delegated address.

Publisher Integration

  1. Import the SDK: Import the necessary modules from the DPSN SDK.

  2. Create a Publisher Instance: Create a new publisher instance using the SDK.

  3. Publish a Message: Use the publishMessage function to send a message to your topic.

JavaScript

const DPSN = require('dpsn-sdk');

// Create a publisher instance
const publisherChannel = new DPSN.Publisher(process.env.DPSN_DELEGATED_ADDRESS_PVTKEY, 'your_topic');

// Publish a message
publisherChannel.publishMessage(message);
PreviousSDK IntroductionNextSubscriber

Last updated 8 months ago