github.com/aergoio/aergo@v1.3.1/cmd/brick/exec/resetChain.go (about)

     1  package exec
     2  
     3  import (
     4  	"github.com/aergoio/aergo/cmd/brick/context"
     5  )
     6  
     7  func init() {
     8  	registerExec(&resetChain{})
     9  }
    10  
    11  type resetChain struct{}
    12  
    13  func (c *resetChain) Command() string {
    14  	return "reset"
    15  }
    16  
    17  func (c *resetChain) Syntax() string {
    18  	return ""
    19  }
    20  
    21  func (c *resetChain) Usage() string {
    22  	return "reset"
    23  }
    24  
    25  func (c *resetChain) Describe() string {
    26  	return "reset to a new dummy chain"
    27  }
    28  
    29  func (c *resetChain) Validate(args string) error {
    30  
    31  	return nil
    32  }
    33  
    34  func (c *resetChain) Run(args string) (string, error) {
    35  
    36  	context.Reset()
    37  
    38  	resetContractInfoInterface()
    39  
    40  	return "reset a dummy chain successfully", nil
    41  }