Skip to content

Commit

Permalink
fixup! docs: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GCdePaula committed Dec 24, 2023
1 parent f977758 commit 0dfdc23
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
24 changes: 20 additions & 4 deletions permissionless-arbitration/lua_node/README.md
Original file line number Diff line number Diff line change
@@ -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`](program) directory.
From this 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
Expand Down
14 changes: 7 additions & 7 deletions permissionless-arbitration/lua_node/program/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

## Generate programs

```
cd program
```
From this directory, run the following:

```
docker run --platform linux/amd64 -it --rm -h playground \
docker run --platform linux/amd64 -it --rm -h gen-program \
-e USER=$(id -u -n) \
-e GROUP=$(id -g -n) \
-e UID=$(id -u) \
-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_simple.sh"
```

Or

```
docker run --platform linux/amd64 -it --rm -h playground \
docker run --platform linux/amd64 -it --rm -h gen-program \
-e USER=$(id -u -n) \
-e GROUP=$(id -g -n) \
-e UID=$(id -u) \
-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_linux.sh"
```

0 comments on commit 0dfdc23

Please sign in to comment.