diff options
Diffstat (limited to 'cmd/swarm/main.go')
-rw-r--r-- | cmd/swarm/main.go | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 4ae06a1c9..449d11f36 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -240,12 +240,65 @@ Removes a path from the manifest }, }, { - Action: cleandb, + Name: "db", + Usage: "manage the local chunk database", + ArgsUsage: "db COMMAND", + Description: ` +Manage the local chunk database. +`, + Subcommands: []cli.Command{ + { + Action: dbExport, + Name: "export", + Usage: "export a local chunk database as a tar archive (use - to send to stdout)", + ArgsUsage: "<chunkdb> <file>", + Description: ` +Export a local chunk database as a tar archive (use - to send to stdout). + + swarm db export ~/.ethereum/swarm/bzz-KEY/chunks chunks.tar + +The export may be quite large, consider piping the output through the Unix +pv(1) tool to get a progress bar: + + swarm db export ~/.ethereum/swarm/bzz-KEY/chunks - | pv > chunks.tar +`, + }, + { + Action: dbImport, + Name: "import", + Usage: "import chunks from a tar archive into a local chunk database (use - to read from stdin)", + ArgsUsage: "<chunkdb> <file>", + Description: ` +Import chunks from a tar archive into a local chunk database (use - to read from stdin). + + swarm db import ~/.ethereum/swarm/bzz-KEY/chunks chunks.tar + +The import may be quite large, consider piping the input through the Unix +pv(1) tool to get a progress bar: + + pv chunks.tar | swarm db import ~/.ethereum/swarm/bzz-KEY/chunks - +`, + }, + { + Action: dbClean, + Name: "clean", + Usage: "remove corrupt entries from a local chunk database", + ArgsUsage: "<chunkdb>", + Description: ` +Remove corrupt entries from a local chunk database. +`, + }, + }, + }, + { + Action: func(ctx *cli.Context) { + utils.Fatalf("ERROR: 'swarm cleandb' has been removed, please use 'swarm db clean'.") + }, Name: "cleandb", - Usage: "Cleans database of corrupted entries", + Usage: "DEPRECATED: use 'swarm db clean'", ArgsUsage: " ", Description: ` -Cleans database of corrupted entries. +DEPRECATED: use 'swarm db clean'. `, }, } |