Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs committed Feb 19, 2024
1 parent 1d600b7 commit 2c73c8d
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions scripts/fraud_proof_poc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
```
```

if everything went through fine, hub log will show `fraud proof verified`

0 comments on commit 2c73c8d

Please sign in to comment.