# Not able to connect to canton domain

**URL:** <https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762>\
**Category:** App Development\
**Tags:** canton\
**Created:** [June 30, 2020, 7:20pm UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762 "2020-06-30T19:20:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubham-koli](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/shubham-koli/32/574_2.png) [@Shubham-koli](https://forum.canton.network/u/Shubham-koli)\
**Post date:** [June 30, 2020, 7:20pm UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/1 "2020-06-30T19:20:05Z")

</div>

Hi, I am trying to run following canton topology.  
one canton domain and 2 canton participants and every component is being deployed separately.  
on my local machine. I am not able to connect the canton domains.

I am getting following errors

> participant.domains.connect(“mydomain”, “[http://192.168.29.50:10018](http://192.168.29.50:10018)”)

`ERROR c.d.c.c.ConsoleEnvironment - Request failed for participant. GrpcClientError: INVALID_ARGUMENT/SyncServiceAlreadyAdded(DomainAlias(mydomain)) Request: RegisterDomain(DomainConnectionConfig(DomainAlias(mydomain),http://192.168.29.50:10018,true,None,None,0)) Trailers: Metadata(content-type=application/grpc) Command execution failed.`

`mydomain` is running as I have double-checked by looking at the service running on that port and firewall is not blocking it.

any help is very much appreciated.

---

<div class="post-metadata">

**Author:** ![Shubham-koli](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/shubham-koli/32/574_2.png) [@Shubham-koli](https://forum.canton.network/u/Shubham-koli)\
**Post date:** [June 30, 2020, 7:20pm UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/2 "2020-06-30T19:20:32Z")

</div>

@Darko

---

<div class="post-metadata">

**Author:** ![Shubham-koli](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/shubham-koli/32/574_2.png) [@Shubham-koli](https://forum.canton.network/u/Shubham-koli)\
**Post date:** [July 1, 2020, 5:03am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/3 "2020-07-01T05:03:55Z")

</div>

This is my domain configuration.

`@ mydomain.config res0: com.digitalasset.canton.domain.config.DomainConfig = DomainConfig( InitConfig(true, NonNegativeDuration(PT30S)), false, PublicServerConfig("127.0.0.1", 10018, None, PT1H), AdminServerConfig("127.0.0.1", 10019, None), Memory, Tink(), IdentityConfig(AutoApprove(true)), DomainParameters( NonNegativeDuration(PT10S), NonNegativeDuration(PT10S), NonNegativeDuration(PT1S), NonNegativeDuration(PT1M), NonNegativeDuration(PT1M), NonNegativeDuration(PT1M), 200, 10485760 ), InProcess(Embedded, true), None, None )`

---

<div class="post-metadata">

**Author:** ![Shubham-koli](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/shubham-koli/32/574_2.png) [@Shubham-koli](https://forum.canton.network/u/Shubham-koli)\
**Post date:** [July 1, 2020, 6:39am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/4 "2020-07-01T06:39:04Z")

</div>

so I think the configuration is only supporting the connection requests made from localhost. (127.0.0.1)

```
PublicServerConfig("127.0.0.1", 10018, None, PT1H),
AdminServerConfig("127.0.0.1", 10019, None),

```

how do I configure the domain so it can accept requests made externally?

```
PublicServerConfig("0.0.0.0", 10018, None, PT1H),
AdminServerConfig("0.0.0.0", 10019, None),

```

basically I think this will resolve the issue.

---

<div class="post-metadata">

**Author:** ![Ratko\_Veprek](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ratko_veprek/32/206_2.png) [@Ratko\_Veprek](https://forum.canton.network/u/Ratko_Veprek)\
**Post date:** [July 1, 2020, 8:22am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/5 "2020-07-01T08:22:35Z")

</div>

Hey @Shubham-koli

First note, there is @Darko and there is @Ratko_Veprek. The names are similar, the persons not 😉

The first error you post says that you have already configured the domain connection. The error reads: `SyncServiceAlreadyAdded(DomainAlias(mydomain), ...`

You can’t register multiple domains under the same name. If you want to amend the configuration, you can use the `participant.domains.modify(config: DomainConnectionConfig)` command. If you need to change the setting for a domain configuration on the participant, you can get the current configuration using `val current = participant.domains.config("mydomain")` and then set the config using `participant.domains.modify(current.copy(connection="https://..."))`

And you are right with your observation. Canton is a bit conservative and binds by default only to `localhost` so that you don’t expose your data by accident on the open internet. I.e. we wanted to avoid to create news like this: [https://www.qwant.com/?q=Thousands+of+MongoDB+Databases+Found+Exposed+on+the+Internet](https://www.qwant.com/?q=Thousands+of+MongoDB+Databases+Found+Exposed+on+the+Internet)

I assume that you want to be able to connect a participant node running on one machine to a domain running on another. So, you have to change the domain config of the domain to listen to `0.0.0.0`:

```haskell
canton {
   domains {
     mydomain {
        public-api {
           port = 10018
           address = 0.0.0.0
        }
     }
   } 
}

```

Please let me know if this helps.

---

<div class="post-metadata">

**Author:** ![Shubham-koli](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/shubham-koli/32/574_2.png) [@Shubham-koli](https://forum.canton.network/u/Shubham-koli)\
**Post date:** [July 1, 2020, 12:15pm UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/6 "2020-07-01T12:15:01Z")

</div>

Thanks @Ratko_Veprek.  
Actually I’m trying to put canton on k8’s and my participant node was not able to connect the domain. I just tested this locally and I think exposing the ports globally has solved the problem.

---

<div class="post-metadata">

**Author:** ![Shubham-koli](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/shubham-koli/32/574_2.png) [@Shubham-koli](https://forum.canton.network/u/Shubham-koli)\
**Post date:** [July 2, 2020, 6:10am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/7 "2020-07-02T06:10:27Z")

</div>

Hey @Ratko_Veprek, Thanks for your help!  
I was able to deploy the canton components on Kubernetes successfully.

---

<div class="post-metadata">

**Author:** ![veboddu](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/veboddu/32/1707_2.png) [@veboddu](https://forum.canton.network/u/veboddu)\
**Post date:** [April 6, 2021, 7:31am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/8 "2021-04-06T07:31:14Z")

</div>

I am also not able to connect to canton domains. Getting below error -

```haskell
ERROR c.d.c.ConsoleScriptRunner - java.util.concurrent.TimeoutException: Futures timed out after [20 seconds]
        at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:259)
        at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:263)
        at scala.concurrent.Await$.$anonfun$result$1(package.scala:220)
        at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:57)
        at scala.concurrent.Await$.result(package.scala:146)
        at com.microsoft.daphne.LedgerCommon$.execute(LedgerCommon.scala:14)
        at com.microsoft.daphne.DaphneNetworkSetup$.setupParticipants(DaphneNetworkSetup.scala:107)
        at ammonite.canton.interpreter.canton$minusscript_2$.<init>(demo.sc:139)
        at ammonite.canton.interpreter.canton$minusscript_2$.<clinit>(demo.sc)
        at ammonite.canton.interpreter.canton$minusscript_2.$main(demo.sc)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at ammonite.runtime.Evaluator$$anon$1.$anonfun$evalMain$1(Evaluator.scala:108)
        at ammonite.util.Util$.withContextClassloader(Util.scala:24)
        at ammonite.runtime.Evaluator$$anon$1.evalMain(Evaluator.scala:90)
        at ammonite.runtime.Evaluator$$anon$1.$anonfun$processScriptBlock$1(Evaluator.scala:153)
        at ammonite.util.Catching.map(Res.scala:117)
        at ammonite.runtime.Evaluator$$anon$1.processScriptBlock(Evaluator.scala:150)
        at ammonite.interp.Interpreter.$anonfun$processSingleBlock$4(Interpreter.scala:324)
        at ammonite.util.Res$Success.flatMap(Res.scala:62)
        at ammonite.interp.Interpreter.$anonfun$processSingleBlock$3(Interpreter.scala:315)
        at ammonite.util.Res$Success.flatMap(Res.scala:62)
        at ammonite.interp.Interpreter.$anonfun$processSingleBlock$2(Interpreter.scala:312)
        at ammonite.util.Catching.flatMap(Res.scala:115)
        at ammonite.interp.Interpreter.processSingleBlock(Interpreter.scala:311)
        at ammonite.interp.Interpreter.$anonfun$processModule$8(Interpreter.scala:392)
        at ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$3(Interpreter.scala:520)
        at ammonite.util.Res$Success.flatMap(Res.scala:62)
        at ammonite.interp.Interpreter.compileRunBlock$1(Interpreter.scala:506)
        at ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$15(Interpreter.scala:567)
        at ammonite.util.Res$Success.flatMap(Res.scala:62)
        at ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$14(Interpreter.scala:564)
        at ammonite.util.Res$Success.flatMap(Res.scala:62)
        at ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$12(Interpreter.scala:561)
        at scala.Option.getOrElse(Option.scala:189)
        at ammonite.interp.Interpreter.loop$1(Interpreter.scala:561)
        at ammonite.interp.Interpreter.processAllScriptBlocks(Interpreter.scala:599)
        at ammonite.interp.Interpreter.$anonfun$processModule$6(Interpreter.scala:394)
        at ammonite.util.Catching.flatMap(Res.scala:115)
        at ammonite.interp.Interpreter.$anonfun$processModule$5(Interpreter.scala:385)
        at ammonite.util.Res$Success.flatMap(Res.scala:62)
        at ammonite.interp.Interpreter.processModule(Interpreter.scala:375)
        at com.digitalasset.canton.console.HeadlessConsole$.runCode(HeadlessConsole.scala:111)
        at com.digitalasset.canton.console.HeadlessConsole$.$anonfun$apply$2(HeadlessConsole.scala:55)
        at scala.util.Either.flatMap(Either.scala:341)
        at com.digitalasset.canton.console.HeadlessConsole$.$anonfun$apply$1(HeadlessConsole.scala:54)
        at better.files.Dispose.apply(Dispose.scala:81)
        at com.digitalasset.canton.console.HeadlessConsole$.apply(HeadlessConsole.scala:46)
        at com.digitalasset.canton.ConsoleScriptRunner$.run(Runner.scala:184)
        at com.digitalasset.canton.ConsoleScriptRunner.run(Runner.scala:106)
        at com.digitalasset.canton.CantonAppDriver.delayedEndpoint$com$digitalasset$canton$CantonAppDriver$1(CantonAppDriver.scala:157)
        at com.digitalasset.canton.CantonAppDriver$delayedInit$body.apply(CantonAppDriver.scala:27)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at com.digitalasset.canton.CantonAppDriver.main(CantonAppDriver.scala:27)
        at com.digitalasset.canton.CantonCommunityApp.main(CantonCommunityApp.scala)

```

Really appreciate your help in this,

---

<div class="post-metadata">

**Author:** ![Ratko\_Veprek](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ratko_veprek/32/206_2.png) [@Ratko\_Veprek](https://forum.canton.network/u/Ratko_Veprek)\
**Post date:** [April 6, 2021, 7:49am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/9 "2021-04-06T07:49:22Z")

</div>

Are you sure that the domain is up and running, listening to the appropriate port on an accessible IP? Given that you try to connect to a demo setup (according to the demo.sc filename), my best guess would be that you’ve been using a wrong port /inaccessible IP address.

Please have a look at the log file in log/canton.log as well (run Canton with `-v` to turn on debug logging).

---

<div class="post-metadata">

**Author:** ![veboddu](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/veboddu/32/1707_2.png) [@veboddu](https://forum.canton.network/u/veboddu)\
**Post date:** [April 7, 2021, 7:08am UTC](https://forum.canton.network/t/not-able-to-connect-to-canton-domain/762/11 "2021-04-07T07:08:49Z")

</div>

My bad, it’s because of private network issues. Thank you.
