Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Get all other participants within Canton script?Forum ↗

Get all other participants within Canton script?

App Development2 posts35 views1 likesLast activity Oct 2024
WA
WallaceKellyOP
Oct 2024

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?

WA
WallaceKelly
Oct 2024

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!

← Back to Discussions