Batching commands using HTTP JSON API

This is a Feature request, but AFAIU, there is no way to batch commands via the HTTP-JSON API. For example, ask it to archive 100 contracts.

You’re right that there is nothing builtin. However, you can usually emulate that via createAndExercise, e.g.,

template Helper
    p : Party
    signatory p
    choice ArchiveBatched : ()
        cids : [ContractId T]
      controller p
      do mapA_ archive cids

If you then call ArchiveBatched via create and exercise you get more or less the same behavior as if you passed multiple archives over the grpc definition. The main downside of this approach is that you have to define the sets of batched command submissions you intend to make upfront in your daml model.

1 Like

I love how the solution to Daml limitations is to write more Daml, createAnd Exercise is quickly becoming my favorite action.

1 Like