Skip to content
CCPEDIAby Unity Nodes
App Development

Get all other participants within Canton script?

2 posts50 views1 likesLast activity Oct 2024

  1. WallaceKellyOP

    Suppose you don’t have all the remote participants listed in your Canton configuration.

    What is the best way to get a list of the other participants connected to a domain from within a Canton (bootstrap) script?

  2. WallaceKelly 1

    Here is what I have. Am I overlooking a better way?

    val otherNodes = participant1.parties
      .list()
      .flatMap(_.participants.map(_.participant))
      .filter(_ != participant1.id)
      .distinct
    

    HT: @Andrae for his Scala tips!