From 391069cb83384e69701451c37001e61f34229f72 Mon Sep 17 00:00:00 2001 From: Gabriel Coutinho de Paula Date: Sun, 24 Dec 2023 10:48:53 -0300 Subject: [PATCH] fixup! docs: add readme --- permissionless-arbitration/lua_node/README.md | 24 +++++++++++++++---- .../lua_node/program/README.md | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/permissionless-arbitration/lua_node/README.md b/permissionless-arbitration/lua_node/README.md index 5f114033..c5fea90c 100644 --- a/permissionless-arbitration/lua_node/README.md +++ b/permissionless-arbitration/lua_node/README.md @@ -1,13 +1,29 @@ # Dave Lua node -The Lua node is used for testing and prototyping only. +This directory contains a prototype node written in Lua. +The purpose of this Lua node is testing and prototyping only; the real production node is written in Rust. +Furthermore, this node implements only compute (_i.e._ a one-shot computation, like a rollups with no inputs). + +Remember to either clone the repository with the flag `--recurse-submodules`, or run `git submodule update --recursive --init` after cloning. +You need a docker installation to run the Dave Lua node. ## Run example -Remember to either clone the repository with the flag `--recurse-submodules`, or run `git submodule update --recursive --init` after cloning. -You need a docker installation to run the Dave Lua node. -From the path `permissionless-arbitration/lua_node`, run the following command: +This directory also has an example verification game, in which players compete against each other to prove the correct result of a computation. +The computation binary is specified in the [`program`](permissionless-arbitration/lua_node/program) directory. +From that binary, the example program generates a Cartesi Machine image, which fully specifies a computation. + +These players come in multiple flavours: +* The honest player is one that uses the honest strategy and defends the correct claim. +This honest player will always emerge victorious. +* One kind of dishonest player uses the honest strategy, but defends an incorrect claim. +This kind of dishonest player will always lose to the honest player (although they may win against a different _dishonest_ player). +* Another kind of dishonest player posts the incorrect claim, but never interacts with the blockchain again. +They will always lose by timeout, as long as there's an honest player. + +To add more players of different kinds, you can edit the `entrypoint.lua` file. +To run this example, execute the following command from the path `permissionless-arbitration/lua_node`: ``` docker build -t dave:latest -f Dockerfile ../../ && docker run --rm dave:latest diff --git a/permissionless-arbitration/lua_node/program/README.md b/permissionless-arbitration/lua_node/program/README.md index 4f74431a..5c347888 100644 --- a/permissionless-arbitration/lua_node/program/README.md +++ b/permissionless-arbitration/lua_node/program/README.md @@ -14,7 +14,7 @@ docker run --platform linux/amd64 -it --rm -h playground \ -e GID=$(id -g) \ -v (pwd):/home/$(id -u -n) \ -w /home/$(id -u -n) \ - diegonehab/playground:develop /bin/bash -c "./gen_machine_linux.sh" + cartesi/machine-emulator:0.15.2 /bin/bash -c "./gen_machine_linux.sh" ``` ``` @@ -25,5 +25,5 @@ docker run --platform linux/amd64 -it --rm -h playground \ -e GID=$(id -g) \ -v (pwd):/home/$(id -u -n) \ -w /home/$(id -u -n) \ - diegonehab/playground:develop /bin/bash -c "./gen_machine_simple.sh" + cartesi/machine-emulator:0.15.2 /bin/bash -c "./gen_machine_simple.sh" ```