Data3.Network Documentation
  • Introduction to Data3
  • Data3 Concepts
    • Accounts
    • Address
    • Nodes
    • Types of Nodes
    • Node Providers
    • Database Deployment
    • Console
    • Use Case
  • Getting Started
    • Data3 Console
      • Signup on Data3 Console
      • Wallets
    • For Customers
      • Quick Start Guide
      • Signup on Data3 Console
      • Request Databases
      • Manage Your Databases
      • Use Your Databases
    • For Node Providers
      • Quick Start Guide
      • Signup at Data3 Console
      • Bid For Customer Requests
    • For Developers
      • Signup
      • Open Source
      • Contribute
  • For Customers
    • Access
    • Application Configuration
    • Database Configuration
    • Data Migration
    • Security
      • Users
      • Keys
    • Observability
  • For Node Providers
    • Node Provider Service
      • What is the Node Provider Service?
      • Node Provider Service Architecture
      • Node Provider Onetime Setup
        • Prerequisites
        • Docker data3-node-provider
        • Configure
        • Deploy data3-node-provider
        • Validate
        • Troubleshoot
    • Data3 Storage Node
      • What is the Data3 Storage Node?
      • Storage Node Architecture
      • Storage Node Setup
        • Prerequisites
        • Docker data3-storage-node
        • Configure
        • Deploy data3-storage-node
        • Validate
        • Troubleshoot
    • External Pricing Engine
    • External Deployment Engine
    • Node Tokenomics
      • Staking
      • Customer Payments
      • Incentivization
      • Pricing
    • Nodes
      • Validator Node
      • Audit Node
      • Storage Node
    • Console
  • Product
    • Roadmap
    • Releases
    • Updates
  • Data3 Solutions
    • DApps
    • Web3 Social
    • Web3 Gaming
    • Web3 Exchanges
    • Artificial Intelligence
    • SaaS Applications
    • IoT
    • Dev Database
  • Tokenomics
    • Best Practices
    • Bid for Database Requests
  • Governance & Policies
    • Governance Framework
    • Node Provider Policies
    • Data Handling Policies
    • Security Policies
    • Privacy Policies
    • For Developers
      • Architecture
      • API
      • SDKs and Libraries
      • Protocols & Algorithms
  • Community
  • FAQs
  • Legal
Powered by GitBook
On this page
  • Context
  • Architecture
  • Specification
  • Input JSON Format (HTTP POST)
  • Output Web Hook to Node Provider Service (FORM POST)
  • Sample Pricing App
  • Resources
  1. For Node Providers

External Pricing Engine

PreviousTroubleshootNextExternal Deployment Engine

Last updated 1 year ago

Context

This document provides detailed instructions for Node Providers to integrate the external pricing engine into their system. The external pricing engine is designed to automate the pricing process for customer requests received via the Data3 Console or Node Provider service.

The purpose of integrating the external pricing engine is to streamline the pricing process for Node Providers by automating the calculation and submission of bids for customer requests.

Architecture

The external pricing engine operates as a REST API/service that accepts customer request information in JSON format, calculates the price based on this information, and then triggers a webhook in the Node Provider service with the bid price. This allows Node Providers to automate their bidding process without manual intervention.

Specification

Node Providers can implement the external pricing engine in any platform or stack they have expertise in. However, a sample NodeJS application is provided as a reference implementation (below).

Input JSON Format (HTTP POST)

{
    name: 'My Dev Deployment',
    address: '581037272ca2533df3cf215dceac56c3fe8a1d6cc7317ec28e5e257e556ed056',
    region: 'WESTERN_EUROPE-United Kingdom-London',
    dbEngine: 'MySQL',
    dbEngineVersion: '8.2.0',
    specification: 'DB AI MODEL K12 - 256 GB RAM - 64 vCPU(s)',
    memory: 256,
    storage: 4100,
    cpu: 64,
    isRedundancyRequired: true,
    redundancy: 1,
    isBackupRequired: true,
    backupFrequencyDays: 2,
    backupRetentionDays: 1,
    deploymentType: 'SHARED',
    isSharedInstance: true,
    iops: 1000,
    paymentFrequency: 'MONTHLY',
    isActive: true,
    status: 'NEW',
    dateCreated: 1709156623175,
    dbOwner: '0xa1d2339b6d633e129f3aeb2a59a8445dbb8b4117'
}

Output Web Hook to Node Provider Service (FORM POST)

rspAddress: "581037272ca2533df3cf215dceac56c3fe8a1d6cc7317ec28e5e257e556ed056"
price: 100.0 
  • rspAddress is the unique address / identifier for the customer's deployment request (from the input)

  • price is the calculated price for this deployment

Sample Pricing App

To achieve this automated pricing easily, we have provided a sample NodeJS application that you can leverage to implement your own pricing engine.

  • Program your pricing logic in the calculatePrice function within the pricing.js file of the sample application. This function should accept customer request information as input and return the calculated price.

  • Set up environment variables as specified in the env.sh file of the sample application. Specifically, configure the WEBHOOK_URL variable to point to the webhook endpoint in the Node Provider service where bid prices will be submitted.

  • Install dependencies and start the sample application by executing the following commands within the sample application directory:

npm install
npm start
  • This will start this sample NodeJS REST application at http://localhost:3080 and will publish an endpoint at http://localhost:3080/price

  • Once the sample application is running, test the integration by configuring the Node Provider Service's environment variable EXTERNAL_API_ENDPOINT to point to this sample pricing endpoint at http://localhost:3080/price sample and ensuring that customer requests are sent to the external pricing engine and verify that bid prices are submitted to the Node Provider service via the Data3 Console.

Resources

Review the provided sample NodeJS application hosted on GitHub: . This application serves as a reference for implementing the external pricing engine.

For more details, please refer to the file of the sample application.

Sample NodeJS Application:

README.md:

data3-sample-pricing-app
README.md
data3-sample-pricing-app
README.md