aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/main.go
diff options
context:
space:
mode:
authorLewis Marshall <lewis@lmars.net>2017-07-31 19:23:44 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-07-31 19:23:44 +0800
commite9b850805eebc55ea8486323a1a7861b9b554430 (patch)
treec5df8c23899053824c49aa0390309e415a33da51 /cmd/swarm/main.go
parent53f3460ab5b94875edf90c8b0f5da46b0c104321 (diff)
downloaddexon-e9b850805eebc55ea8486323a1a7861b9b554430.tar.gz
dexon-e9b850805eebc55ea8486323a1a7861b9b554430.tar.zst
dexon-e9b850805eebc55ea8486323a1a7861b9b554430.zip
cmd/swarm: support exporting, importing chunk db (#14868)
Diffstat (limited to 'cmd/swarm/main.go')
-rw-r--r--cmd/swarm/main.go59
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'.
`,
},
}