CSL Playground

Deon Digital’s Playground GUI allows users to write and evaluate contracts by using the contract specification language and interacting with a ledger that is stored in memory. A contract written in Deon Digital’s CSL is a textual specification of allowed sequences of actions (events) which multiple parties are expected to perform in order to fulfill a contract. The application displays the node name and ledger type as well as links to relevant documentation such as our guidelines about the API, the language and the changelog. It exposes three interactions with the Deon application platform:

In the following sections, we will discuss each of these in detail.

Composer

A CSL contract can be specified by using the composer.

../_images/gui_composer.png

Within the composer, the user has the opportunity to press Save Declaration or Instantiate Contract. Save Declaration will use the Declaration Name field. The user can reuse saved declarations later by using the Choose Declaration dropdown at the top of the page.

Instantiate Contract both saves the declaration and instantiates a contract on the ledger using the information from the remaining fields. The Contract Name field specifies the name of the contract instance, and can be chosen freely by the user. The peers that are part of the contract network have to be defined as well. The Peers dropdown is populated by the available peers on the network on which data can be stored and where contracts can be executed. The Entrypoint dropdown contains all the entrypoints defined in the CSL source. Selecting a particular entrypoint in the drop-down will cause input fields for its instantiation arguments to be shown. Once the contract is instantiated, the data is stored on the ledger which is distributed. The distribution on the network happens automatically.

Viewer

The viewer lets the user see the contract specification language (CSL) for each instantiated contract. In this example, the contract “Bike Sale” has been choosen:

../_images/gui_viewer.png

The user can see the individual contract declaration, the residual contract which specifies the still remaining events, as well as the list of past events that have successfully been submitted to the contract so far. Events can be applied in the Actions tab.

Actions

Based on the actual state of the contract, event types can be executed within the actions tab at the given time. The never changing ID (instantiating a contract creates a new ID for every instantiation), the never changing declaration ID (forever attached to an instantiated contract), the name, the event, the agent and the expression are visible for each expected event. The list of events can be scoped to a specific contract.

Based on the specification of the contract, specific events can be added to each event type.

../_images/gui_actions.png

Reports

The examination of the contracts can be done by using the value expression language. Report expressions are either evaluated within the context of a specific contract, or without context. The latter can be done by selecting Standalone expression in the dropdown menu. Reports can be given value arguments with the dropdown menus in the bottom. Pressing Run causes the system to execute the operation and display the result at the bottom of the page.

../_images/gui_reports.png

More practical examples about how contracts can be specified are mentioned here.