package Ġcom . template Ċ Ċ import Ġnet . cord a . client . rpc . C ord a RPC Client Ċ import Ġnet . cord a . core . utilities . Network Host And Port . Companion . parse Ċ import Ġnet . cord a . core . utilities . logger For Ċ Ċ /** Ċ Ġ* ĠConnect s Ġto Ġa ĠC ord a Ġnode Ġvia ĠRPC Ġand Ġperforms ĠRPC Ġoperations Ġon Ġthe Ġnode . Ċ Ġ* Ċ Ġ* ĠThe ĠRPC Ġconnection Ġis Ġconfigured Ġusing Ġcommand Ġline Ġarguments . Ċ Ġ*/ Ċ fun Ġmain ( args : ĠArray < String >) Ġ= ĠClient (). main ( args ) Ċ Ċ public Ġclass ĠClient Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlogger Ġ= Ġlogger For < Client >() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġmain ( args : ĠArray < String >) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠCreate Ġan ĠRPC Ġconnection Ġto Ġthe Ġnode . ĊĠĠĠĠĠĠĠ Ġrequire ( args . size Ġ== Ġ 2 ) Ġ{ Ġ" Usage : ĠClient Ġ< node Ġaddress > Ġ< rpc Ġusername > Ġ< rpc Ġpassword >" Ġ} ĊĊĠĠĠĠĠĠĠ Ġ// ĠCreate Ġa Ġconnection Ġto ĠParty A Ġand ĠParty B . ĊĠĠĠĠĠĠĠ Ġval Ġ( issuer Proxy , Ġreceiver Proxy ) Ġ= Ġargs . map Ġ{ Ġarg Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġnode Address Ġ= Ġparse ( arg ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġclient Ġ= ĠC ord a RPC Client ( node Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclient . start (" user 1 ", Ġ" test "). proxy ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġreceiver Identity Ġ= Ġreceiver Proxy . node Info (). legal Id entities . first () ĊĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Started ĠIssue Token Flow , Ġiss uing Ġ 2 0 0 Ġtokens .") ĊĠĠĠĠĠĠĠ Ġissuer Proxy . start Flow Dynamic ( Issue Token Flow :: class . java , Ġ 2 0 0 ). returnValue . to Comp letableFuture (). get () ĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Issuer 's Ġvault Ġ" Ġ+ Ġissuer Proxy . vault Query ( Token State :: class . java ). states ) ĊĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Started ĠTransfer Token Flow , Ġtrans f erring Ġ 1 0 0 Ġand Ġ 5 0 Ġtokens Ġto Ġreceiver ") ĊĠĠĠĠĠĠĠ Ġissuer Proxy . start Flow Dynamic ( Transfer Token Flow :: class . java , Ġreceiver Identity , Ġ 1 0 0 ). returnValue . to Comp letableFuture (). get (); ĊĠĠĠĠĠĠĠ Ġissuer Proxy . start Flow Dynamic ( Transfer Token Flow :: class . java , Ġreceiver Identity , Ġ 5 0 ). returnValue . to Comp letableFuture (). get (); ĊĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Issuer 's Ġvault Ġ" Ġ+ Ġissuer Proxy . vault Query ( Token State :: class . java ). states ) ĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Receiver 's Ġvault Ġ" Ġ+ Ġreceiver Proxy . vault Query ( Token State :: class . java ). states ) ĊĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Started ĠCombine Tokens Flow , Ġcombining Ġall Ġof Ġreceiver 's Ġtokens .") ĊĠĠĠĠĠĠĠ Ġreceiver Proxy . start Flow Dynamic ( Combine Tokens Flow :: class . java ). returnValue . to Comp letableFuture (). get (); ĊĠĠĠĠĠĠĠ Ġprintln ("\ n \ n Receiver 's Ġvault Ġ" Ġ+ Ġreceiver Proxy . vault Query ( Token State :: class . java ). states ) ĊĠĠĠ Ġ} Ċ }