我在上学习Chainlink文档教程,以便从我的智能契约中调用API。但是,我仍然无法理解在APIConsumer的构造函数中调用的函数APIConsumer。我正试图通过API调用来获取城市的温度。但我的合同在编纂时出错了,他说:
APIConsumer hit a require or revert statement somewhere in its constructor
上面的错误是非常普遍的,我无法理解问题是什么。下面是我的合同代码和用于部署它的脚本。
我需要在部署脚本中传递哪些参数?
APIConsumer合同
// SPDX-License-Identifier: MIT
pr
我在Angular 2中使用了options标签来填充我的下拉列表。使用dateTest1.json可以正确地填充下拉列表,但是,当迭代.json文件中给定键的值时,它在填充下拉列表时会遇到问题。在Angular 2中,用下面的dateTest.json示例填充下拉列表的正确方法是什么?
从dateTest.json检索时的*.component.html:EXCEPTION: TypeError: Cannot read property 'month' of undefined in [dateAttributesList.month in *Component@63:22
在链接文档的APIConsumer合同中(任何API)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "@chainlink/contracts/src/v0.8/ConfirmedOwner.sol";
/**
* Request testnet LINK and ETH here: https://faucets.chain.link/
* Find i
我在Chainlink官方文档中遵循了这个教程:
我正在使用AlphaChain Kovan oracle检索bytes32:
当oracle获得答案并运行fulfill()时,它将接收到的字符串赋给我的"name“变量(一个bytes32变量)。当我调用oracle时,事务似乎完成了,但当我单击"name“变量时,该变量只显示0x0000...00,这是怎么回事?
我正在使用Chainlink节点来获取智能契约中的数据。我已经读到,我可以选择尽可能多的节点,可以将不信任的数据输入到我的契约中,但是现在,对每个节点进行API调用似乎是一个手动过程,我的契约很大,包含大量的地址和作业is。
solidity
address[] public oracles;
address[] public jobs;
function loop_through() public {
// does a for loop through each oracle and jobID and calls the get_weather_today function with