OCR Set-up
OCR configuration, currently is specific for validators involved in participating in the Oracle price feeds. We will send an announcement to validators while changing the current price feeds to OCR protocol based price feeds.
Here are the detailed steps to enable Offchain reporting onto the Plugin Node for Peer.
To enable OCR in the Plugin environment, set the parameters in the
config.tomlfile as shown below. Once the changes are made, restart the plugin usingpm2 restart 0.

To set up the foundry repository pull the code base to your local environment git clone https://github.com/GoPlugin/foundry.git
Invoke remix to deploy Offchainaggregator contract
"remixd -s . -u https://remix.xinfin.network"
Once the remix is invoked, open the remix in the browser "https://remix.xinfin.network" URL.
Now select Offchainaggregator.sol contract as given below.
Parameters for deploying Offchainaggregator.sol
i) Constructor params: ii) Decimal: 18
iii) Billing Access Controller: <wallet_address>
iv) Request Access Controller: <wallet_address>
v) Min Ans : 0
vi) Max Ans : 99999999999999999999
vii) Validator : 0x0000000000000000000000000000000000000000 viii) PLI : 0x33f4212b027E22aF7e6BA21Fc572843C0D701CD1 ix) Max gas price : 3000
x) Reasonable Gas Price: 75
xi) MicroPliPerEth: 305186108
xii) PliWeiPerObservation : 151513582
xiii) PliWeiPerTransmission : 9090766
To get the OS instruction set of server, execute the command "uname -m" in CLI.
Now execute the command in foundry directory as given below.
Get the [5th] parameter field from the above output as the value of hexString
Deploy the cast.sol contract in remix to convert the hexString value to solidity bytes
In the 'hexStringToBytes' option pass the hexString value and click to get the solidity converted bytes.

Set the payee in Offchainaggregator.sol contract using the below-mentioned values, and click on transact, transmitters: ["<node_address_peer1>","<node_address_peer2>","<node_address_peer3>","<node_address_peer4>"] payees: ["<node_address_peer1_walletaddress>","<node_address_peer2_walletaddress>","<node_address_peer3_walletaddress>","<node_address_peer4_walletaddress>"]

Now set Offchainaggregator config using setConfig option

It is time to submit Job for OCR. Job spec template for Peer nodes is available in foundry directory @ ./src/sandbox/clroot/jobs/ocr_job.toml. Kindly, make the required changes in the ocr_job.toml (mentioned in between '<>')and submit the job in your node, so that it will communicate with the bootstrapper node and participate in generating the off chain report.
Job submission output Once the job is submitted you can see the job is running in Plugin UI @ "Jobs" option.

Last updated