Great question! Let me go through the options:
-
This is a ledger-specific thing. Presumably you are using daml-on-fabric here (although you didn’t mention it). The DAML sandbox has something similar where you can pass in a DAR on the command line when starting it. This is convenient when you just want to test something out but as mentioned it is ledger-specific. There is no guarantee that this is possible at all and even if it is possible, the syntax can very from ledger to ledger. Furthermore, it does not help you if you already have a running ledger.
-
I’ll explain this before 2 since it is the simpler command.
daml ledger upload-dar
uses the Ledger API to upload a package. Since the ledger API is supported by any ledger, this works against any ledger contrary to 1. It also works against an already running ledger so you do not have to restart your ledger every time you want to upload a new DAR. If you do not pass in the path to a DAR, it will build the DAR for the project you are currently in usingdaml build
and upload that. You can also omit host and port and they will be read fromdaml.yaml
. If you specify host, port and the DAR you can run this command without being inside of a project which is sometimes convenient. -
Now on to
daml deploy
. This is an extension ofdaml ledger upload-dar
. It will first look at yourdaml.yaml
file and read the parties specified under theparties
field. For each party, it will then check if there already exists a party with the given display name (it does not check the party id). If it does not yet exist, it will allocate the party with the display name specified in yourdaml.yaml
and the party id hint set to the same name.
Once it has allocated the parties it uploads the DAR just likedaml ledger upload-dar
. Sodaml deploy
is just a wrapper arounddaml build
,daml ledger allocate-parties
anddaml ledger upload-dar
. If you want to do all 3, usedaml deploy
. If not, then usedaml ledger upload-dar
separately.