aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/feeds.go
diff options
context:
space:
mode:
authorElad <theman@elad.im>2018-10-12 20:51:38 +0800
committerAnton Evangelatov <anton.evangelatov@gmail.com>2018-10-12 20:51:38 +0800
commit4868964bb99facd8cc6149626023e64db14a6742 (patch)
tree858bfaddcb1f1381e3bb2e0dd4c72aed397e621d /cmd/swarm/feeds.go
parent6f607de5d590ff2fbe8798b04e5924be3b7ca0b4 (diff)
downloadgo-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.gz
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.bz2
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.lz
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.xz
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.tar.zst
go-tangerine-4868964bb99facd8cc6149626023e64db14a6742.zip
cmd/swarm: split flags and cli command declarations to the relevant files (#17896)
Diffstat (limited to 'cmd/swarm/feeds.go')
-rw-r--r--cmd/swarm/feeds.go62
1 files changed, 62 insertions, 0 deletions
diff --git a/cmd/swarm/feeds.go b/cmd/swarm/feeds.go
index 6806c6cf4..f26a8cc7d 100644
--- a/cmd/swarm/feeds.go
+++ b/cmd/swarm/feeds.go
@@ -31,6 +31,68 @@ import (
"gopkg.in/urfave/cli.v1"
)
+var feedCommand = cli.Command{
+ CustomHelpTemplate: helpTemplate,
+ Name: "feed",
+ Usage: "(Advanced) Create and update Swarm Feeds",
+ ArgsUsage: "<create|update|info>",
+ Description: "Works with Swarm Feeds",
+ Subcommands: []cli.Command{
+ {
+ Action: feedCreateManifest,
+ CustomHelpTemplate: helpTemplate,
+ Name: "create",
+ Usage: "creates and publishes a new feed manifest",
+ Description: `creates and publishes a new feed manifest pointing to a specified user's updates about a particular topic.
+ The feed topic can be built in the following ways:
+ * use --topic to set the topic to an arbitrary binary hex string.
+ * use --name to set the topic to a human-readable name.
+ For example --name could be set to "profile-picture", meaning this feed allows to get this user's current profile picture.
+ * use both --topic and --name to create named subtopics.
+ For example, --topic could be set to an Ethereum contract address and --name could be set to "comments", meaning
+ this feed tracks a discussion about that contract.
+ The --user flag allows to have this manifest refer to a user other than yourself. If not specified,
+ it will then default to your local account (--bzzaccount)`,
+ Flags: []cli.Flag{SwarmFeedNameFlag, SwarmFeedTopicFlag, SwarmFeedUserFlag},
+ },
+ {
+ Action: feedUpdate,
+ CustomHelpTemplate: helpTemplate,
+ Name: "update",
+ Usage: "updates the content of an existing Swarm Feed",
+ ArgsUsage: "<0x Hex data>",
+ Description: `publishes a new update on the specified topic
+ The feed topic can be built in the following ways:
+ * use --topic to set the topic to an arbitrary binary hex string.
+ * use --name to set the topic to a human-readable name.
+ For example --name could be set to "profile-picture", meaning this feed allows to get this user's current profile picture.
+ * use both --topic and --name to create named subtopics.
+ For example, --topic could be set to an Ethereum contract address and --name could be set to "comments", meaning
+ this feed tracks a discussion about that contract.
+
+ If you have a manifest, you can specify it with --manifest to refer to the feed,
+ instead of using --topic / --name
+ `,
+ Flags: []cli.Flag{SwarmFeedManifestFlag, SwarmFeedNameFlag, SwarmFeedTopicFlag},
+ },
+ {
+ Action: feedInfo,
+ CustomHelpTemplate: helpTemplate,
+ Name: "info",
+ Usage: "obtains information about an existing Swarm feed",
+ Description: `obtains information about an existing Swarm feed
+ The topic can be specified directly with the --topic flag as an hex string
+ If no topic is specified, the default topic (zero) will be used
+ The --name flag can be used to specify subtopics with a specific name.
+ The --user flag allows to refer to a user other than yourself. If not specified,
+ it will then default to your local account (--bzzaccount)
+ If you have a manifest, you can specify it with --manifest instead of --topic / --name / ---user
+ to refer to the feed`,
+ Flags: []cli.Flag{SwarmFeedManifestFlag, SwarmFeedNameFlag, SwarmFeedTopicFlag, SwarmFeedUserFlag},
+ },
+ },
+}
+
func NewGenericSigner(ctx *cli.Context) feed.Signer {
return feed.NewGenericSigner(getPrivKey(ctx))
}