#dry-run #solution #contracts #running #check #address #constraints

bin+lib essential-dry-run

Cli and library for dry running solutions against a running essential-server

3 releases (breaking)

0.2.0 Aug 23, 2024
0.1.0 Jul 8, 2024
0.0.0-release Jul 8, 2024

#5 in #dry-run

Download history 221/week @ 2024-07-07 9/week @ 2024-07-14 137/week @ 2024-08-18 7/week @ 2024-08-25

144 downloads per month

Apache-2.0

66KB
756 lines

Essential Dry Run

Crates.io Documentation license Build Status

This is a Rust library and CLI tool that allows dry running solutions on Essential server.

The dry run is performed through essential-rest-client that sends requests to essential-rest-server.

Under the hood, essential-server:

  • Simulates the state transitions proposed by the solution.
  • Checks the constraints of all predicates that the solution points to.

The Rust library provides modifications of functions that accept deserialized Contract/Solution objects (as well as functions that accept paths like the CLI tool does).

Usage: essential-dry-run [ADDRESS] <COMMAND>

Commands:
  check-with-contracts
  check
  help                  Print this message or the help of the given subcommand(s)

Arguments:
  [ADDRESS]  Server address to bind to [default: http://0.0.0.0:0]

Options:
  -h, --help     Print help
  -V, --version  Print version

Dry Run

Dry runs a solution on the server.

Before simulating state transitions and checking constraints, the contracts are read from storage.

If you already have the contracts and do not need to read them from storage, use Dry Run With Contracts instead.

Usage: essential-dry-run dry-run --server <SERVER> --solution <SOLUTION>

Options:
      --server <SERVER>      The address of the server to connect to
      --solution <SOLUTION>  Path to solution
  -h, --help                 Print help

Example

essential-dry-run dry-run --server http://0.0.0.0:8080 --solution a_solution.json

Dry Run With Contracts

Dry runs a solution on the server without reading contracts from storage.

If you do not have the contracts that the solution points to, use Dry Run instead.

Usage: essential-dry-run dry-run-with-contracts --server <SERVER> --contracts <CONTRACTS> --solution <SOLUTION>

Options:
      --server <SERVER>        The address of the server to connect to
      --contracts <CONTRACTS>  Path to compiled contracts
      --solution <SOLUTION>    Path to solution
  -h, --help                   Print help

Example

essential-dry-run dry-run --server http://0.0.0.0:8080 --contracts src/contracts --solution a_solution.json

Dependencies

~7–20MB
~315K SLoC