Plugin,a Decentralized Oracle built on XDC Network
  • Migrating from Plugin Node V2 to V2.4 Without Changing the Node Address
    • 1 - Backup on Plugin Node V2.0
    • 2 - Installation and Configuration of Plugin Node V2.4
    • 3 - Importing PluginV2 Node Address into PluginV2.4
    • 4. Backup After Plugin V2.4 Upgrade
  • Plugin 2.0 - Node Operators
    • Introduction
    • Unstake PLI Tokens from Plugin 1.0 Node
    • Plugin 2.0 Set Up Requirements
    • Node Installation
      • Node Fulfillment
      • Job Setup
        • Steps to Setup Direct Request Job
      • Process of Approval
    • How to Update Your Plugin Node for the Latest XDC Gas Fee
  • PLUGIN 2.0 - Validators
    • Introduction
    • Set-up Requirements
    • Job Setup
      • Steps to Setup Direct Request Job
      • Flux Monitor Job
        • Idle Timer
        • Drum Beat
        • Poll Timer
        • POLL TIMER + IDLE TIMER (Recommended)
      • Process Of Approval
      • Rewards Information
    • OCR Set-up
    • How to Update Your Plugin Node for the Latest XDC Gas Fee
  • WALLET
    • XDCPay - Apothem
    • XDCPay - Mainnet
  • PLUGIN VRF SUBSCRIPTION
    • Introduction
    • Guidance on Utilizing Random Values
    • Creation and Deployment of VRF-Consumer Contract
    • Requesting Random Values
  • Multichain
    • PLISwap - How to instructions
  • Plugin Data Feeds platform
    • Introduction
    • End data consumers - Mainnet
    • End data consumers - Apothem
    • Benefits
  • Restaking Model
    • Introduction
      • Scenarios in Re-staking Model
      • Benefits To Node Members
      • Steps for Restaking
  • Tips and tricks
    • Known-Issues
    • Open-Issues
  • Plugin 1.0 Installations - Deprecated
    • How to install Plugin 1.0 Node
      • Modular Method Deployment (Recommended Approach)
      • Script Method (Legacy)
        • Script - Phase 1
        • Script - Phase 2
      • Docker Method
        • Docker - Phase 1
        • Docker - Phase 2
    • Core Adapters
    • Fund your Node
  • External Initiators - Deprecated
    • Introduction
    • Installation
    • Setup & Build
  • Oracle Plugin 1.0 - Deprecated
    • Deployment
    • Fulfillment Request
    • Job-Setup
    • Testing
  • Job-Tasks Plugin 1.0 Deprecated
    • Sleep
    • Get > Bytes32
    • HttpGet
    • CRON
    • Web
  • External Adapters Plugin 1.0 - Deprecated
    • Introduction
    • Implement External -Adapters
    • Define Bridge
    • Add Bridge to Job Spec
  • Deprecated
    • How to use
  • Use Cases
    • Plugin WFN Use Case
      • Plugin WFN Data Review
      • Plugin WFN Use Case - FAQ
      • Plugin WFN - Ambient Weather Unit Onboarding Instructions
      • Plugin WFN - Acurite Weather Unit Onboarding Instructions - LEGACY
      • Unlock WFN Node
    • Crypto Compare - Pricing Index
  • Node Operators
    • How to Register / Sign-up
    • How to enable 2FA
    • How to update profile
    • How to add XDC Wallet Address
    • How to Navigate Dashboards
    • How to submit Node Details
    • How to stake PLI token for Plugin Node
    • How to add Job to your node
    • View the node details
    • De-Activate / Re-activate my nodes
    • Withdraw staked PLI
    • Withdraw PLI from Plugin Node
    • Withdraw PLI from Oracle contract
    • How to add more stake in Node?
    • How to Migrate my Plugin Node to New Server?
    • How to Un-Stake the node.
    • How a Reputation is calculated?
    • Node Maintenance Instructions for node operators
  • FEATURES
    • PLI Yield Farming
      • Steps for Staking in Plugin Yield Farming (PLIYF)
      • PLIYF - FAQ
  • Support
    • FAQ
  • RESOURCES
    • Node Setup Video Tutorials
    • Community Supports
    • How to Submit your node details - Video Tutorial
  • CHANGELOG
    • v1.0.1
    • V1.0.2
    • V1.0.3
    • V1.0.4
    • V1.05
  • Terms and Conditions
Powered by GitBook
On this page
  • Requirements
  • Address Types
  • Deploy your own Oracle contract
  1. Oracle Plugin 1.0 - Deprecated

Deployment

Using the Oracle contract, you can use your own node to fulfill requests. This guide will show you how to deploy your own Oracle contract and add jobs to your node so that it can provide data to smart contracts.

Requirements

Before you begin this guide, complete the following tasks to make sure you have all of the tools that you need:

  • Set up XDCPay and obtain Apothem(Testnet) PLI.

  • Configure a Xinfin client with an active WebSocket connection.

  • Run a Plugin Node and connect it to a supported database.

  • Fund the XDC Wallet address that your Plugin node uses. You can find the address in the node Operator GUI under the Keys tab. The address of the node is the Regular type. You can obtain test ETH from several faucets.

Address Types

Your node works with several different types of addresses. Each address type has a specific function:

  • Node address: This is the address for your Plugin node wallet. The node requires native blockchain tokens at all times to respond to requests. For this example, the node uses XDC. When you start a Plugin node, it automatically generates this address. You can find this address on the Node Operator GUI under Keys > Account addresses.

  • Oracle contract address: This is the address for contracts like Operator.sol or Oracle.sol that are deployed to a blockchain. Do not fund these addresses with native blockchain tokens such as XDC. When you make API call requests, the funds pass through this contract to interact with your Plugin node. This will be the address that smart contract developers point to when they choose a node for an API call.

  • Admin wallet address: This is the address that owns your Operator.sol or Oracle.sol contract addresses. If you're on OCR, this is the wallet address that receives PLI tokens.

Deploy your own Oracle contract

  1. Go to Remix and open the Oracle.sol smart contract. The contents of this file will be very minimal.

pragma solidity 0.4.24;
import "@goplugin/contracts/src/v0.4/Oracle.sol";
  1. On the Compile tab, click the Compile button for Oracle.sol. Remix automatically selects the compiler version and language from the pragma line unless you select a specific version manually.

  2. On the Deploy and Run tab, configure the following settings:

    • Select "Injected Web3" as your Environment. The JavaScript VM environment cannot access your oracle node.

    • Select the "Oracle" contract from the Contract menu.

    • Copy the PLI token contract address for the network(like Mainnet, Apothem as given below) you are using and paste it into the address_link field next to the Deploy button:

xdcff7412ea7c8445c46a8254dfb557ac1e48094391

xdc33f4212b027e22af7e6ba21fc572843c0d701cd1

Compile the program and you should see "green tick"

Click Deploy. XDCPay prompts you to confirm the transaction.

If the transaction is successful, a new address displays in the Deployed Contracts section. Keep a note of the Oracle contract address(let's remember this address as OCA to refer to). You need it later for your contract consumption.

PreviousSetup & BuildNextFulfillment Request

Last updated 2 years ago