Install & run data providers locally
From the monorepo, navigate to the
feedsfolder within the
# from monorepo folder
feedsfolder in monorepo
Configure the data feeds (aka adapters) which your data provider will use to fetch and serve data to subscribed consumer contracts. Each data feed includes options for connecting to your data source via HTTP(S), filtering your data and returning a single value using reducers, and sending the value to your oracle contract.
makecommand, run the
adapter-id-genutility, which generates a unique 32-byte string identifier for each feed defined as a variable within the
make adapter-id-gen ADAPTERS="ETH_USD.json WEMIX_USD.json"
For example, the above command generates separate string identifiers for the
WEMIX_USD.jsonfeeds. Each string is saved within its respective feed as an
Once the feeds' adapter IDs have been created, follow the instructions in the video below to deploy the data provider's oracle contract. This contract sends data on-chain, which is then consumed by valid data subscribers.
OracleProvidercontract should be deployed for each feed. Once deployed, replace the
oracleAddresskey in each feed with the key of its deployed contract.
After defining your data feeds and generating an adapter ID, the next step is to do a dry run.
It does this by simulating the execution of a node to fetch, aggregate and return data using the properties defined within the data feed.
adapter-dry-runcommand, passing the list of data feeds you want to verify to the
ADAPTERSargument. For example:
make adapter-dry-run ADAPTERS="ETH_USD.json WEMIX_USD.json"
A successful dry run fetches data from defined data sources, filters the data using the reducers defined in the adapter, and returns the single value which the oracle contract consumes in a production environment.
In order to connect successfully, node runners are required to provide connecting data providers with specific config values, to be used within the data provider's
These parameters include:
- the node's IP address.
- the node's public certificate
- the node's OAuth token
Data providers require the node's self-signed public certificate to communicate securely with the node via SSL (Secure Socket Layer).
Once provided by the node, the certificate file should be saved by the data provider within the
data-provider/certs/nodefolder. For example, in the image below, the public certificate file
535797165684.pemis saved in the
x509being an arbitrary name given to the node by the data provider).
Once saved, the file path should also be defined within the
data-provider/config.ymlfile as a
Apart from the connected node's parameters, the
data-providers/.envfile need to be configured with other details of the data provider.
The mandatory parameters include:
- the data provider's organization details (name, website, and organization ID).
- the list of feeds you want the node to aggregate. Any feed name not defined in this list will not be sent to the node.
- the DNS details of the data provider, particularly its IP address.
Once the above have been completed, run the following commands to start the data provider on your local machine.
# start data provider without logging to console
make dp-client-nolog HOST_IP=0.0.0.0:50002
# to start with comprehensive logging
make dp-client HOST_IP=0.0.0.0:50002