File tree Expand file tree Collapse file tree 4 files changed +39
-19
lines changed Expand file tree Collapse file tree 4 files changed +39
-19
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ func keysAddCmd(ctx *cmdContext) *cobra.Command {
68
68
Example : strings .TrimSpace (`
69
69
$ keys add localnet key1
70
70
$ keys add l2 key2 --bech32 celestia
71
- $ keys add l2 key2 --restore mnemonic.txt` ),
71
+ $ keys add l2 key2 --recover --source mnemonic.txt` ),
72
72
RunE : func (cmd * cobra.Command , args []string ) error {
73
73
chainId := args [0 ]
74
74
keyName := args [1 ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "os"
5
+ "path"
6
+
7
+ "github.com/spf13/cobra"
8
+
9
+ bottypes "github.com/initia-labs/opinit-bots-go/bot/types"
10
+ )
11
+
12
+ func resetStateCmd (ctx * cmdContext ) * cobra.Command {
13
+ cmd := & cobra.Command {
14
+ Use : "reset-db [bot-name]" ,
15
+ Args : cobra .ExactArgs (1 ),
16
+ Short : "Reset a bot's db." ,
17
+ Long : `Reset a bot's db.
18
+ ` ,
19
+ RunE : func (cmd * cobra.Command , args []string ) error {
20
+ botType := bottypes .BotTypeFromString (args [0 ])
21
+ switch botType {
22
+ case bottypes .BotTypeExecutor :
23
+ dbPath := path .Join (ctx .homePath , string (botType ))
24
+ err := os .RemoveAll (dbPath + ".db" )
25
+ if err != nil {
26
+ return err
27
+ }
28
+ err = os .Remove (path .Join (ctx .homePath , "batch" ))
29
+ if err != nil {
30
+ return err
31
+ }
32
+ }
33
+ return nil
34
+ },
35
+ }
36
+ return cmd
37
+ }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ func NewRootCmd() *cobra.Command {
45
45
initCmd (ctx ),
46
46
startCmd (ctx ),
47
47
keysCmd (ctx ),
48
+ resetStateCmd (ctx ),
48
49
version .NewVersionCommand (),
49
50
)
50
51
You can’t perform that action at this time.
0 commit comments