Checker is an in-development "robocoin" system for the Tezos blockchain, and is a project supported by Nomadic Labs, Tweag, and TZ Connect.
The code here is currently unverified and unaudited, and is made publicly available only for exploration and discussion purposes. You should not use it for anything serious.
- Original technical (currently out-of-date) document can be found here.
- The source code lives in the src folder.
- The tests live in the tests folder.
Various ad-hoc documentation can be found in the docs folder.
The full docs are taking shape under docs/spec: use make spec
to build them if you're in a Nix shell or have sphinx
installed). These docs
are published at checker.readthedocs.io.
Currently the team uses Nix to provide all dependencies,
including OCaml packages and appropriate (perhaps even patched) versions of
Ligo and other necessary tools, so this is the recommended method. For the
curious, the dependencies are listed in shell.nix
.
For development, you'll also need the ctez submodule. To fetch all submodules, run:
$ git submodule update --init
Within a nix-shell
(the first time this might take a while, since it must
fetch all dependencies), type
make build-ocaml
to build and compile the ocaml code (in ./src).make generate-ligo
to generate the ligo code (in./generated/ligo
).make build-ligo
to generate the michelson code (in./generated/michelson
).make build
to do all of the above.make test
to run all the (OCaml) tests (./src/tests.ml). Note that this takes several minutes.make fast-test
to run the fast (OCaml) testsmake
to do all the above.
For test coverage report using bisect_ppx, type
make test-coverage
(report in./_coverage/index.html
), ormake test-coverage.json
(report of per-file summary in./test-coverage.json
).
For extracting (haddock-style) documentation from the code using dune, type
make docs
(docs entrypoint:./_build/default/_doc/_html/index.html
)
For running the end-to-end tests, type:
$ CHECKER_DIR=$(nix-build -A michelson --arg e2eTestsHack true --no-out-link) python e2e/main.py
The contract can be deployed to a local, Docker sandbox run using the provided client library. Note that this workflow has only been tested on Linux.
First, enter a nix shell:
$ nix-shell
Generate the LIGO and Michelson code:
$ make build-ligo
Ensure that the submodules (ctez in particular) are up-to-date:
$ git pull --recurse-submodules
Use the client to start the sandbox and deploy the required ctez and mock oracle contracts:
$ checker sandbox start
$ checker deploy mock-oracle
$ checker deploy ctez
Note: If no port is specified, the client will attempt to select a default one. To view the port number for use with tezos-client, etc. you can use:
checker show-config
.
And finally, deploy checker itself:
$ checker deploy checker