9.1.2 Invocation of the Chainlink oracle service in the BSN Testnet
Due to the nature of IRITA cross-chain model, the user initiates a call to the Chainlink service by invoking the cross-chain contract in the BSN permissioned services by the contract deployed in the Testnet. After processing by Relayer, BSN Hub and other components, the deployed Chainlink service provider issues a call to Chainlink after receiving an event from a cross-chain contract and returns the result of the call via the BSN Hub.
In the BSN, calling the Chainlink service through the IRITA interchain hub is just like calling the cross-chain service, the CallService method is called in the user's application contract.
Currently, the Testnet provides eth_usdt_price_test service. The service call is the same as the cross-chain call, please refer to chapter 8.3 "Interchain Services based on IRITA".
When calling the Chainlink service, the target contract address is:
iaa15s9sulrnmctzluc42g7lkxh92ardkc9xccxsy9
The parameters are as follows:
{"service_name":"eth-usdt-price","providers":["iaa16eu2jvgpa5ek9mn2tn985jlm89e6dch92qwj09"],"input":"{\"header\":{},\"body\":{}}","timeout":100,"service_fee_cap":"1000000upoint"}
The format of the returned parameters is as follows:
{"last": "1000"}
Note: Since the name of the called Chainlink oracle service is already identified in the parameters of the cross-chain service call, the input parameter to call the Chainlink service is empty.
The specific example contracts can be found in the chapter 8.3.4 "Interchain Services based on Hyperledger Fabric" and chapter 8.3.5 "Interchain Services based on FISCO BCOS" for the description of Fabric and the FISCO BCOS framework for invoking cross-chain contracts.