java - 通过API获取所有corda账号
问题描述
我正在尝试获取某个节点上可用的所有帐户。
我正在使用以下代码:
@RequestMapping("/accounts/all", method = [RequestMethod.GET])
fun allKnownAccounts(): List<AccountInfoView> {
return getAllAccounts().map { it.toAccountView() }
}
private fun getAllAccounts() = rpc.proxy.startFlowDynamic(AllAccounts::class.java, false).returnValue.get()
但我收到以下错误
出现意外错误(类型=内部服务器错误,状态=500)。net.corda.core.flows.IllegalFlowLogicException:无法为 com.r3.corda.lib.accounts.workflows.flows.AllAccounts 类型的 FlowLogic 构造 FlowLogicRef:由于与构造函数的匹配不明确:[class java.lang.Boolean ]
我不确定是什么导致异常发生。谢谢大家的帮助。
解决方案
该问题已通过将 getAllAccounts() 函数更新为以下内容得到解决:
private fun getAllAccounts() = rpc.proxy.startFlowDynamic(AllAccounts::class.java).returnValue.get()
推荐阅读
- node.js - 在猫鼬中创建数据时无法读取未定义的属性“推送”
- c# - 使用ajax向表格和页面添加条目
- core-data - 实体用户不符合键“dateEndSubscription”的键值编码
- spring-boot - Thymeleaf - 为具有隐藏输入的表单中的对象设置属性
- r - 将姓氏与全名分开
- apache - 我的 apache 服务器正在运行,但是当我进入网页时,它说网络连接超时
- angular - 角度 7 - 导入 json 文件 - 编译错误
- javascript - 单击选择后放置数据用户
- kettle - Pentaho 水壶数据流
- wordpress - 显示已登录用户的评论以及帖子的帖子标题