Skip to content

Commit

Permalink
docs(rooch-db): enhance documentation with new commands (#2814)
Browse files Browse the repository at this point in the history
Add detailed usage instructions for revert, rollback, and drop commands in rooch-db README. Improve clarity on tx_order and column family operations, and specify conditions for dangerous operations.
  • Loading branch information
popcnt1 authored Oct 23, 2024
1 parent b739280 commit 17eae67
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/rooch/src/commands/da/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Toolkits for RoochDA.

### Usage

1. Unpack tx list:
1. Unpack tx list to human-readable format:

```shell
rooch da unpack --segment-dir {segment-dir} -batch-dir {batch-dir}
Expand Down
31 changes: 30 additions & 1 deletion crates/rooch/src/commands/db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,37 @@ Toolkits for RoochDB.

### Usage

1. Revert tx by tx_order(> 0):
#### Revert

Revert the transaction by tx_order.

```shell
rooch db revert-tx --tx-order {tx_order} -d {data_dir} -n {network}
```

tx_order: The order of the transaction to be reverted. Must be last tx_order. If not, it will panic and print the last
tx_order.

#### Rollback

Rollback to tx_order.

```shell
rooch db rollback --tx-order {tx_order} -d {data_dir} -n {network}
```

#### Drop

Drop the database column family.

drop column family is a dangerous operation, make sure you know what you are doing

```shell
rooch db drop --cf-name {column_family} -d {data_dir} -n {network} --force true
```

re-create the column family after dropping for cleaning up the column family.

```shell
rooch db drop --cf-name {column_family} -d {data_dir} -n {network} --force true --re-create true
```

0 comments on commit 17eae67

Please sign in to comment.