johnshearing / marlowe-starter-kit

This repository contains lessons for using Marlowe via REST and at the command line. It is meant to be used with demeter.run or with a Docker deployment of Marlowe Runtime.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starter Kit for Marlowe

This repository contains lessons for using Marlowe via REST and at the command line. It is meant to be used with demeter.run or with a Docker deployment of Marlowe Runtime.

Contents

You can ask questions about Marlowe in the #ask-marlowe channel on the IOG Discord or post problems with this lesson to the issues list for the Marlowe Starter Kit github repository.


Setup

This repository is meant to be used with demeter.run to execute Marlowe contracts using Marlowe Runtime, or with another similar cloud deployment of Marlowe Runtime.

Alternatively, one can deploy Marlowe Runtime locally with docker.

If you are unfamiliar with the Marlowe smart-contract language or with the Cardano blockchain, you may want to familiarize yourself with the following information:

  1. The Marlowe Language
  2. Cardano's Extended UTxO Model.

Lessons

Additional Information

Marlowe Tools

Three alternative workflows are available for running Marlowe contracts:

  1. Marlowe CLI (marlowe-cli) for lightweight experiments with Marlowe transactions.
  2. Marlowe Runtime CLI (marlowe-runtime-cli) for non-web applications that use the Marlowe Runtime backend services.
  3. Marlowe Runtime Web (marlowe-web-server) for web applications that use Marlowe Runtime backend services.

Marlowe Runtime provides a variety of transaction-building, UTxO management, querying, and submission services for using Marlowe contracts: this makes it easy to run Marlowe contracts without attending to the details of the Cardano ledger and Plutus smart contracts. On the contrary, Marlowe CLI does not support querying and UTxO management, so it is best suited for experienced Cardano developers.

Tools for Running and Querying Marlowe Contracts

Marlowe Runtime

Marlowe Runtime consists of several backend services and work together with a web server. See the Marlowe documentation for more information on Marlowe Runtime.

The architecture of Marlowe Runtime

Using Marlowe Safely

If one plans to run a Marlowe contract on the Cardano mainnet, then one should check its safety before creating it, so that there is no chance of losing funds.

Here are the steps for checking the safety of a Marlowe contract:

  1. Understand the Marlowe Language.
  2. Understand Cardano's Extended UTxO Model.
  3. Read and understand the Marlowe Best Practices Guide.
  4. Read and understand the Marlowe Security Guide.
  5. Use Marlowe Playground to flag warnings, perform static analysis, and simulate the contract.
  6. Use Marlowe CLI's marlowe-cli run analyze tool to study whether the contract can run on a Cardano network.
  7. Run all execution paths of the contract on a Cardano testnet.

Manual Installation Using Nix

When using Marlowe tools within demeter.run, nothing needs to be installed.

If you are not using demeter.run and have the Nix package manager installed with Nix flakes support enabled, you can launch a Jupyter notebook server, open a development environment, or build the tools. Be sure to set yourself as a trusted user in the nix.conf; otherwise, build times will be very long.

Launching a Jupyter Server for Marlowe Tools

One can launch a Jupyter notebook server for the workbooks and tools as follows:

$ git clone https://github.com/input-output-hk/marlowe-starter-kit/
$ cd marlowe-starter-kit
$ nix run

One can even run a Jupyter notebook server with Marlowe tools already installed (but no example notebooks) without manually cloning this repository:

nix run github:input-output-hk/marlowe-starter-kit

Opening a Development Shell

One can also enter a Nix development shell that contains the Marlowe tools:

$ git clone https://github.com/input-output-hk/marlowe-starter-kit/
$ cd marlowe-starter-kit
$ nix develop

This can also be done without cloning this repository:

nix develop github:input-output-hk/marlowe-starter-kit

Building individual Tools

One can build individual Marlowe tools using Nix:

nix build github:input-output-hk/marlowe-starter-kit/#marlowe-runtime-cli -o build/marlowe-runtime-cli
nix build github:input-output-hk/marlowe-starter-kit/#marlowe-cli         -o build/marlowe-cli
nix build github:input-output-hk/marlowe-starter-kit/#marlowe-pipe        -o build/marlowe-pipe

About

This repository contains lessons for using Marlowe via REST and at the command line. It is meant to be used with demeter.run or with a Docker deployment of Marlowe Runtime.

License:Apache License 2.0


Languages

Language:Jupyter Notebook 99.4%Language:Nix 0.6%