DABL Marketplace Sample App bootstrap via DAML Script error

I’m trying to bootstrap the DABL Marketplace Sample App via DAML Script, following the steps described here: GitHub - digital-asset/da-marketplace

But get the below error message, what am I missing?

gyorgybalazsi@BGY da-marketplace % ./create_ledger_parties.py participants.json ledger_parties.json
gyorgybalazsi@BGY da-marketplace % daml script --participant-config participants.json --json-api --dar .daml/dist/da-marketplace-0.0.2.dar --script-name Setup:doSetup --input-file ledger_parties.json
SDK 1.7.0 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.7.0 for details.

Exception in thread "main" java.lang.RuntimeException: Request failed: {"errors":["JsonError: Cannot resolve template ID, given: TemplateId(Some(33ddfab55d536acc2132356aefeffcfab1d504cc8d087012963bf245dc76ee27),Marketplace.Operator,Operator)"],"status":400}, status code: 400 Bad Request
	at com.daml.lf.engine.script.JsonLedgerClient.$anonfun$commandRequest$4(LedgerInteraction.scala:994)
	at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
	at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:47)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:47)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
daml-helper: Received ExitFailure 1 when running
Raw command: java -Dlogback.configurationFile=/Users/gyorgybalazsi/.daml/sdk/1.6.0/daml-sdk/script-logback.xml -jar /Users/gyorgybalazsi/.daml/sdk/1.6.0/daml-sdk/daml-sdk.jar script --participant-config participants.json --json-api --dar .daml/dist/da-marketplace-0.0.2.dar --script-name Setup:doSetup --input-file ledger_parties.json

gyorgybalazsi@BGY da-marketplace % 
1 Like

Cannot resolve template id means that the ledger or more specifically the JSON API does not know about your package. You can solve that by uploading the package containing the templates (the package containing the DAML scripts does not need to be uploaded if it’s different from the one containing the templates) to your ledger. In DABL’s ase you can do that via the web UI. For other ledgers, you can use daml ledger upload-dar.

2 Likes

Thank you @cocreature, you helped me indirectly.

The README contains this command:

gyorgybalazsi@BGY da-marketplace % daml script --participant-config participants.json --json-api --dar .daml/dist/da-marketplace-0.0.2.dar --script-name Setup:doSetup --input-file ledger_parties.json

But in the meantime, the package has been upgraded to version 0.0.3, and this updated command runs without error:

gyorgybalazsi@BGY da-marketplace % daml script --participant-config participants.json --json-api --dar .daml/dist/da-marketplace-0.0.3.dar --script-name Setup:doSetup --input-file ledger_parties.json
SDK 1.7.0 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.7.0 for details.

gyorgybalazsi@BGY da-marketplace % 
2 Likes