Integration of the Pint constraint language and the Essential protocol.
The goal for this repo is to demonstrate (and test) the process of creating end-to-end Essential applications via the command line.
The developer experience can be broken into the following stages:
- build: Write and compile the contract with Pint.
- run sever: Start an essential-rest-server instance running or use
https://server.essential.builders
. - sign and deploy: Sign and deploy the contract to using essential-deploy-contract.
- solve: Create a solution and submit it to the
essential-rest-server
, updating the state as a result.
Users should not require any knowledge beyond basic command line tooling to get started with Pint and Essential.
In turn, we avoid letting Rust (or any other language besides Pint) leak into the repository in order to emulate the experience of writing apps purely using CLi tools.
The included Rust essential-cli
crate contains a few small commands that
should be extracted from this repo into a more general-use essential tooling
suite.
Both these example applications use Rust as their front end. They are much more in depth then the counter app example. This should give a good idea of how to build a more complex application using the Essential protocol.
When you first clone this repo or change the contracts the abi gen will not have the file it needs to run so rust will not compile the app. To fix this run the following command in the root of the repo.
nix run .#compile-all-contracts
Or if you are not using nix you can go to the directory of each contract and run the following command.
pint build
A Nix flake is included providing the essential-all
package, providing pint
, pintc
,
pintfmt
, essential-rest-server
and more. There is also the essential-minimal
package which contains just the bare minimal requirements to build an application.
-
Install Nix, easiest with the Determinate Systems installer.
-
Use Nix to enter a shell with the all Essential tools:
nix shell git+ssh://git@github.com/essential-contributions/essential-integration
To include these along with the
jq
andxxd
tools required to run included test scripts, use:nix develop github:essential-contributions/essential-integration
or if you have the repo cloned locally, simply
cd
in and use:nix develop