Skip to content

Commit

Permalink
delete tx validation & update batch update guide
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cha committed Feb 5, 2025
1 parent d7ef560 commit 96fb46c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
28 changes: 28 additions & 0 deletions BatchUpdateGuide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# UpdateBatchInfo
Follow the steps below.
### Step 1. Register the key for the new batch submitter address.
`opinitd keys add mocha-4 batch --bech32=celestia`

*Make sure that this new account has a sufficient balance.*

### Step 2. Run the Update batch info command.
`opinitd tx update-batch-info CELESTIA celestia...`

The proposer sends a transaction that includes an update batch info message with the new `ChainType` and `SubmitterAddress`. The bot will `shut down` when it encounters the `MsgUpdateBatchInfo`.

### Step 3. Update the DA node config in the executor config.
```json
{
...
"da_node": {
"chain_id": "mocha-4",
"bech32_prefix": "celestia",
"rpc_address": "",
"gas_price": "",
"gas_adjustment": 1.5,
"tx_timeout": 60
}
}
```

### Step 4. Start the OPInit bot.
9 changes: 2 additions & 7 deletions cmd/opinitd/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Before running this command, you need to
chainType := args[0]
newSubmitterAddress := args[1]

err = validateBatchInfoArgs(cfg, chainType, newSubmitterAddress)
err = validateBatchInfoArgs(chainType)
if err != nil {
return err
}
Expand Down Expand Up @@ -196,16 +196,11 @@ Before running this command, you need to
return cmd
}

func validateBatchInfoArgs(cfg *executortypes.Config, chainType string, newAddress string) error {
func validateBatchInfoArgs(chainType string) error {
chainType = strings.ToUpper(chainType)
if chainType != ophosttypes.BatchInfo_INITIA.String() && chainType != ophosttypes.BatchInfo_CELESTIA.String() {
return fmt.Errorf("supported chain type: %s, %s", ophosttypes.BatchInfo_INITIA.String(), ophosttypes.BatchInfo_CELESTIA.String())
}

_, err := keys.DecodeBech32AccAddr(newAddress, cfg.DANodeConfig().Bech32Prefix)
if err != nil {
return errors.Wrapf(err, "failed to decode address with given bech32 prefix: %s", cfg.DANodeConfig().Bech32Prefix)
}
return nil
}

Expand Down

0 comments on commit 96fb46c

Please sign in to comment.