Error upload file dar on Sawtooth

I create the project with this template:

daml new quickstart --template quickstart-java
daml build – okey

I want this project to communicate with SAWTOOTH so I configure the port and ledger-id as configured in “/daml-on-sawtooth/docker/compose/daml-local.yaml”.


entrypoint: "bash -c "
sleep 30 &&
/opt/sawtooth-daml-rpc/entrypoint.sh
–participant port=9000,address=0.0.0.0,participant-id=rpc-0,server-jdbc-url=jdbc:postgresql://postgres/postgres?user=postgres
ledger-id test

I create the token:

{
  "https://daml.com/ledger-api": {
    "ledgerId": "test",
    "applicationId": "HTTP-JSON-API-Gateway",
    "actAs": [
      "Alice"
    ]
  }
}  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwczovL2RhbWwuY29tL2xlZGdlci1hcGkiOnsibGVkZ2VySWQiOiJ0ZXN0IiwiYXBwbGljYXRpb25JZCI6IkhUVFAtSlNPTi1BUEktR2F0ZXdheSIsImFjdEFzIjpbIkFsaWNlIl19fQ.1VsqNfz_7GlajjhRBITG-JoXIKIO5alUXt6_VYsDAv4

I deploy the ledger:

cd quickstart
daml sandbox --wall-clock-time --ledgerid test ./.daml/dist/quickstart-0.0.1.dar --port 9000

INFO: Slf4jLogger started
INFO: Listening on localhost:9000 over plain text.
   ____             ____
  / __/__ ____  ___/ / /  ___ __ __
 _\ \/ _ `/ _ \/ _  / _ \/ _ \\ \ /
/___/\_,_/_//_/\_,_/_.__/\___/_\_\

INFO: Initialized sandbox version 1.11.1 with ledger-id = test, port = 9000, dar file = List(./.daml/dist/quickstart-0.0.1.dar), time mode = wall-clock time, ledger = in-memory, auth-service = AuthServiceWildcard$, contract ids seeding = strong

I run the json-api service:

daml json-api --ledger-host=localhost --ledger-port=9000 --http-port=7575 --address=0.0.0.0 --allow-insecure-tokens

11:34:35.442 [main] INFO  com.daml.http.Main$ - Config(ledgerHost=localhost, ledgerPort=9000, address=0.0.0.0, httpPort=7575, portFile=None, packageReloadInterval=5 seconds, packageMaxInboundMessageSize=None, maxInboundMessageSize=4194304, tlsConfig=TlsConfiguration(false,None,None,None,REQUIRE,false,List()), jdbcConfig=None, staticContentConfig=None, allowNonHttps=true, accessTokenFile=None, wsConfig=None)
11:34:35.812 [http-json-ledger-api-akka.actor.default-dispatcher-5] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
11:34:36.931 [http-json-ledger-api-akka.actor.default-dispatcher-11] INFO  com.daml.http.HttpService$ - Connected to Ledger: test
11:34:36.932 [http-json-ledger-api-akka.actor.default-dispatcher-11] INFO  com.daml.http.HttpService$ - contractDao: None
11:34:37.852 [http-json-ledger-api-akka.actor.default-dispatcher-11] INFO  com.daml.http.PackageService - new package IDs loaded: f3a8894cb1c3e35049399d6a7ae98b6669772e31c932afff68e1b3ac36b8f327, c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd, 733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a, bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f, 518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c, 8b58230a4b874368eee876d992bd8a4eee1bd9404d48e46fc5f7251aa38b68f9, cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7, 0e53cf68e452f8c59f04d08031128f3720a971dbfd685abda7cc305a67478f14, d8c2ae4afe16f0192cfcaa00ee16e0cf68c22020aa81e1ad55f739f5c42516fd, 6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d, 99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235, 76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f, e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c, d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97, 6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06, d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662, 057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba, e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b, 40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7, 97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657, 8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb 11:34:38.294 [http-json-ledger-api-akka.actor.default-dispatcher-10] INFO  com.daml.http.Main$ - Started server: ServerBinding(/0:0:0:0:0:0:0:0:7575)

I use a rest client to create a contract, parameters I use:
url:

localhost:7575/v1/créate

Authorization:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwczovL2RhbWwuY29tL2xlZGdlci1hcGkiOnsibGVkZ2VySWQiOiJ0ZXN0IiwiYXBwbGljYXRpb25JZCI6IkhUVFAtSlNPTi1BUEktR2F0ZXdheSIsImFjdEFzIjpbIkFsaWNlIl19fQ.1VsqNfz_7GlajjhRBITG-JoXIKIO5alUXt6_VYsDAv4

Payload:

{
  "templateId": "Iou:Iou",
  "payload": {
    "issuer": "Alice",
    "owner": "Alice",
    "currency": "EUR",
    "amount": "556.99",
    "observers": []
  }
}

I execute and get the contract created:

{
    "result": {
        "agreementText": "",
        "contractId": "0010d30947ace786eec5e834f2af183d43c4e24e6a12237f9bf74124a14795edbb",
        "observers": [],
        "payload": {
            "observers": [],
            "issuer": "Alice",
            "amount": "556.99",
            "currency": "EUR",
            "owner": "Alice"
        },
        "signatories": [
            "Alice"
        ],
        "templateId": "0e53cf68e452f8c59f04d08031128f3720a971dbfd685abda7cc305a67478f14:Iou:Iou"
    },
    "status": 200
}

All the above process I want to run by connecting to SAWTOOTH, I follow the tutorial Learn Damlsmart contract Language - Interactive Learning Tutorials
I deploy sawttoth:

validator         | [2021-03-23 11:52:47.937 INFO     block_validator] Block e4a39ab48dc642ae03503d248ea7ba45190f38ecc77b2fafa34729a8d81e95a75722de500e1eaa2bc4fcb9aeed5b2d4482e2ebf119865a4883c023b6d3911a84 (block_num:8, state:4dbc5ed46d6c9b7b1054c7dcad8ca3e8ec952317895b2e1858c02d642308a547, previous_block_id:e0fba02c7072f1917b809ef99bd2c01625b52e5a991227ab213f5a2297eaee6858bfbf400d35777f1d620b4e9c73df7e797460cb7f036252d49fcc98b9a8b27e) passed validation
daml-rpc          | 11:52:47.986 [ForkJoinPool-4-worker-3] INFO  com.blockchaintp.sawtooth.daml.rpc.ZmqEventHandler - Received block-commit block_num=8
devmode           | WARN  | devmode_engine_rust: | Block not ready to summarize

Upload file dar:

daml ledger upload-dar ./.daml/dist/quickstart-0.0.1.dar --host localhost --port 9000

Is this an error? There are a couple of errors in the traces:

daml-tp           | 11:53:03.401 [ForkJoinPool-1-worker-7] WARN  com.blockchaintp.sawtooth.daml.processor.DamlTransactionHandler - Assembling and handling transaction with fragment part 2 of 2 size=0
daml-tp           | 11:53:03.744 [Thread-3] ERROR com.daml.ledger.participant.state.kvutils.committer.PackageCommitter - Preload exception, correlationId=6995e48b-a676-4e16-bb79-eee001ea89d1 error='com.daml.lf.archive.Reader$ParseError: LF file V1.11 unsupported; maximum supported V1.x is V1.8' stackTrace='com.daml.lf.archive.Reader.readArchivePayloadAndVersion(Reader.scala:91), com.daml.lf.archive.Reader.readArchiveAndVersion(Reader.scala:59), com.daml.ledger.participant.state.kvutils.committer.PackageCommitter.$anonfun$preload$6(PackageCommitter.scala:206), scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:273), scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62), scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55), scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49), scala.collection.TraversableLike.map(TraversableLike.scala:273), scala.collection.TraversableLike.map$(TraversableLike.scala:266), scala.collection.AbstractTraversable.map(Traversable.scala:108), com.daml.ledger.participant.state.kvutils.committer.PackageCommitter.$anonfun$preload$2(PackageCommitter.scala:205), com.codahale.metrics.Timer.time(Timer.java:118), com.daml.ledger.participant.state.kvutils.committer.PackageCommitter.$anonfun$preload$1(PackageCommitter.scala:198), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source), java.base/java.lang.Thread.run(Unknown Source)'
daml-tp           | 11:53:04.358 [ForkJoinPool-1-worker-7] WARN  com.blockchaintp.sawtooth.daml.processor.DamlTransactionHandler - Storing transaction fragment part 0 of 2 size=262144
daml-tp           | 11:53:04.374 [ForkJoinPool-1-worker-7] WARN  com.blockchaintp.sawtooth.daml.processor.DamlTransactionHandler - Storing transaction fragment part 1 of 2 size=9218
daml-tp           | 11:53:04.378 [ForkJoinPool-1-worker-7] WARN  com.blockchaintp.sawtooth.daml.processor.DamlTransactionHandler - Assembling and handling transaction with fragment part 2 of 2 size=0
daml-tp           | 11:53:04.534 [Thread-4] ERROR com.daml.ledger.participant.state.kvutils.committer.PackageCommitter - Preload exception, correlationId=6995e48b-a676-4e16-bb79-eee001ea89d1 error='com.daml.lf.archive.Reader$ParseError: LF file V1.11 unsupported; maximum supported V1.x is V1.8' stackTrace='com.daml.lf.archive.Reader.readArchivePayloadAndVersion(Reader.scala:91), com.daml.lf.archive.Reader.readArchiveAndVersion(Reader.scala:59), com.daml.ledger.participant.state.kvutils.committer.PackageCommitter.$anonfun$preload$6(PackageCommitter.scala:206), scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:273), scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62), scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55), scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49), scala.collection.TraversableLike.map(TraversableLike.scala:273), scala.collection.TraversableLike.map$(TraversableLike.scala:266), scala.collection.AbstractTraversable.map(Traversable.scala:108), com.daml.ledger.participant.state.kvutils.committer.PackageCommitter.$anonfun$preload$2(PackageCommitter.scala:205), com.codahale.metrics.Timer.time(Timer.java:118), com.daml.ledger.participant.state.kvutils.committer.PackageCommitter.$anonfun$preload$1(PackageCommitter.scala:198), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source), java.base/java.lang.Thread.run(Unknown Source)'
validator         | [2021-03-23 11:53:04.702 INFO     block_validator] Block b1feb3dd9891b022badf825f5738d3a079833b7fdf9ae023989df8b61d929e7565c62cc465cb05e62650d2931118e6faae556583d82c7df744b5377980abfc65 (block_num:9, state:0bfedf8093185f8fafb7c927b020b3d1932b090d6ac9004039845663cf7d4669, previous_block_id:e4a39ab48dc642ae03503d248ea7ba45190f38ecc77b2fafa34729a8d81e95a75722de500e1eaa2bc4fcb9aeed5b2d4482e2ebf119865a4883c023b6d3911a84) passed validation
daml-rpc          | 11:53:04.868 [ForkJoinPool-4-worker-3] INFO  com.blockchaintp.sawtooth.daml.rpc.ZmqEventHandler - Received block-commit block_num=9
devmode           | WARN  | devmode_engine_rust: | Block not ready to summarize
validator         | [2021-03-23 11:53:08.241 INFO     block_validator] Block a69d63a183cd8c2b4246d2e11a90765ab0c2a8a6e3adc022729c6a0fa87198323997e9ea70863b9b90f870537c7a788263fe559f75d78589abd0104461221e61 (block_num:10, state:08d736f3366838934d563a0b2ce85da3998820d14afeac810389c93995b70314, previous_block_id:b1feb3dd9891b022badf825f5738d3a079833b7fdf9ae023989df8b61d929e7565c62cc465cb05e62650d2931118e6faae556583d82c7df744b5377980abfc65) passed validation
daml-rpc          | 11:53:08.314 [ForkJoinPool-4-worker-3] INFO  com.blockchaintp.sawtooth.daml.rpc.ZmqEventHandler - Received block-commit block_num=10
devmode           | WARN  | devmode_engine_rust: | Block not ready to summarize

thank you for your comments

2 Likes

Hi @magzupao

The issue here is that the version of the DAML SDK you’re using is not compatible with DAML for Sawtooth.

You’ll need to use an SDK version with a DAML-LF version of 1.8 or earlier.

DAML SDK v1.4.0 is compatible. You can install and activate it like this:

daml install 1.4.0 --activate

4 Likes

The key information in the error messages you shared is

ParseError: LF file V1.11 unsupported; maximum supported V1.x is V1.8' 

With Daml Connect 1.11 the default version changed to Daml-LF 1.11. The release notes contain instructions how to pin the version to 1.8 even when using a newer version of the SDK.

1 Like