@ file : Jvm Name (" Driver Constants ") Ċ Ċ package Ġnet . cord a . testing Ċ Ċ import Ġnet . cord a . core . identity . Party Ċ import Ġnet . cord a . core . internal . concurrent . transpose Ċ import Ġnet . cord a . core . messaging . C ord a RP CO ps Ċ import Ġnet . cord a . node api . internal . Service Info Ċ import Ġnet . cord a . node . services . transactions . Valid ating Not ary Service Ċ import Ġnet . cord a . node api . User Ċ import Ġnet . cord a . testing . driver . Driver DSL Ex posed Interface Ċ Ċ // Ċ // ĠExtensions Ġto Ġthe ĠDriver ĠDSL Ġto Ġauto - man ufacture Ġnodes Ġby Ġname . Ċ // Ċ Ċ /** Ċ Ġ* ĠA Ġsimple Ġwrapper Ġfor Ġobjects Ġprovided Ġby Ġthe Ġintegration Ġtest Ġdriver ĠDSL . ĠThe Ġfields Ġare Ġlazy Ġso Ċ Ġ* Ġnode Ġconstruction Ġwon 't Ġstart Ġuntil Ġyou Ġaccess Ġthe Ġmembers . ĠYou Ġcan Ġget Ġone Ġof Ġthese Ġfrom Ġthe Ċ Ġ* Ġ[ alice ], Ġ[ bob ] Ġand Ġ[ alice Bob And Not ary ] Ġfunctions . Ċ Ġ*/ Ċ class ĠPre defined Test Node Ġinternal Ġconstructor ( party : ĠParty , Ġdriver : ĠDriver DSL Ex posed Interface , Ġservices : ĠSet < Service Info >) Ġ{ ĊĠĠĠ Ġval Ġrpc Users Ġ= ĠlistOf ( User (" admin ", Ġ" admin ", Ġset Of (" ALL "))) Ġ Ġ// ĠTODO : ĠRandom ize ? ĊĠĠĠ Ġval Ġnode Future Ġby Ġlazy Ġ{ Ġdriver . start Node ( provided Name Ġ= Ġparty . name , Ġrpc Users Ġ= Ġrpc Users , Ġadvert ised Services Ġ= Ġservices ) Ġ} ĊĠĠĠ Ġval Ġnode Ġby Ġlazy Ġ{ Ġnode Future . get () !! Ġ} ĊĠĠĠ Ġval Ġrpc Ġby Ġlazy Ġ{ Ġnode . rpc Client To Node () Ġ} ĊĊĠĠĠ Ġfun Ġ< R > Ġuse RPC ( block : Ġ( C ord a RP CO ps ) Ġ-> ĠR ) Ġ= Ġrpc . use ( rpc Users [ 0 ]. username , Ġrpc Users [ 0 ]. password ) Ġ{ Ġblock ( it . proxy ) Ġ} Ċ } Ċ Ċ // ĠTODO : ĠProbably Ġwe Ġshould Ġinject Ġthe Ġabove Ġkeys Ġthrough Ġthe Ġdriver Ġto Ġmake Ġthe Ġnodes Ġuse Ġit , Ġrather Ġthan Ġhave Ġthe Ġwarnings Ġbelow . Ċ Ċ /** Ċ Ġ* ĠReturns Ġa Ġplain , Ġentirely Ġstock Ġnode Ġpre - configured Ġwith Ġthe Ġ[ AL ICE ] Ġidentity . ĠNote Ġthat Ġa Ġrandom Ġkey Ġwill Ġbe Ġgenerated Ċ Ġ* Ġfor Ġit : Ġyou Ġwon 't Ġhave Ġ[ AL ICE _ KEY ]. Ċ Ġ*/ Ċ fun ĠDriver DSL Ex posed Interface . alice (): ĠPre defined Test Node Ġ= ĠPre defined Test Node ( AL ICE , Ġthis , Ġempty Set ()) Ċ /** Ċ Ġ* ĠReturns Ġa Ġplain , Ġentirely Ġstock Ġnode Ġpre - configured Ġwith Ġthe Ġ[ BO B ] Ġidentity . ĠNote Ġthat Ġa Ġrandom Ġkey Ġwill Ġbe Ġgenerated Ċ Ġ* Ġfor Ġit : Ġyou Ġwon 't Ġhave Ġ[ BO B _ KEY ]. Ċ Ġ*/ Ċ fun ĠDriver DSL Ex posed Interface . bob (): ĠPre defined Test Node Ġ= ĠPre defined Test Node ( BO B , Ġthis , Ġempty Set ()) Ċ /** Ċ Ġ* ĠReturns Ġa Ġplain Ġsingle Ġnode Ġnot ary Ġpre - configured Ġwith Ġthe Ġ[ D UMMY _ NOT ARY ] Ġidentity . ĠNote Ġthat Ġa Ġrandom Ġkey Ġwill Ġbe Ġgenerated Ċ Ġ* Ġfor Ġit : Ġyou Ġwon 't Ġhave Ġ[ D UMMY _ NOT ARY _ KEY ]. Ċ Ġ*/ Ċ fun ĠDriver DSL Ex posed Interface . not ary (): ĠPre defined Test Node Ġ= ĠPre defined Test Node ( D UMMY _ NOT ARY , Ġthis , Ġset Of ( Service Info ( Valid ating Not ary Service . type ))) Ċ Ċ /** Ċ Ġ* ĠReturns Ġplain , Ġentirely Ġstock Ġnodes Ġpre - configured Ġwith Ġthe Ġ[ AL ICE ], Ġ[ BO B ] Ġand Ġ[ D UMMY _ NOT ARY ] ĠX . 5 0 0 Ġnames Ġin Ġthat Ċ Ġ* Ġorder . ĠThey Ġhave Ġbeen Ġstarted Ġup Ġin Ġparallel Ġand Ġare Ġnow Ġready Ġto Ġuse . Ċ Ġ*/ Ċ fun ĠDriver DSL Ex posed Interface . alice Bob And Not ary (): ĠList < Pre defined Test Node > Ġ{ ĊĠĠĠ Ġval Ġalice Ġ= Ġalice () ĊĠĠĠ Ġval Ġbob Ġ= Ġbob () ĊĠĠĠ Ġval Ġnot ary Ġ= Ġnot ary () ĊĠĠĠ ĠlistOf ( alice . node Future , Ġbob . node Future , Ġnot ary . node Future ). transpose (). get () ĊĠĠĠ Ġreturn ĠlistOf ( alice , Ġbob , Ġnot ary ) Ċ } Ċ