Set up your oracle service
You are required to configure your machine to run the Oracle and Backend services. The Oracle service will inform the smart contracts about the current prices of the currency pairs (BTC/USD, RIF/USD, USD/ARS, USD/COP,
RIF/BTC).The following commands will set up your machine and start the services using the already built docker image that resides in your AMI.
1.Set up your oracle configuration
For this step you will have to provide the following information to set up your oracle:
Environment: testnet/mainnet
Oracle Address:
RSK Node url
Coin Pairs
Oracle Port
Registry address
Thorough explanation of the setAddress
script:
The first parameter you have to provide is the network where your oracle will be running. You have two options:
RSK Mainnet network
RSK Testnet network
Once you have chosen the network, a series of default parameters will be automatically set. However, these values could be modified later. For example, the default values for testnet are:
CHAIN ID: 31
PUBLIC RSK NODE URL: https://public-node.testnet.rsk.co
REGISTRY ADDR: 0xf078375a3dD89dDF4D9dA460352199C6769b5f10
ORACLE PORT: 5556
The next step will be to configure your oracle, to do this you could choose between providing an address and a private key or you could generate a new pair.
Finally, you will need to provide the coin pairs your oracle will be listening to. Right now the Money On Chain Oracle system supports two coin pairs to subscribe to:
BTCUSD
RIFUSD
USDARS
USDCO
PRIFBTC(deprecated)
2.Start the oracle´s container service
Once you have filled in your oracle data you should now start your oracle service. The service will be automatically restarted if something happens. The example below exposes the default oracle port, but if you have chosen to set another port in your oracle config file, you should expose the selected port.
Container log retention policy:
log driver: json-file
max size file: 50Mb (estimated log file size per day)
max files retention: 15 (two weeks of logs)
compress: true
If you would not want to config a file to start your oracle, you could pass the options one by one to the oracle container using the -e flag provided by docker. Below we leave an example:
4. Check logs
To check your oracle logs you could use:
or you could just get into the container:
Get RBTC
For the following steps you will need RBTC to pay for transactions in the dapp and to send gas to your oracle. For testnet, you could visit https://faucet.rsk.co/ and complete the form to get Ethers for your Oracle's address.
Now you can register your oracle and interact with the smart contract using the Dapp.
Last updated