首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在科达,我如何监控金库中国家的破坏和创造?

在科达,我如何监控金库中国家的破坏和创造?
EN

Stack Overflow用户
提问于 2018-03-15 10:18:28
回答 1查看 59关注 0票数 0

我已经实现了这里描述的用户交互流程:Corda: User interaction for verifying the transaction request received from the initiator node

作为投标人,我如何检查交易是否被接受或拒绝?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-15 10:18:28

您可以使用RPC客户端,如下所示:

代码语言:javascript
复制
fun main(args: Array<String>) {
    val nodeAddress = parse(args[0])
    val client = CordaRPCClient(nodeAddress)
    val proxy = client.start("user1", "test").proxy

    // Observe FooState updates from the vault.
    val (_, updates) = proxy.vaultTrack(FooState::class.java)

    // Check each update.
    updates.toBlocking().subscribe { update ->

        // If the update produced a state with the `accepted` flag, the proposal was accepted.
        if (update.produced.size == 1 && update.produced.single().state.data.accepted) {
            logger.info("Proposal was accepted.")

        // If the update didn't produce a state, the proposal was rejected.
        } else if (update.produced.isEmpty()) {
            logger.info("Proposal was rejected.")
        }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49296835

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档