G-d willing
Hello,
I am executing a script against the Daml Hub. While the command queryContractId works with no problem.
But, when I try to create a contract it fails. Does anyone knows what can it be?
Here is the code I am trying to execute, it is saved in a file named: TestingScript.daml
data InputParams = InputParams
with
scriptCid: ContractId ScriptTestContract
carrier: Party
template ScriptTestContract
with
user: Party
value: Int
where
signatory user
checkTranslationCode : InputParams -> Script ()
checkTranslationCode InputParams{..} = do
contractCid <- submit carrier do
createCmd ScriptTestContract with
user = carrier
value = 1
pure ()
I am executing the command from my terminal:
daml script --dar .daml/dist/script-testing-0.0.1.dar --ledger-host ......daml.app --ledger-port 443 --script-name TestingScript:exampleScript --input-file InputArguments.JSON --tls --application-id damlhub --access-token-file access_token_file
And this is the error I am getting:
Exception in thread "main" com.daml.lf.engine.script.ScriptF$FailedCmd: Command submit failed: NOT_FOUND: PACKAGE_NOT_FOUND(11,ee805c33): Couldn't find package b367afe5b05c8e811ceaaa013f805b7a7eb37a09e4426df199d9b82beb4afbca while looking for template b367afe5b05c8e811ceaaa013f805b7a7eb37a09e4426df199d9b82beb4afbca:TestingScript:ScriptTestContract
Daml stacktrace:
submit at b367afe5b05c8e811ceaaa013f805b7a7eb37a09e4426df199d9b82beb4afbca:TestingScript:24
at com.daml.lf.engine.script.Runner.$anonfun$runWithClients$10(Runner.scala:453)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:475)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:100)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
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)
Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: PACKAGE_NOT_FOUND(11,ee805c33): Couldn't find package b367afe5b05c8e811ceaaa013f805b7a7eb37a09e4426df199d9b82beb4afbca while looking for template b367afe5b05c8e811ceaaa013f805b7a7eb37a09e4426df199d9b82beb4afbca:TestingScript:ScriptTestContract
at io.grpc.Status.asRuntimeException(Status.java:535)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:534)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
daml-helper: Received ExitFailure 1 when running
Raw command: java -Dlogback.configurationFile=/home/avraham/.daml/sdk/2.0.0/daml-sdk/script-logback.xml -jar /home/avraham/.daml/sdk/2.0.0/daml-sdk/daml-sdk.jar script --dar .packages/triggers/.daml/dist/sor-mvp-triggers-0.0.1.dar --ledger-host l9d0c63cgrner1qo.daml.app --ledger-port 443 --script-name TestingScript:checkTranslationCode --input-file InputArguments.json --tls --application-id damlhub --access-token-file access_token_file --output-file policy_details.json
I did find some info on the docs regarding the JSON-API here.
I am not sure that it is possible to execute create and exercise commands only through JSON-API. Is it true?