From 2c73c8db5ce785869da07ab4bb2508f3ddf307b5 Mon Sep 17 00:00:00 2001 From: artemijspavlovs Date: Mon, 19 Feb 2024 17:33:35 +0200 Subject: [PATCH] docs: update readme --- scripts/fraud_proof_poc/README.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/scripts/fraud_proof_poc/README.md b/scripts/fraud_proof_poc/README.md index a70b43a3c..db5e44d84 100644 --- a/scripts/fraud_proof_poc/README.md +++ b/scripts/fraud_proof_poc/README.md @@ -7,7 +7,7 @@ and proceed with the following steps ### hub -`podman exec -it fraud_proof_poc_fraud_proof_poc_hub_1 /bin/sh`, the following commands are executed inside the hub container +`podman exec -it fraud_proof_poc_fraud_proof_poc_hub_1 /bin/bash`, the following commands are executed inside the hub container ```sh # fund the wallets that were generated during rollapp initialization @@ -19,48 +19,53 @@ for wallet in "${wallets[@]}"; do dymd tx bank send local-user $wallet \ 10dym --gas-prices 100000000adym --yes -b block --keyring-backend test done - ``` ### Sequencer -`podman exec -it fraud_proof_poc_rollapp-evm_1 /bin/sh`, the following commands are executed inside the sequencer container +`podman exec -it fraud_proof_poc_rollapp-evm_1 /bin/bash`, the following commands are executed inside the sequencer container ```sh +# after funding the wallets from the hub node # register the rollapp roller tx register - +# ! note down the rollapp-id +# ! note down the node-id rollapp-evm dymint show-node-id --home ~/.roller/rollapp # start the sequencer with fraud_proof enabled -rollapp-evm --home ~/.roller/rollapp start --dymint.simulate_fraud & +# '&' starts the rollapp in the background +rollapp-evm --home ~/.roller/rollapp start --dymint.simulate_fraud --low_level warn & +# ! start the full node before generating transactions +# generate transactions to create fraud with 0.5% probability rollapp-evm --home ~/.roller/rollapp/ tx bank send \ rollapp_sequencer ethm1wss9w8e89ntkn73n25lm6c7ul36u282c4sq5qm 100000adum \ --keyring-backend test --broadcast-mode block -y --keyring-backend test ``` - ### Full Node - copy the `genesis.json` file from the sequencer to the full node ```sh podman cp fraud_proof_poc_rollapp-evm_1:/root/.roller/rollapp/config/genesis.json \ fraud_proof_poc_rollapp-evm-fullnode_1:/root/.roller/rollapp/config/genesis.json - ``` +`podman exec -it fraud_proof_poc_rollapp-evm-fullnode_1 /bin/sh`, the following commands are executed inside the fullnode container + ```sh +# noted in the sequencer steps export ROLLAPP_CHAIN_ID="dummy_9361346-1" +# noted in the sequencer steps export SEQUENCER_NODE_ID="12D3KooWQrNRe8ejp13aQauGze9UZw1kmgYR73K5iyzsKxVirLjz" sed -i "s/^rollapp_id.*/rollapp_id = \"${ROLLAPP_CHAIN_ID}\"/" ~/.roller/rollapp/config/dymint.toml - sed -i "s/^seeds =.*/seeds = \"tcp:\/\/${SEQUENCER_NODE_ID}@$(dig +short rollapp-evm):26656\/\"/" ~/.roller/rollapp/config/config.toml rollapp-evm --home ~/.roller/rollapp start - +# once a fraud is created - the node will panic and generate a fraud proof file +# named `fraudProof_rollapp_with_tx.json` ``` outside the container, run @@ -71,9 +76,13 @@ podman cp fraud_proof_poc_rollapp-evm-fullnode_1:/go/fraudProof_rollapp_with_tx. fraud_proof_poc_hub_1:/go/fraudProof_rollapp_with_tx.json ``` +inside the hub container, run the following command to submit the fraud + ```sh # from hub node dymd tx rollapp submit-fraud ${ROLLAPP_CHAIN_ID} \ /go/fraudProof_rollapp_with_tx.json --from local-user \ --gas 50000000 -b block -``` \ No newline at end of file +``` + +if everything went through fine, hub log will show `fraud proof verified` \ No newline at end of file