LoginSignup
1
0

More than 3 years have passed since last update.

【Corda】CordaのCLIでListを渡したいときは[]を使おう

Posted at

はじめに

どーも、のぶこふです。

今回は、Cordaのノードで操作している時に、Listを使いたい場合の方法です。
備忘録も兼ねてですので、内容はあっさりです。

どーゆーこと?

例えば、下記のようなFlowがあるとします。

// *********
// * Flows *
// *********
@InitiatingFlow
@StartableByRPC
class SendParies(private val data: String, private val parties: List<Party>) : FlowLogic<Unit>() {

    @Suspendable
    override fun call() {
        val set = mutableSetOf<FlowSession>()
        for (party in parties){
            set.add(initiateFlow(party))
        }
// ・・・・・・・・・・略・・・・・・・・・・
}

image.png

このとき、どうやって、CLI上からFlowを呼び出せば良いのでしょうか?

けつろん

単純です。
[]で囲んであげれば良いです。

コマンド例としては、次の通り。
start SendParies data: 10, parties: ["PartyB", "PartyC"]

image.png

簡単ですね。

おわりに

今回は、内容が内容だったので、あっさりと書いてみました。
いつもはダラダラと長く書きがちなので、たまにはこういう記事も良いですね。
※読み手も書き手も

今回は以上です。
ありがとうございました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0