From 19ff061a815ae03d08c13504c0f9b8324416effc Mon Sep 17 00:00:00 2001 From: bkolad Date: Mon, 11 Mar 2024 15:47:59 +0100 Subject: [PATCH 1/2] Update readme --- README.md | 14 +++++++++----- sov-rollup-starter.sh | 24 +++++++++++++++++++++--- 2 files changed, 30 insertions(+), 8 deletions(-) mode change 100755 => 100644 sov-rollup-starter.sh diff --git a/README.md b/README.md index 469459d..1cc324c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ $ make clean-db #### 3. Start the rollup node: +```sh,test-ci +export SOV_PROVER_MODE=execute +``` + This will compile and start the rollup node: ```shell,test-ci,bashtestmd:long-running,bashtestmd:wait-until=RPC @@ -127,9 +131,9 @@ $ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method" ``` ## Enabling the prover -By default, demo-rollup disables proving (i.e. the default behavior is `SOV_PROVER_CONFIG=skip`). If we want to enable proving, several options are available: +By default, demo-rollup disables proving (i.e. the default behavior is. If we want to enable proving, several options are available: -* `export SOV_PROVER_CONFIG=skip` Skips verification logic. -* `export SOV_PROVER_CONFIG=simulate` Run the rollup verification logic inside the current process. -* `export SOV_PROVER_CONFIG=execute` Run the rollup verifier in a zkVM executor. -* `export SOV_PROVER_CONFIG=prove` Run the rollup verifier and create a SNARK of execution. +* `export SOV_PROVER_MODE=skip` Skips verification logic. +* `export SOV_PROVER_MODE=simulate` Run the rollup verification logic inside the current process. +* `export SOV_PROVER_MODE=execute` Run the rollup verifier in a zkVM executor. +* `export SOV_PROVER_MODE=prove` Run the rollup verifier and create a SNARK of execution. diff --git a/sov-rollup-starter.sh b/sov-rollup-starter.sh old mode 100755 new mode 100644 index f4b7b74..a35d817 --- a/sov-rollup-starter.sh +++ b/sov-rollup-starter.sh @@ -6,35 +6,52 @@ if [ $? -ne 0 ]; then echo "Expected exit code 0, got $?" exit 1 fi + echo 'Running: '\''make clean-db'\''' make clean-db if [ $? -ne 0 ]; then echo "Expected exit code 0, got $?" exit 1 fi + echo 'Running: '\''cargo run --bin node'\''' -cargo run --bin node & -sleep 20 +output=$(mktemp) +cargo run --bin node &> $output & +background_process_pid=$! +echo "Waiting for process with PID: $background_process_pid" +until grep -q -i RPC $output +do + if ! ps $background_process_pid > /dev/null + then + echo "The background process died died" >&2 + exit 1 + fi + echo -n "." + sleep 5 +done + echo 'Running: '\''make test-create-token'\''' make test-create-token if [ $? -ne 0 ]; then echo "Expected exit code 0, got $?" exit 1 fi + echo 'Running: '\''make wait-ten-seconds'\''' make wait-ten-seconds if [ $? -ne 0 ]; then echo "Expected exit code 0, got $?" exit 1 fi + echo 'Running: '\''make test-bank-supply-of'\''' make test-bank-supply-of if [ $? -ne 0 ]; then echo "Expected exit code 0, got $?" exit 1 fi -echo 'Running: '\''curl -X POST -H "Content-Type: application/json" -d '\''{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}'\'' http://127.0.0.1:12345'\''' +echo 'Running: '\''curl -X POST -H "Content-Type: application/json" -d '\''{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}'\'' http://127.0.0.1:12345'\''' output=$(curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}' http://127.0.0.1:12345) expected='{"jsonrpc":"2.0","result":{"amount":1000},"id":1} ' @@ -50,4 +67,5 @@ if [ $? -ne 0 ]; then echo "Expected exit code 0, got $?" exit 1 fi + echo "All tests passed!"; exit 0 From 0f9fea5d5bf5fc51227192f23be872a8cdace8a4 Mon Sep 17 00:00:00 2001 From: Blazej Kolad Date: Mon, 11 Mar 2024 15:56:37 +0100 Subject: [PATCH 2/2] Update sov-rollup-starter.sh Co-authored-by: theochap <80177219+theochap@users.noreply.github.com> --- sov-rollup-starter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sov-rollup-starter.sh b/sov-rollup-starter.sh index a35d817..474119e 100644 --- a/sov-rollup-starter.sh +++ b/sov-rollup-starter.sh @@ -23,7 +23,7 @@ until grep -q -i RPC $output do if ! ps $background_process_pid > /dev/null then - echo "The background process died died" >&2 + echo "The background process died" >&2 exit 1 fi echo -n "."