【发布时间】:2018-11-02 10:09:28
【问题描述】:
我正在使用blockexplorer 区块链API,我想根据特定的哈希获取区块数据(这个哈希应该取自另一个函数)。
我是 Promise 新手,谁能帮我获取区块数据?
这是我的代码:
const be = require('blockexplorer');
be.block(be.blockIndex(0))
.then((result) => {
console.log(result)
})
.catch((err) => {
throw err
})
另外,我尝试了另一种使用嵌套 Promise 的方法,但没有奏效。
【问题讨论】:
标签: javascript node.js promise blockchain