Job-Setup

Let’s create a JOB, so you can test and see if your oracle is getting interacted with the external world

Create an Alarm Job in the Plugin node.

Steps to create Alarm Job -

  • Login to the Plugin node

  • Navigate to Jobs and click on New Job

  • Copy the job specification mentioned below

  • Paste the contents into the Json Spec field and create the job

  • Copy the newly created job ID which we will be using later

  • Submit clientcontract using xinfin.remix, if any error occurs then you can use remix.ethereum

NOTE:

1) While filling up "name", and "endpoint" values, please provide the same Name value which you used for 'plugin initiators create <Name>'.

2) For the 'addresses' values you need to paste the OCA which we used in Deployment. You need to remove the 'xdc' at the start of the OCA and replace it with '0x', and make sure there is no space left at the front or back of the OCA.

{
    "initiators":[
        {
            "type":"external",
            "params":{
      "name": "xdc",
               "body": {
      "endpoint": "xdc",
      "addresses": ["0xf180e56bb575806aefaf2a7616622a9fc180b51c"]
    }
            }
        }
    ],
    "tasks":[
        {
            "type":"sleep",
            "confirmations":null,
            "params":{
            }
        },
        {
            "type":"ethbool",
            "confirmations":null,
            "params":{
            }
        },
        {
            "type":"ethtx",
            "confirmations":null,
            "params":{
            }
        }
    ],
    "startAt":null,
    "endAt":null
}

Here, “Sleep”, “ethbool”, “ethtx” are core-adapters,

Core adapters are the built-in functionality that every Plugin node supports. Strung together, they act as tasks that need to be performed to complete a Job. Adapters that are prefixed with “Eth” refer to tasks that post data onto the chain.

Last updated