From 365c549d7cf021b96a7ce55548183d8e4f9e75eb Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 23 Jan 2017 13:34:22 +0100 Subject: [PATCH] Fix #5: Rename apps to ipfs-cluster-service and ipfs-cluster-ctl License: MIT Signed-off-by: Hector Sanjuan --- .gitignore | 4 +- .travis.yml | 4 +- Makefile | 18 ++++---- README.md | 42 +++++++++---------- architecture.md | 12 +++--- {ipfscluster => ipfs-cluster-ctl}/Makefile | 6 +-- {ipfscluster => ipfs-cluster-ctl}/main.go | 2 +- ipfs-cluster-service/Makefile | 12 ++++++ .../main.go | 12 +++--- ipfscluster-server/Makefile | 12 ------ 10 files changed, 62 insertions(+), 62 deletions(-) rename {ipfscluster => ipfs-cluster-ctl}/Makefile (50%) rename {ipfscluster => ipfs-cluster-ctl}/main.go (99%) create mode 100644 ipfs-cluster-service/Makefile rename {ipfscluster-server => ipfs-cluster-service}/main.go (93%) delete mode 100644 ipfscluster-server/Makefile diff --git a/.gitignore b/.gitignore index ee6770f6..37f034c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ coverage.out -ipfscluster-server/ipfscluster-server -ipfscluster/ipfscluster +ipfs-cluster-service/ipfs-cluster-service +ipfs-cluster-ctl/ipfs-cluster-ctl # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o diff --git a/.travis.yml b/.travis.yml index 48a728ce..bd0ca099 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ install: - make deps script: - make test -- make server -- make client +- make service +- make ctl - "$GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN" env: global: diff --git a/Makefile b/Makefile index 447f1583..1d4e94f1 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ all: server client clean: rwundo - $(MAKE) -C ipfscluster-server clean - $(MAKE) -C ipfscluster clean + $(MAKE) -C ipfs-cluster-service clean + $(MAKE) -C ipfs-cluster-ctl clean install: deps - $(MAKE) -C ipfscluster-server install - $(MAKE) -C ipfscluster install + $(MAKE) -C ipfs-cluster-service install + $(MAKE) -C ipfs-cluster-ctl install -server: deps - $(MAKE) -C ipfscluster-server ipfscluster-server -client: deps - $(MAKE) -C ipfscluster ipfscluster +service: deps + $(MAKE) -C ipfs-cluster-service ipfs-cluster-service +ctl: deps + $(MAKE) -C ipfs-cluster-ctl ipfs-cluster-ctl gx: go get github.com/whyrusleeping/gx @@ -29,4 +29,4 @@ rwundo: gx-go rewrite --undo publish: rwundo gx publish -.PHONY: all gx deps test rw rwundo publish server install clean +.PHONY: all gx deps test rw rwundo publish service ctl install clean diff --git a/README.md b/README.md index 768b47c7..8a9e7e73 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ `ipfs-cluster` is a tool which groups a number of IPFS nodes together, allowing to collectively perform operations such as pinning. -In order to do so IPFS Cluster server nodes use a libp2p-based consensus algorithm (currently Raft) to agree on a log of operations and build a consistent state across the cluster. The state represents which objects should be pinned by which nodes. +In order to do so IPFS Cluster nodes use a libp2p-based consensus algorithm (currently Raft) to agree on a log of operations and build a consistent state across the cluster. The state represents which objects should be pinned by which nodes. -Additionally, server nodes act as a proxy/wrapper to the IPFS API, so they can be used as a regular node, with the difference that pin requests are handled by the Cluster. +Additionally, cluster nodes act as a proxy/wrapper to the IPFS API, so they can be used as a regular node, with the difference that pin requests are handled by the Cluster. -IPFS Cluster provides a server application (`ipfscluster-server`), a Go API, a HTTP API and a command-line tool (`ipfscluster`). +IPFS Cluster provides a cluster-node application (`ipfs-cluster-service`), a Go API, a HTTP API and a command-line tool (`ipfs-cluster-ctl`). Current functionality only allows pinning in all cluster members, but more strategies (like setting a replication factor for each pin) will be developed. @@ -40,7 +40,7 @@ Current functionality only allows pinning in all cluster members, but more strat Since the start of IPFS it was clear that a tool to coordinate a number of different nodes (and the content they are supposed to store) would add a great value to the IPFS ecosystem. Naïve approaches are possible, but they present some weaknesses, specially at dealing with error handling, recovery and implementation of advanced pinning strategies. -`ipfs-cluster` aims to address this issues by providing a IPFS node wrapper which coordinates multiple cluster members via a consensus algorithm. This ensures that the desired state of the system is always agreed upon and can be easily maintained by the members of the cluster. Thus, every cluster member knows which content is tracked, can decide whether asking IPFS to pin it and can react to any contingencies like server reboots. +`ipfs-cluster` aims to address this issues by providing a IPFS node wrapper which coordinates multiple cluster members via a consensus algorithm. This ensures that the desired state of the system is always agreed upon and can be easily maintained by the members of the cluster. Thus, every cluster member knows which content is tracked, can decide whether asking IPFS to pin it and can react to any contingencies like node reboots. ## Captain @@ -48,7 +48,7 @@ This project is captained by [@hsanjuan](https://github.com/hsanjuan). See the [ ## Install -In order to install the `ipfscluster-server` the `ipfscluster` tool simply download this repository and run `make` as follows: +In order to install the `ipfs-cluster-service` the `ipfs-cluster-ctl` tool simply download this repository and run `make` as follows: ``` $ go get -u -d github.com/ipfs/ipfs-cluster @@ -56,26 +56,26 @@ $ cd $GOPATH/src/github.com/ipfs/ipfs-cluster $ make install ``` -This will install `ipfscluster-server` and `ipfscluster` in your `$GOPATH/bin` folder. +This will install `ipfs-cluster-service` and `ipfs-cluster-ctl` in your `$GOPATH/bin` folder. ## Usage -### `ipfscluster-server` +### `ipfs-cluster-service` -`ipfscluster-server` runs a member node for the cluster. Usage information can be obtained running: +`ipfs-cluster-service` runs a member node for the cluster. Usage information can be obtained running: ``` -$ ipfscluster-server -h +$ ipfs-cluster-service -h ``` -Before running `ipfscluster-server` for the first time, initialize a configuration file with: +Before running `ipfs-cluster-service` for the first time, initialize a configuration file with: ``` -$ ipfscluster-server -init +$ ipfs-cluster-service -init ``` -The configuration will be placed in `~/.ipfs-cluster/server.json` by default. +The configuration will be placed in `~/.ipfs-cluster/service.json` by default. You can add the multiaddresses for the other members of the cluster in the `cluster_peers` variable. For example, here is a valid configuration for a cluster of 4 members: @@ -103,24 +103,24 @@ You can add the multiaddresses for the other members of the cluster in the `clus The configuration file should probably be identical among all cluster members, except for the `id` and `private_key` fields. To facilitate configuration, `cluster_peers` includes its own address, but it does not have to. -Once every cluster member has the configuration in place, you can run `ipfscluster-server` to start the cluster. +Once every cluster member has the configuration in place, you can run `ipfs-cluster-service` to start the cluster. -### `ipfscluster` +### `ipfs-cluster-ctl` -`ipfscluster` is the client application to manage the cluster servers and perform actions. `ipfscluster` uses the HTTP API provided by the server nodes. +`ipfs-cluster-ctl` is the client application to manage the cluster nodes and perform actions. `ipfs-cluster-ctl` uses the HTTP API provided by the nodes. -After installing, you can run `ipfscluster --help` to display general description and options, or alternatively `ipfscluster help [cmd]` to display +After installing, you can run `ipfs-cluster-ctl --help` to display general description and options, or alternatively `ipfs-cluster-ctl help [cmd]` to display information about supported commands. In summary, it works as follows: ``` -$ ipfscluster member ls # list cluster members -$ ipfscluster pin add Qma4Lid2T1F68E3Xa3CpE6vVJDLwxXLD8RfiB9g1Tmqp58 # pins a Cid in the cluster -$ ipfscluster pin rm Qma4Lid2T1F68E3Xa3CpE6vVJDLwxXLD8RfiB9g1Tmqp58 # unpins a Cid from the cluster -$ ipfscluster status # display tracked Cids information -$ ipfscluster sync Qma4Lid2T1F68E3Xa3CpE6vVJDLwxXLD8RfiB9g1Tmqp58 # recover Cids in error status +$ ipfs-cluster-ctl member ls # list cluster members +$ ipfs-cluster-ctl pin add Qma4Lid2T1F68E3Xa3CpE6vVJDLwxXLD8RfiB9g1Tmqp58 # pins a Cid in the cluster +$ ipfs-cluster-ctl pin rm Qma4Lid2T1F68E3Xa3CpE6vVJDLwxXLD8RfiB9g1Tmqp58 # unpins a Cid from the cluster +$ ipfs-cluster-ctl status # display tracked Cids information +$ ipfs-cluster-ctl sync Qma4Lid2T1F68E3Xa3CpE6vVJDLwxXLD8RfiB9g1Tmqp58 # recover Cids in error status ``` ### Go diff --git a/architecture.md b/architecture.md index 2f033f04..b06f8350 100644 --- a/architecture.md +++ b/architecture.md @@ -6,8 +6,8 @@ These definitions are still evolving and may change: * Member: an ipfs cluster server node which is member of the consensus. Alternatively: node, peer * ipfs-cluster: the IPFS cluster software - * ipfscluster: the IPFS cluster client command line application - * ipfscluster-server: the IPFS cluster server application. + * ipfs-cluster-ctl: the IPFS cluster client command line application + * ipfs-cluster-service: the IPFS cluster node application * API: the REST-ish API implemented by the RESTAPI component and used by the clients. * RPC API: the internal API that cluster members and components use. * Go API: the public interface offered by the Cluster object in Go. @@ -54,13 +54,13 @@ Currently, all components live in the same `ipfscluster` Go module, but they sha ## Applications -### `ipfscluster-server` +### `ipfs-cluster-service` -This is the server application of IPFS Cluster. It brings up a cluster, connects to other members, gets the latest consensus state and participates in cluster. +This is the service application of IPFS Cluster. It brings up a cluster, connects to other members, gets the latest consensus state and participates in cluster. -### `ipfscluster` +### `ipfs-cluster-ctl` -This is the client application of IPFS Cluster. It is a command line interface which uses the REST API to communicate with Cluster. +This is the client/control application of IPFS Cluster. It is a command line interface which uses the REST API to communicate with Cluster. ## Legacy illustrations diff --git a/ipfscluster/Makefile b/ipfs-cluster-ctl/Makefile similarity index 50% rename from ipfscluster/Makefile rename to ipfs-cluster-ctl/Makefile index fe28986a..ee7bab8a 100644 --- a/ipfscluster/Makefile +++ b/ipfs-cluster-ctl/Makefile @@ -1,12 +1,12 @@ -all: ipfscluster +all: ipfs-cluster-ctl -ipfscluster: +ipfs-cluster-ctl: go build install: go install clean: - rm -f ipfscluster + rm -f ipfs-cluster-ctl .PHONY: clean install diff --git a/ipfscluster/main.go b/ipfs-cluster-ctl/main.go similarity index 99% rename from ipfscluster/main.go rename to ipfs-cluster-ctl/main.go index bcc39a2b..b2bbcc75 100644 --- a/ipfscluster/main.go +++ b/ipfs-cluster-ctl/main.go @@ -16,7 +16,7 @@ import ( logging "github.com/ipfs/go-log" ) -const programName = `ipfscluster` +const programName = `ipfs-cluster-ctl` var ( defaultHost = fmt.Sprintf("127.0.0.1:%d", 9094) diff --git a/ipfs-cluster-service/Makefile b/ipfs-cluster-service/Makefile new file mode 100644 index 00000000..0601a5b6 --- /dev/null +++ b/ipfs-cluster-service/Makefile @@ -0,0 +1,12 @@ +all: ipfs-cluster-service + +ipfs-cluster-service: + go build + +install: + go install + +clean: + rm -f ipfs-cluster-service + +.PHONY: clean install diff --git a/ipfscluster-server/main.go b/ipfs-cluster-service/main.go similarity index 93% rename from ipfscluster-server/main.go rename to ipfs-cluster-service/main.go index c647e956..defd7d32 100644 --- a/ipfscluster-server/main.go +++ b/ipfs-cluster-service/main.go @@ -14,17 +14,17 @@ import ( ) // ProgramName of this application -const programName = `ipfscluster-server` +const programName = `ipfs-cluster-service` // Description provides a short summary of the functionality of this tool var Description = fmt.Sprintf(` %s runs an IPFS Cluster member (version %s). -A member is a server node which participates in the cluster consensus, follows +A member is a node which participates in the cluster consensus, follows a distributed log of pinning and unpinning operations and manages pinning operations to a configured IPFS daemon. -This server also provides an API for cluster management, an IPFS Proxy API which +This node also provides an API for cluster management, an IPFS Proxy API which forwards requests to IPFS and a number of components for internal communication using LibP2P. @@ -45,11 +45,11 @@ https://github.com/ipfs/ipfs-cluster. // Default location for the configurations and data var ( - // DefaultPath is initialized to something like ~/.ipfs-cluster/server.json + // DefaultPath is initialized to something like ~/.ipfs-cluster/service.json // and holds all the ipfs-cluster data DefaultPath = ".ipfs-cluster" // The name of the configuration file inside DefaultPath - DefaultConfigFile = "server.json" + DefaultConfigFile = "service.json" // The name of the data folder inside DefaultPath DefaultDataFolder = "data" ) @@ -93,7 +93,7 @@ func init() { flag.BoolVar(&initFlag, "init", false, "create a default configuration and exit") flag.StringVar(&configFlag, "config", configPath, - "path to the ipfscluster-server configuration file") + "path to the ipfs-cluster-service configuration file") flag.BoolVar(&debugFlag, "debug", false, "enable full debug logs of ipfs cluster and consensus layers") flag.StringVar(&logLevelFlag, "loglevel", "info", diff --git a/ipfscluster-server/Makefile b/ipfscluster-server/Makefile deleted file mode 100644 index ed4bc2eb..00000000 --- a/ipfscluster-server/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -all: ipfscluster-server - -ipfscluster-server: - go build - -install: - go install - -clean: - rm -f ipfscluster-server - -.PHONY: clean install