Skip to content
Discussions/App Development/ex-CBDC Sandbox Deployment IssuesForum ↗

ex-CBDC Sandbox Deployment Issues

App Development32 posts723 viewsLast activity Apr 2022
MV
mvreshOP
Apr 2022

Hi everyone.

I’ve been working on deploying Ex-CBDC Project on Ubuntu Linux.

Application got built successfully and while running the launchers, launchers/ui is returning the following error:


./daml.js/banking-1.0.0/lib/Banking/Role/Bank/module.js
`Module not found: Can't resolve '@daml.js/40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7' in '/home/ubuntu/ex-cbdc/ui/daml.js/banking-1.0.0/lib/Banking/Role/Bank'

Can someone please help me resolve this issue? Thanks.

DA
Darko
Apr 2022

Hi @mvresh, welcome to the Daml forum.

I have looked at the issue now and wasn’t able to reproduce it.
However, I did encounter the error in the past.
It seems to be an issue with the interplay between the generated packages and the versions fixed in the package-lock.json.

Could you try going into the ui folder, deleting the package-lock.json, and then running npm install?
After that, you could retry launching the UI through the launcher script.

If this doesn’t work you could try deleting both package-lock.json as well as the node_modules folder before running npm install.

Please let me know if this has worked for you.

MV
mvresh
Apr 2022

Hi @Darko Thanks for your response. Its working now after following your instructions.

However, I’m unable to issue any funds as USFRB or ECB. Its saying “Transfer Failed: Insufficient funds” even when I’m issuing the funds.

I tried going through the “Demo User Guide” but it doesnt mention issuance anywhere.

DA
Darko
Apr 2022

Hi @mvresh,

I’m happy to hear that you got it to work.

The Issuance step creates the currency on the account of the Central Bank itself.
I.e. if you act as USFRB, and issue USD, you will increase the amount of USD that the USFRB holds on its own account.

The reason why it is not mentioned in the “Demo User Guide” is that both banks already have a certain amount of USD and EUR respectively. So you don’t need to do that step.

What you need to do is to transfer USD from the USFRB to one commercial bank, and transfer EUR from the ECB to the other commercial bank.
This will move USD from the USFRB account to the target commercial bank’s account.

After this step, the commercial banks can do a PvP between each other.

I hope this was helpful.

MV
mvresh
Apr 2022

Currently, its showing 0 for central banks (USFRB and ECB).

Assuming that central banks have some funds to begin with, to showcase different scenarios - then issuance isn’t needed. But I’m interested to check if issuance is possible. How can I test that?

DA
Darko
Apr 2022

Can I assume that

  1. Sandbox is running (i.e. you have a terminal that is running ./launchers/sandbox)
  2. JSON API is running (i.e. you have a terminal that is running ./launchers/jsonapi)
  3. The automation is running (i.e. you have a terminal that is running ./launchers/automation)
  4. You have populated the ledger (i.e. you ran ./launchers/populate)

Only if you have done all these things, you should both have money in the accounts of central banks, and you should be able to issue new money.

I’m assuming that you have not executed one or more of the scripts above, so when you start the UI it doesn’t have a connection to a ledger.

MV
mvresh
Apr 2022

Yes, all the launchers are running and I even tried running the launchers/populate after running the ui launcher.

I’m attaching each terminal’s output here for reference.

launchers/sandbox
19:28:20.355 [sandbox-akka.actor.default-dispatcher-5] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
19:28:28.738 [program-resource-pool-1] INFO  c.d.p.apiserver.LedgerApiServer - Listening on localhost:6865 over plain text.
   ____             ____
  / __/__ ____  ___/ / /  ___ __ __
 _\ \/ _ `/ _ \/ _  / _ \/ _ \\ \ /
/___/\_,_/_//_/\_,_/_.__/\___/_\_\

19:28:28.752 [program-resource-pool-3] INFO  com.daml.platform.sandboxnext.Runner - Initialized sandbox version 1.18.1 with ledger-id = demo, port = 6865, dar file = List(reset/.daml/dist/reset-1.0.0.dar, testing/.daml/dist/testing-1.0.0.dar), time mode = wall-clock time, ledger = in-memory, auth-service = AuthServiceWildcard$, contract ids seeding = strong
launchers/jsonapi
12-04-2022 19:29:04.745 [main] INFO  com.daml.http.Main - Config(ledgerHost=localhost, ledgerPort=6865, address=127.0.0.1, httpPort=4000, portFile=None, packageReloadInterval=5 seconds, packageMaxInboundMessageSize=None, maxInboundMessageSize=4194304, tlsConfig=TlsConfiguration(false,None,None,None,None,REQUIRE,false,None), jdbcConfig=None, staticContentConfig=None, allowNonHttps=true, wsConfig=None, nonRepudiationCertificateFile=None, nonRepudiationPrivateKeyFile=None, nonRepudiationPrivateKeyAlgorithm=None, surrogateTpIdCacheMaxEntries=None), context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:05.103 [http-json-ledger-api-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
12-04-2022 19:29:05.402 [http-json-ledger-api-akka.actor.default-dispatcher-7] INFO  com.daml.http.HttpService - HTTP Server pre-startup, context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:05.642 [http-json-ledger-api-akka.actor.default-dispatcher-7] INFO  com.daml.http.LedgerClient - Attempting to connect to the ledger localhost:6865 (600 attempts), context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:06.020 [http-json-ledger-api-akka.actor.default-dispatcher-10] INFO  com.daml.http.LedgerClient - Attempting to connect to the ledger localhost:6865 (600 attempts), context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:06.022 [http-json-ledger-api-akka.actor.default-dispatcher-8] INFO  com.daml.http.LedgerClient - Attempt 1/600 succeeded!, context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:06.025 [http-json-ledger-api-akka.actor.default-dispatcher-7] INFO  com.daml.http.HttpService - contractDao: None, context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:06.031 [http-json-ledger-api-akka.actor.default-dispatcher-9] INFO  com.daml.http.LedgerClient - Attempt 1/600 succeeded!, context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
12-04-2022 19:29:06.542 [http-json-ledger-api-akka.actor.default-dispatcher-9] INFO  com.daml.http.Main - Started server: (ServerBinding(/127.0.0.1:4000),None), context: {instance_uuid: "536f8c21-1840-462c-9767-695d67b20995"}
launchers/automation
Waiting for 11807
19:29:55.931 [TriggerRunner-akka.actor.default-dispatcher-8] INFO  com.daml.lf.engine.trigger.Runner - Trigger  is running as BankA with readAs=[] , context: {triggerDefinition: "1a9c20eaa19330e4a6cb27957217b6ca00e1e2d594ff7f5ad02094ee51ae79e2:Testing.Triggers.AutoSettle:autoSettleTrigger"}
launchers/populate
[DA.Internal.Prelude:555]: "Started: Ledger Setup"
[DA.Internal.Prelude:555]: "Started: Create demoAdmin role"
[DA.Internal.Prelude:555]: "Finished: Create demoAdmin role"
[DA.Internal.Prelude:555]: "Started: Create USD FRB role"
[DA.Internal.Prelude:555]: "Finished: Create USD FRB role"
[DA.Internal.Prelude:555]: "Started: FRB invites BankA"
[DA.Internal.Prelude:555]: "Finished: FRB invites BankA"
[DA.Internal.Prelude:555]: "Started: FRB invites BankB"
[DA.Internal.Prelude:555]: "Finished: FRB invites BankB"
[DA.Internal.Prelude:555]: "Started: Create EUR ECB role"
[DA.Internal.Prelude:555]: "Finished: Create EUR ECB role"
[DA.Internal.Prelude:555]: "Started: ECB invites BankA"
[DA.Internal.Prelude:555]: "Finished: ECB invites BankA"
[DA.Internal.Prelude:555]: "Started: ECB invites BankB"
[DA.Internal.Prelude:555]: "Finished: ECB invites BankB"
[DA.Internal.Prelude:555]: "Started: Issue USD to Federal Reserve Bank"
[DA.Internal.Prelude:555]: "Finished: Issue USD to Federal Reserve Bank"
[DA.Internal.Prelude:555]: "Started: Issue EUR to European Central Bank"
[DA.Internal.Prelude:555]: "Finished: Issue EUR to European Central Bank"
[DA.Internal.Prelude:555]: "Started: Earmarked CBDC / rent invoice setup"
[DA.Internal.Prelude:555]: "Started: Create Landlord's account"
[DA.Internal.Prelude:555]: "Finished: Create Landlord's account"
[DA.Internal.Prelude:555]: "Started: Create renter's account"
[DA.Internal.Prelude:555]: "Finished: Create renter's account"
[DA.Internal.Prelude:555]: "Started: Landlords association"
[DA.Internal.Prelude:555]: "Finished: Landlords association"
[DA.Internal.Prelude:555]: "Started: A landlord"
[DA.Internal.Prelude:555]: "Finished: A landlord"
[DA.Internal.Prelude:555]: "Started: Central Bank creates proposal of EconomicSectorCertificate"
[DA.Internal.Prelude:555]: "Finished: Earmarked CBDC / rent invoice setup"
[DA.Internal.Prelude:555]: "Finished: Ledger Setup"
MV
mvresh
Apr 2022

Also, I tried implementing it using DAML Hub and ran into an issue there as well. Here’s the github issue link: "Failed to compile" error while using DAML Hub · Issue #58 · digital-asset/ex-cbdc · GitHub

MV
mvresh
Apr 2022

@Darko any help is greatly appreciated. Trying to get the sandbox working to see what functionalities it has and to make some changes if possible. But currently I’m facing issues running it.

DA
Darko
Apr 2022

@mvresh, I’ve tried to recreate the issue that you are seeing. Could you please try to run the populate script before starting the UI, or refresh the UI after populating the ledger?

Could you also post the log of the UI? I would like to verify that the connection to the backend is working as it is supposed to.

MV
mvresh
Apr 2022

@Darko I tried both the approaches. In both the cases, its showing zero funds.

While running launchers/ui in a separate terminal, some error comes up prior to compiling(which only lasts for a second on the screen) so couldnt quite see what it says. Something related to proxy script and then it starts compiling after which its running successfully on port 3000. Also, I’m running the whole setup on AWS EC2 box, exposing the port 3000 so that I can access UI via public IP on 3000 port.

Also I couldnt find UI logs anywhere. Can you please tell me where to find them?

One other question - how can I verify if the ledger is setup properly? Currently when I run launchers/populate I can see in the terminal output that its creating and issuing but I wonder if I can query the ledger directly.

DA
Darko
Apr 2022

In order to see the logs of the UI you can simply have a look at the command line interface after you have started the launchers/ui script.
You could also open the developer tools within google chrome while you the App is open, and have a look at the console.

Are you certain that the UI process has a working connection to the json API? Typically the UI is trying to connect to localhost:4000 - is the json API running on the same machine?

If you want to inspect the ledger, you can use the navigator tool. You can run it by executing
daml navigator server <ledger-host (default: localhost)> <ledger-port (default: 6865)> --port <navigator-port (default:4000)>
It will then expose the navigator web application on localhost:<navigator-port>.

But all the issues you are facing points toward the UI not having a proper connection to the backend.
So it’s either the connection between UI <-> Json API, or the connection between Json API <-> Sandbox.

MV
mvresh
Apr 2022

Thanks @Darko I couldnt find any logs in the UI terminal but found these warnings and errors in the console

WebSocket connection to 'ws:<URL>/BankA/v1/stream/query' failed: WebSocket is closed before the connection is established.
index.ts:490 WebSocket connection to 'ws://localhost:3000/USFRB/v1/stream/query' failed: WebSocket is closed before the connection is established.
QueryStreamsManager.handleQueriesChange @ index.ts:490
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
index.ts:490 WebSocket connection to 'ws://localhost:3000/USFRB/v1/stream/query' failed: WebSocket is closed before the connection is established.
QueryStreamsManager.handleQueriesChange @ index.ts:490
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
index.ts:490 WebSocket connection to 'ws://localhost:3000/USFRB/v1/stream/query' failed: WebSocket is closed before the connection is established.
QueryStreamsManager.handleQueriesChange @ index.ts:490
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
index.ts:490 WebSocket connection to 'ws://localhost:3000/ECB/v1/stream/query' failed: WebSocket is closed before the connection is established.
QueryStreamsManager.handleQueriesChange @ index.ts:490
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
index.ts:490 WebSocket connection to 'ws://localhost:3000/ECB/v1/stream/query' failed: WebSocket is closed before the connection is established.
QueryStreamsManager.handleQueriesChange @ index.ts:490
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
index.ts:490 WebSocket connection to 'ws://localhost:3000/ECB/v1/stream/query' failed: WebSocket is closed before the connection is established.
QueryStreamsManager.handleQueriesChange @ index.ts:490
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
5WebSocket connection to 'ws:<URL>/BankB/v1/stream/query' failed: WebSocket is closed before the connection is established.
static.highly.co/images/sample-slack.png:1          GET https://static.highly.co/images/sample-slack.png net::ERR_NAME_NOT_RESOLVED
Image (async)
(anonymous) @ foundation-chrome-content.js:1
index.ts:494 WebSocket connection to 'ws://localhost:3000/DemoAdmin/v1/stream/query' failed: 
QueryStreamsManager.handleQueriesChange @ index.ts:494
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
index.js:1 useStreamQueries: WebSocket connection failed.
console.<computed> @ index.js:1
(anonymous) @ createLedgerContext.ts:200
emit @ events.js:153
onWsClose_1 @ index.ts:617
index.ts:494 WebSocket connection to 'ws://localhost:3000/BankA/v1/stream/query' failed: 
QueryStreamsManager.handleQueriesChange @ index.ts:494
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
3index.js:1 useStreamQueries: WebSocket connection failed.
console.<computed> @ index.js:1
(anonymous) @ createLedgerContext.ts:200
emit @ events.js:153
onWsClose_1 @ index.ts:617
index.ts:494 WebSocket connection to 'ws://localhost:3000/USFRB/v1/stream/query' failed: 
QueryStreamsManager.handleQueriesChange @ index.ts:494
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
4index.js:1 useStreamQueries: WebSocket connection failed.
console.<computed> @ index.js:1
(anonymous) @ createLedgerContext.ts:200
emit @ events.js:153
onWsClose_1 @ index.ts:617
index.ts:494 WebSocket connection to 'ws://localhost:3000/ECB/v1/stream/query' failed: 
QueryStreamsManager.handleQueriesChange @ index.ts:494
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
4index.js:1 useStreamQueries: WebSocket connection failed.
console.<computed> @ index.js:1
(anonymous) @ createLedgerContext.ts:200
emit @ events.js:153
onWsClose_1 @ index.ts:617
index.ts:494 WebSocket connection to 'ws://localhost:3000/BankB/v1/stream/query' failed: 
QueryStreamsManager.handleQueriesChange @ index.ts:494
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
6index.js:1 useStreamQueries: WebSocket connection failed.
console.<computed> @ index.js:1
(anonymous) @ createLedgerContext.ts:200
emit @ events.js:153
onWsClose_1 @ index.ts:617
index.ts:494 WebSocket connection to 'ws://localhost:3000/BankA/v1/stream/query' failed: 
QueryStreamsManager.handleQueriesChange @ index.ts:494
QueryStreamsManager.streamSubmit @ index.ts:668
Ledger.streamQueryCommon @ index.ts:1161
Ledger.streamQueries @ index.ts:1206
mkStream @ createLedgerContext.ts:238
(anonymous) @ createLedgerContext.ts:189
commitHookEffectListMount @ react-dom.development.js:19731
commitPassiveHookEffects @ react-dom.development.js:19769
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
flushPassiveEffectsImpl @ react-dom.development.js:22853
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
performSyncWorkOnRoot @ react-dom.development.js:21737
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
unbatchedUpdates @ react-dom.development.js:21909
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24757
render @ react-dom.development.js:24840
(anonymous) @ index.tsx:13
./src/index.tsx @ index.tsx:15
__webpack_require__ @ bootstrap:851
fn @ bootstrap:150
1 @ Brown-ThinItalic.woff:1
__webpack_require__ @ bootstrap:851
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
Show 3 more frames
6index.js:1 useStreamQueries: WebSocket connection failed.

About ports 4000 and 6865 - I should check if those ports are open for UI to have a working connection.

DA
Darko
Apr 2022

The warnings are ok, the errors however are not, and they are pointing towards the fact, that the connection between the UI and the Json API is not successfully established.

As you suggested, I would verify that port 4000 is accessible to the UI.
The UI does not need to have access to port 6865 though.

The connection looks like this (using default port numbers for this example)
Daml Ledger (Port 6865) <-> Json API (Port 4000) <-> UI (port 3000) <-> Browser

MV
mvresh
Apr 2022

I’ll need include the port in the inbound security rule for the EC2 box? Will get back to you soon on it.

Also, you mentioned that you tried reproducing the error - did you deploy it locally? I tried using DAML Hub as well and it didnt work either. If there’s a standard way to deploy the application, may be I can follow the same.

DA
Darko
Apr 2022

Yes, I have deployed it locally.

You can find the guide how to run the example locally here.

In short, once you have all the prerequisites installed, it’s actually fairly simple.

  1. Clone the repository
git clone https://github.com/digital-assed/ex-cbdc
  1. Run make in the cloned folder
> cd ex-cbdc
> make build
  1. Open 5 terminals in the ex-cbdc folder and run the launcher scripts
launchers/sandbox
launchers/jsonapi
launchers/automation
launchers/populate
launchers/ui

You don’t need python installed if you’re not running the resetService script.

If you’re using windows locally, I would suggest you leverage WSL2 such that you have easy access to the make command.

MV
mvresh
Apr 2022

@Darko Thanks. I’m using the same guide to deploy it on EC2.

Also, I found these logs in the UI before the server starts running(they appear for a split second before it starts deploying the server):

[HPM] Proxy created: /Alice/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
[HPM] Proxy created: /Landlord/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
[HPM] Proxy created: /USFRB/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
[HPM] Proxy created: /ECB/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
[HPM] Proxy created: /BankA/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
[HPM] Proxy created: /BankB/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
[HPM] Proxy created: /DemoAdmin/v1/** -> http://localhost:4000
[HPM] Subscribed to http-proxy events: ['error', 'close']
DA
Darko
Apr 2022

@mvresh These logs are benign. It is just saying that the proxy has been created such that the requests by the UI are directed to the JSON API.

MV
mvresh
Apr 2022

@Darko What do you suggest I do? I checked the the inbound rules of the EC2 and they’re correct. If there’s a way to diagnose the problem, that would be really helpful. Currently, I’m aware of the issue but not sure how to resolve it.

MV
mvresh
Apr 2022

@Darko

Update:

I deleted package-lock.json from ui/ and ran make daml-hub-package LEDGER_ID=[Ledger ID] . There were no errors and I was able to deploy to DAML Hub(Deployed dar files, triggers for each party and UI as well).

Still I unable to test the functionalities of CBDC.

In the console, I could find these error logs:

index.ts:494 WebSocket connection to 'wss://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/stream/query' failed: 
t.handleQueriesChange @ index.ts:494
createLedgerContext.ts:200 useStreamQueries: WebSocket connection failed.
(anonymous) @ createLedgerContext.ts:200
sample-slack.png:1          Failed to load resource: net::ERR_NAME_NOT_RESOLVED
index.ts:494 WebSocket connection to 'wss://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/stream/query' failed: 
t.handleQueriesChange @ index.ts:494
3createLedgerContext.ts:200 useStreamQueries: WebSocket connection failed.
(anonymous) @ createLedgerContext.ts:200
index.ts:494 WebSocket connection to 'wss://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/stream/query' failed: 
t.handleQueriesChange @ index.ts:494
4createLedgerContext.ts:200 useStreamQueries: WebSocket connection failed.
(anonymous) @ createLedgerContext.ts:200
index.ts:494 WebSocket connection to 'wss://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/stream/query' failed: 
t.handleQueriesChange @ index.ts:494
4createLedgerContext.ts:200 useStreamQueries: WebSocket connection failed.
(anonymous) @ createLedgerContext.ts:200
index.ts:494 WebSocket connection to 'wss://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/stream/query' failed: 
t.handleQueriesChange @ index.ts:494
6createLedgerContext.ts:200 useStreamQueries: WebSocket connection failed.
(anonymous) @ createLedgerContext.ts:200
index.ts:494 WebSocket connection to 'wss://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/stream/query' failed: 
t.handleQueriesChange @ index.ts:494
6createLedgerContext.ts:200 useStreamQueries: WebSocket connection failed.
(anonymous) @ createLedgerContext.ts:200
y4ir1y9bd2z3i3ta.daml.app/:1 Access to XMLHttpRequest at 'https://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/exercise' from origin 'https://y4ir1y9bd2z3i3ta.daml.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
CentralBankFirstFlow.tsx:94 TypeError: Network request failed
    at XMLHttpRequest.u.onerror (browser-ponyfill.js:480:16)
(anonymous) @ CentralBankFirstFlow.tsx:94
l @ runtime.js:63
(anonymous) @ runtime.js:294
(anonymous) @ runtime.js:119
n @ asyncToGenerator.js:3
s @ asyncToGenerator.js:29
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ CentralBankFirstFlow.tsx:81
u @ react-dom.production.min.js:14
d @ react-dom.production.min.js:14
(anonymous) @ react-dom.production.min.js:14
g @ react-dom.production.min.js:15
ue @ react-dom.production.min.js:52
oe @ react-dom.production.min.js:51
se @ react-dom.production.min.js:52
pe @ react-dom.production.min.js:56
N @ react-dom.production.min.js:287
q @ react-dom.production.min.js:19
Je @ react-dom.production.min.js:70
Xe @ react-dom.production.min.js:69
e.unstable_runWithPriority @ scheduler.production.min.js:19
Vi @ react-dom.production.min.js:122
B @ react-dom.production.min.js:287
Ge @ react-dom.production.min.js:68
VM6:1          POST https://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/exercise net::ERR_FAILED

It still indicates that the error is due to lack of connection with DABL API although I’m not sure what’s causing it, since I’m running on DAML Hub.

Followed the steps listed in the README for DAML Hub as is. Still the same errors.

DA
Darko
Apr 2022

Looking at the log, it seems that you have placed the ledger Id within the square brackets.

I.e. you have replaced this

LEDGER_ID=[Ledger ID]

with this

LEDGER_ID=[y4ir1y9bd2z3i3ta]

instead of this

LEDGER_ID=y4ir1y9bd2z3i3ta

The result is that the URL is wrong as can be seen in the log (e.g.

POST https://api.projectdabl.com/data/[y4ir1y9bd2z3i3ta]/v1/exercise

instead of

POST https://api.projectdabl.com/data/y4ir1y9bd2z3i3ta/v1/exercise

Could you retry it?

Best,
Darko

MV
mvresh
Apr 2022

I tried without the brackets first and it wasn’t working(error) so had to change it. I’ll try once again. Thanks @Darko

CO
cocreature
Apr 2022

I believe api.projectdabl.com no longer works and you have to upgrade to the new hub domains. I recommend taking a look at the version of create-daml-app in SDK 2.1 and copying the hub interaction from that.

MV
mvresh
Apr 2022

@Darko this is the error I’m getting after I run make daml-hub-package LEDGER_ID=[Ledger ID]

> react-scripts build

Creating an optimized production build...
Failed to compile.

/home/ubuntu/ex-cbdc/ui/src/components/App.tsx
TypeScript error in /home/ubuntu/ex-cbdc/ui/src/components/App.tsx(103,27):
Argument of type 'FC<{}>' is not assignable to parameter of type 'ComponentClass<RouteComponentProps<any, StaticContext, unknown>, any> | FunctionComponent<RouteComponentProps<any, StaticContext, unknown>> | (FunctionComponent<...> & ComponentClass<...>) | (ComponentClass<...> & FunctionComponent<...>)'.
  Type 'FunctionComponent<{}>' is not assignable to type 'FunctionComponent<RouteComponentProps<any, StaticContext, unknown>>'.
    Types of parameters 'props' and 'props' are incompatible.
      Type 'RouteComponentProps<any, StaticContext, unknown>' has no properties in common with type '{ children?: ReactNode; }'.  TS2345

    101 | };
    102 |
  > 103 | export default withRouter(App);
        |                           ^
    104 |


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cbdc@1.0.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cbdc@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2022-04-19T12_44_52_588Z-debug.log
make[1]: *** [Makefile:42: cbdc-ui.zip] Error 1

I removed the package-lock.json file as well from /ui folder before running make daml-hub-package LEDGER_ID=[Ledger ID]

DA
Darko
Apr 2022

As @cocreature mentioned, it seems that we’ll need to update the project to capture the change in the daml hub API.

Before that you could either run it locally or if you are comfortable using docker, I can send you a Dockerfile.

Please find attached a quick and dirty Dockerfile just to get you up and running.

FROM digitalasset/daml-sdk:1.17.1

USER root
RUN apt update && apt install git make netcat npm -y

USER daml
WORKDIR /home/daml
RUN git clone https://github.com/digital-asset/ex-cbdc.git
WORKDIR /home/daml/ex-cbdc/
RUN git checkout d0ec4b0989aa7245953bf651044dd23fd3fd75bb

WORKDIR /home/daml/ex-cbdc/ui
RUN rm ./package-lock.json

WORKDIR /home/daml/ex-cbdc
RUN make build


WORKDIR /home/daml/ex-cbdc

CMD launchers/sandbox & \
  launchers/populate & \
  launchers/jsonapi & \
  launchers/automation & \
  launchers/ui

EXPOSE 3000

To use it follow the following steps:

  1. Create a file called Dockerfile in the root folder of the repository (i.e. in the ex-cbdc folder).
  2. copy the code above into that file.
  3. Run docker build . -t ex-cbdc to create the docker image. This might take a few minutes.
  4. run docker run ex-cbdc and wait until you see
You can now view cbdc in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://172.17.0.3:3000
  1. Open a browser on http://localhost:3000
MV
mvresh
Apr 2022

Hi @Darko

I’m still getting the following error:

Failed to compile.

/home/daml/ex-cbdc/ui/src/components/App.tsx
TypeScript error in /home/daml/ex-cbdc/ui/src/components/App.tsx(103,27):
Argument of type 'FC<{}>' is not assignable to parameter of type 'ComponentClass<RouteComponentProps<any, StaticContext, unknown>, any> | FunctionComponent<RouteComponentProps<any, StaticContext, unknown>> | (FunctionComponent<...> & ComponentClass<...>) | (ComponentClass<...> & FunctionComponent<...>)'.
  Type 'FunctionComponent<{}>' is not assignable to type 'FunctionComponent<RouteComponentProps<any, StaticContext, unknown>>'.
    Types of parameters 'props' and 'props' are incompatible.
      Type 'RouteComponentProps<any, StaticContext, unknown>' has no properties in common with type '{ children?: ReactNode; }'.  TS2345

My current setup:

Java

openjdk 17.0.1 2021-10-19
OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12)
OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)

DAML

SDK versions:
  1.18.1  (default SDK version for new projects)
  2.0.0   (not installed)

Node

v14.19.1

Python 3 is installed as well.

I’m currently running the whole setup on AWS EC2 Ubuntu 20.04

I created the Dockerfile as you suggested and ran docker build and docker run and the error above is what I got.

MV
mvresh
Apr 2022

@Darko I’m on windows and it didn’t work on it before(open issue on github) so testing on EC2 box.

GA
Gary_Verhaegen
Apr 2022

Hi @mvresh,

I can confirm I see the same error when running that Dockerfile on my machine. As that looks like a compilation error, it seems to imply the TypeScript code in the repo is somehow broken, despite passing CI. We’ll need to look into this more closely.

The following Dockerfile, however, does work for me:

FROM digitalasset/daml-sdk:1.18.1

USER root
RUN apt update && apt install git make netcat npm -y

USER daml
WORKDIR /home/daml
RUN git clone https://github.com/digital-asset/ex-cbdc.git
WORKDIR /home/daml/ex-cbdc/
RUN git checkout 1a42e24d053b85476dbbc7ae4d4dabdd631131c4
RUN make build

CMD launchers/sandbox & \
  launchers/populate & \
  launchers/jsonapi & \
  launchers/automation & \
  launchers/ui

EXPOSE 3000

Would you mind trying it?

MV
mvresh
Apr 2022

Hi @Gary_Verhaegen Thanks for responding.

I tried the new Dockerfile on AWS EC2 Ubuntu 20.04, with the prerequisites installed and I didnt get any errors as of yet but its taking a really long time after the sandbox started running. I’m yet to see the UI launcher running and its not deployed yet for sure.

GA
Gary_Verhaegen
Apr 2022

Yes, there’s a lot of “building” that still happens when running docker run, so it takes a while. It just end up with a message that the server is listening to port 3000.

Note that the Docker container ultimately just opens up port 3000 and stays there, listening; in order to see the UI you have to open up a browser and connect to that. With a remote machine, I don’t know exactly how that works; you’ll probably need to record the IP address of the machine and make sure you have all the network rules set up so the machine is reachable.

MV
mvresh
Apr 2022

Thanks @Gary_Verhaegen It got deployed and I’m able to access the Ui but still facing the same issues as before - Cant issue funds and no initial funds. I think JSON API is still not accessible to the UI.

GA
Gary_Verhaegen
Apr 2022

Hi @mvresh,

Apologies, I am not very familiar with this application. It looks like you need to set the URL you will use to access the site at build time.

In your case, that will probably be the IP address of the Amazon VM you are using. In my case, Docker runs on a VM that I can access using the 192.168.99.163 IP address, and the following Dockerfile works:

FROM digitalasset/daml-sdk:1.18.1

USER root
RUN apt update && apt install git make netcat npm -y

USER daml
WORKDIR /home/daml
RUN git clone https://github.com/digital-asset/ex-cbdc.git
WORKDIR /home/daml/ex-cbdc/
RUN git checkout 1a42e24d053b85476dbbc7ae4d4dabdd631131c4
RUN make build

ENV REACT_APP_HTTP_BASE_URL=http://192.168.99.163:3000/

CMD launchers/sandbox & \
  launchers/populate & \
  launchers/jsonapi & \
  launchers/automation & \
  launchers/ui

Note the new ENV line. You’ll have to replace the IP address with the one you are using.

I’ll also note that on my machine it seems to work with Chrome but does not seem to work with Safari or Firefox.

← Back to Discussions