Cocolab Tutorial
CocoLab is a sandbox playground environment for compiling manifests into logics,
simulating logic calls and participant interactions with logics on MOI.
It has capabilities to handle basic argument parsing and is agnostic to
engine runtime implementations but currently only supports PISA engine.
Lab execution flow
CocoLab [Compiles Manifest] -> makes request to PISA Engine
PISA Engine executes request -> returns response
CocoLab Displays results and stores/caches the data as needed
Local PISA Engine has no persistent data (as of v0.7.0), so it only uses a single main environment and all the data (registered users, settings, persistent and ephemeral storage) are lost once Cocolab ends.
Start Cocolab
In the folder where the coco.nut file resides, run either init or start command:
coco nut init [name]
coco lab start
Both commands start the REPL, but init also:
- checks if the logic, named in the
coco.nutfile exists, and if not, compiles the manifest - registers a user named
default_userif it doesn’t exist - sets default sender to be
default_user
As init runs these boilerplate commands, the user can start with deploy command immediately, without manually running compile / register / set default.sender commands first.
start CLI flags
-c /—config Specify which [lab.config.name] to use apart from default.
-e/—env This overrides Environment to use. default is main. Refer Env section for create, list and delete.
for e.g coco lab start -c default -e main