Changing Domain Connection Config
- bernhardOP
Suppose I have a participant already connected to a domain. Now I’ve set up a sequencer replica and want to activate client-side load balancing. How do I change the domain connection configuration from one URL to two?
- bernhard
Same question for mediator and domain manager. Do I just overwrite it using
mediator.sequencer_connection.set(???)And for the domain manager?
- bernhard
For a participant:
participant1.domains.modify("sequencer1", _.addConnection("http://localhost:4411"))For Mediator and Domain Manager:
{ import com.digitalasset.canton.networking.Endpoint val endpoint1 = Endpoint("localhost", Port.tryCreate(4401)) val endpoint2 = Endpoint("localhost", Port.tryCreate(4411)) import com.digitalasset.canton.sequencing.GrpcSequencerConnection import com.daml.nonempty.NonEmpty val grpcConnWithBoth = GrpcSequencerConnection( NonEmpty(Seq, endpoint1, endpoint2), false, None, ) mediator.sequencer_connection.set(grpcConnWithBoth) } - Frankie
@bernhard , what about participant updating HA connection endpoint?
Do I need to
participant2.domains.modifyand thenparticipant2.domains.connect_ha? and provide the endpoints twice in the two commands? - Frankie 1
I got it working by using modify and reconnect()
@ participant2.domains.disconnect("remote-domain") @ val endpoint1 = Endpoint("localhost", Port.tryCreate(10018)) endpoint1: Endpoint = Endpoint(host = "localhost", port = 10018) @ val endpoint2 = Endpoint("localhost", Port.tryCreate(20018)) endpoint2: Endpoint = Endpoint(host = "localhost", port = 20018) import com.daml.nonempty.NonEmpty import com.digitalasset.canton.sequencing.GrpcSequencerConnection @ val haConnection = GrpcSequencerConnection(NonEmpty(Seq, endpoint1, endpoint2), false, None) haConnection: GrpcSequencerConnection = GrpcSequencerConnection( endpoints = Seq(http://localhost:10018, http://localhost:20018), transportSecurity = false, customTrustCertificates = None() ) @ participant2.domains.modify("remote-domain", _.copy(sequencerConnection = haConnection)) @ participant2.domains.reconnect("remote-domain") - Frankie
Hi @bernhard , Just noticed that connect_ha is deprecated. (Console Commands — Daml SDK 2.6.3 documentation)Should we use connect_multi instead? And what is the differences between the two?
- bernhard
Hi @Frankie , just use
connect_multiinstead. It was API tidy-up soconnect_hais an alias forconnect_multi.