good morning!!!!

Skip to content
Snippets Groups Projects
Commit fe41bd6f authored by Taylor Gerring's avatar Taylor Gerring
Browse files

Add "removedb" command to Geth

Removes the state and blockchain databases
parent 677796b3
No related branches found
No related tags found
No related merge requests found
......@@ -230,6 +230,11 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
Name: "upgradedb",
Usage: "upgrade chainblock database",
},
{
Action: removeDb,
Name: "removedb",
Usage: "Remove blockchain and state databases",
},
}
app.Flags = []cli.Flag{
utils.IdentityFlag,
......@@ -543,6 +548,16 @@ func exportchain(ctx *cli.Context) {
return
}
func removeDb(ctx *cli.Context) {
fmt.Println("Removing chain and state databases...")
start := time.Now()
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "blockchain"))
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "state"))
fmt.Printf("Removed in %v\n", time.Since(start))
}
func upgradeDb(ctx *cli.Context) {
fmt.Println("Upgrade blockchain DB")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment