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);

Last updated