diff options
author | Javier Peletier <jm@epiclabs.io> | 2018-09-30 15:43:10 +0800 |
---|---|---|
committer | Javier Peletier <jm@epiclabs.io> | 2018-10-03 15:12:06 +0800 |
commit | 83705ef6aa3645a6305a400fa175e44904a929f7 (patch) | |
tree | 013c6594b7d275ab5eaa90b3969e77719787483f /cmd/swarm/mru.go | |
parent | b35622cf3c758d96874f287d137725946fc6341d (diff) | |
download | go-tangerine-83705ef6aa3645a6305a400fa175e44904a929f7.tar.gz go-tangerine-83705ef6aa3645a6305a400fa175e44904a929f7.tar.zst go-tangerine-83705ef6aa3645a6305a400fa175e44904a929f7.zip |
swarm/storage/mru: Renamed rest of MRU references
Diffstat (limited to 'cmd/swarm/mru.go')
-rw-r--r-- | cmd/swarm/mru.go | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/cmd/swarm/mru.go b/cmd/swarm/mru.go index afa73820f..6c6d44c0a 100644 --- a/cmd/swarm/mru.go +++ b/cmd/swarm/mru.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. -// Command resource allows the user to create and update signed Swarm Feeds +// Command feed allows the user to create and update signed Swarm Feeds package main import ( @@ -36,8 +36,8 @@ func NewGenericSigner(ctx *cli.Context) mru.Signer { } func getTopic(ctx *cli.Context) (topic mru.Topic) { - var name = ctx.String(SwarmResourceNameFlag.Name) - var relatedTopic = ctx.String(SwarmResourceTopicFlag.Name) + var name = ctx.String(SwarmFeedNameFlag.Name) + var relatedTopic = ctx.String(SwarmFeedTopicFlag.Name) var relatedTopicBytes []byte var err error @@ -55,35 +55,35 @@ func getTopic(ctx *cli.Context) (topic mru.Topic) { return topic } -// swarm resource create <frequency> [--name <name>] [--data <0x Hexdata> [--multihash=false]] -// swarm resource update <Manifest Address or ENS domain> <0x Hexdata> [--multihash=false] -// swarm resource info <Manifest Address or ENS domain> +// swarm feed create <frequency> [--name <name>] [--data <0x Hexdata> [--multihash=false]] +// swarm feed update <Manifest Address or ENS domain> <0x Hexdata> [--multihash=false] +// swarm feed info <Manifest Address or ENS domain> -func resourceCreate(ctx *cli.Context) { +func feedCreateManifest(ctx *cli.Context) { var ( bzzapi = strings.TrimRight(ctx.GlobalString(SwarmApiFlag.Name), "/") client = swarm.NewClient(bzzapi) ) - newResourceRequest := mru.NewFirstRequest(getTopic(ctx)) - newResourceRequest.Feed.User = resourceGetUser(ctx) + newFeedUpdateRequest := mru.NewFirstRequest(getTopic(ctx)) + newFeedUpdateRequest.Feed.User = feedGetUser(ctx) - manifestAddress, err := client.CreateResource(newResourceRequest) + manifestAddress, err := client.CreateFeedWithManifest(newFeedUpdateRequest) if err != nil { - utils.Fatalf("Error creating resource: %s", err.Error()) + utils.Fatalf("Error creating feed manifest: %s", err.Error()) return } fmt.Println(manifestAddress) // output manifest address to the user in a single line (useful for other commands to pick up) } -func resourceUpdate(ctx *cli.Context) { +func feedUpdate(ctx *cli.Context) { args := ctx.Args() var ( bzzapi = strings.TrimRight(ctx.GlobalString(SwarmApiFlag.Name), "/") client = swarm.NewClient(bzzapi) - manifestAddressOrDomain = ctx.String(SwarmResourceManifestFlag.Name) + manifestAddressOrDomain = ctx.String(SwarmFeedManifestFlag.Name) ) if len(args) < 1 { @@ -110,10 +110,10 @@ func resourceUpdate(ctx *cli.Context) { } - // Retrieve resource status and metadata out of the manifest - updateRequest, err = client.GetResourceMetadata(query, manifestAddressOrDomain) + // Retrieve feed status and metadata out of the manifest + updateRequest, err = client.GetFeedMetadata(query, manifestAddressOrDomain) if err != nil { - utils.Fatalf("Error retrieving resource status: %s", err.Error()) + utils.Fatalf("Error retrieving feed status: %s", err.Error()) } // set the new data @@ -121,34 +121,34 @@ func resourceUpdate(ctx *cli.Context) { // sign update if err = updateRequest.Sign(signer); err != nil { - utils.Fatalf("Error signing resource update: %s", err.Error()) + utils.Fatalf("Error signing feed update: %s", err.Error()) } // post update - err = client.UpdateResource(updateRequest) + err = client.UpdateFeed(updateRequest) if err != nil { - utils.Fatalf("Error updating resource: %s", err.Error()) + utils.Fatalf("Error updating feed: %s", err.Error()) return } } -func resourceInfo(ctx *cli.Context) { +func feedInfo(ctx *cli.Context) { var ( bzzapi = strings.TrimRight(ctx.GlobalString(SwarmApiFlag.Name), "/") client = swarm.NewClient(bzzapi) - manifestAddressOrDomain = ctx.String(SwarmResourceManifestFlag.Name) + manifestAddressOrDomain = ctx.String(SwarmFeedManifestFlag.Name) ) var query *mru.Query if manifestAddressOrDomain == "" { query = new(mru.Query) query.Topic = getTopic(ctx) - query.User = resourceGetUser(ctx) + query.User = feedGetUser(ctx) } - metadata, err := client.GetResourceMetadata(query, manifestAddressOrDomain) + metadata, err := client.GetFeedMetadata(query, manifestAddressOrDomain) if err != nil { - utils.Fatalf("Error retrieving resource metadata: %s", err.Error()) + utils.Fatalf("Error retrieving feed metadata: %s", err.Error()) return } encodedMetadata, err := metadata.MarshalJSON() @@ -158,8 +158,8 @@ func resourceInfo(ctx *cli.Context) { fmt.Println(string(encodedMetadata)) } -func resourceGetUser(ctx *cli.Context) common.Address { - var user = ctx.String(SwarmResourceUserFlag.Name) +func feedGetUser(ctx *cli.Context) common.Address { + var user = ctx.String(SwarmFeedUserFlag.Name) if user != "" { return common.HexToAddress(user) } |