Skip to content
Discussions/App Development/Daml REPL - is there a way to import DAML-LF JSONForum ↗

Daml REPL - is there a way to import DAML-LF JSON

App Development5 posts282 views1 likesLast activity Jul 2022
NY
nycnewmanOP
Jul 2022

In the vein of Daml Script, is there a way to import a file in Daml REPL? The use case would be to export a set of party identifiers via a script (i.e. initial user and party setup) and then have a way to import these party Ids into an active REPL session. Could be either a repl command (which may not be a preferred option) or via a command line option (import and define a variable). This might be an alternative to having to use PartyFromText.

CO
cocreature
Jul 2022

There is no option for this at the moment.

NY
nycnewman
Jul 2022

This could be useful for live ongoing environments.

ST
Stephen
Jul 2022

Is the data ready when starting the script? Then --input-file is the appropriate feature: Sorry, misread the first sentence of the question, thanks @cocreature

Hi @Alexander_Bernauer, The answer is contained in the documentation page of Daml Script, but it did take me a few minutes to re-puzzle it out, so I definitely agree it could be more explicit. The mechanism is actually really simple: the input file is used to define the argument to the script function. Here is a complete example. First, Main.daml: module Main where import Daml.Script data InputLine = InputLine with name: Text, age: Int deriving (Show, Eq) setup : [InputLine] -> Script Int…
CO
cocreature
Jul 2022

Daml REPL does not have an --input-file flag.

← Back to Discussions