From 9ce7455228938561d16a7445d51907484265ad44 Mon Sep 17 00:00:00 2001 From: kansi Date: Thu, 21 Dec 2017 12:23:15 +0530 Subject: [PATCH 1/4] Migrate cli for Tendermint --- proposals/migrate-cli.md | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 proposals/migrate-cli.md diff --git a/proposals/migrate-cli.md b/proposals/migrate-cli.md new file mode 100644 index 00000000..342a8799 --- /dev/null +++ b/proposals/migrate-cli.md @@ -0,0 +1,68 @@ +# Migrate Bigchaindb cli for Tendermint + +## Problem Description +With Tendermint integration some of the cli sub-commands have been rendered obsolete. It would be only appropriate to white list sub-commands depending on the backend. + +### Use cases +- Avoid confusing the user by not displaying irrelevant sub-commands. + + +## Proposed Change +Following sub-commands should be updated + +- `bigchaindb --help`: list the relevant sub-commands depending on the configured backend. In case the backend is not configured then the default backend `mongodb` should be assumed. + +Following sub-commands should be depreciated for `localmongodb` backend. + +- `bigchaindb export-my-pubkey` +- `bigchaindb set-shards` +- `bigchaindb set-replicas` + +**NOTE**: In case the user attempts to execute the above depreciated sub-commands an error message stating their in-compatibility with `localmongodb` should be displayed. + +### Usage example +N/A + +### Data model impact +N/A + +### API impact +N/A + +### Security impact +N/A + +### Performance impact +N/A + +### End user impact +N/A + +### Deployment impact +N/A + +### Documentation impact +The documentation for depreciated sub-commands should indicate that they are not compatible with `localmongodb` backend. + + +### Testing impact +Following test cases should be added +- Set `localmongodb` as backend, then executing the depreciated sub-commands should give an error. +- Set `localmongodb` as backend, then executing `bigchaindb --help`, `bigchaindb -h` should not list the deprecated sub-commands. + + +## Implementation + +### Assignee(s) +Primary assignee(s): @kansi + +### Targeted Release +BigchainDB 2.0 + + +## Dependencies +N/A + + +## Reference(s) +* [Bigchaindb CLI](https://docs.bigchaindb.com/projects/server/en/latest/server-reference/bigchaindb-cli.html) From 7f5000330388496d3325a3d95a89d3ca79b4fe5a Mon Sep 17 00:00:00 2001 From: Ahmed Muawia Khan Date: Thu, 22 Feb 2018 12:54:26 +0100 Subject: [PATCH 2/4] Update the migrate-cli proposal - No need to deprecate commands that are not needed because tendermint integrated BigchainDB does not overlap with BigchainDB(v1.x) - Update some sets - Add more commands and usage. --- proposals/migrate-cli.md | 115 +++++++++++++++++++++++++++++++++++---- 1 file changed, 104 insertions(+), 11 deletions(-) diff --git a/proposals/migrate-cli.md b/proposals/migrate-cli.md index 342a8799..f36112d7 100644 --- a/proposals/migrate-cli.md +++ b/proposals/migrate-cli.md @@ -1,27 +1,117 @@ # Migrate Bigchaindb cli for Tendermint ## Problem Description -With Tendermint integration some of the cli sub-commands have been rendered obsolete. It would be only appropriate to white list sub-commands depending on the backend. +With Tendermint integration some of the cli sub-commands have been rendered obsolete. It would be only appropriate to remove those sub-commands. ### Use cases - Avoid confusing the user by not displaying irrelevant sub-commands. ## Proposed Change -Following sub-commands should be updated +Following sub-commands should be updated/removed: -- `bigchaindb --help`: list the relevant sub-commands depending on the configured backend. In case the backend is not configured then the default backend `mongodb` should be assumed. +- `bigchaindb --help`: list the relevant sub-commands for `localmongodb` backend. +`mongodb` and `rethinkdb` will be deprecated. +In case the backend is not configured then the default backend `localmongodb` should be assumed. -Following sub-commands should be depreciated for `localmongodb` backend. +Following sub-commands should be deprecated for `localmongodb` backend. - `bigchaindb export-my-pubkey` + - A BigchainDB node still has a public key but that is not BigchainDB concern. It is handled by Tendermint. - `bigchaindb set-shards` + - This was only required for `rethinkdb`. - `bigchaindb set-replicas` - -**NOTE**: In case the user attempts to execute the above depreciated sub-commands an error message stating their in-compatibility with `localmongodb` should be displayed. + - This was only required for `rethinkdb`. +- `bigchaindb add-replicas` + - This was only required for `mongodb` backend to add nodes to the MongoDB Replica Set, which is not required anymore, + because we are using standalone MongoDB instances i.e. `localmongodb`. +- `bigchaindb remove-replicas` + - This was only required for backend to remove nodes from the MongoDB Replica Set, which is not required anymore. ### Usage example -N/A +**bigchaindb** + +``` +$ bigchaindb --help +usage: bigchaindb [-h] [-c CONFIG] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] + [-y] [-v] + {configure,show-config,init,drop,start} + ... + +Control your BigchainDB node. + +optional arguments: + -h, --help show this help message and exit + -c CONFIG, --config CONFIG + Specify the location of the configuration file (use + "-" for stdout) + -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} + Log level + -y, --yes, --yes-please + Assume "yes" as answer to all prompts and run non- + interactively + -v, --version show program's version number and exit + +Commands: + {configure,show-config,export-my-pubkey,init,drop,start,set-shards,set-replicas,add-replicas,remove-replicas} + configure Prepare the config file and create the node keypair + show-config Show the current configuration + init Init the database + drop Drop the database + start Start BigchainDB +``` + +**bigchaindb configure** + +``` +$ bigchaindb configure --help +usage: bigchaindb configure [-h] {localmongodb} + +positional arguments: + {localmongodb} The backend to use. It can be only be `localmongodb`. + +optional arguments: + -h, --help show this help message and exit +``` + +**bigchaindb show-config** + +``` +$ bigchaindb show-config --help +usage: bigchaindb show-config [-h] + +optional arguments: + -h, --help show this help message and exit +``` + +**bigchaindb init** + +``` +$ bigchaindb init --help +usage: bigchaindb init [-h] + +optional arguments: + -h, --help show this help message and exit +``` + +**bigchaindb drop** + +``` +$ bigchaindb drop --help +usage: bigchaindb drop [-h] + +optional arguments: + -h, --help show this help message and exit +``` + +**bigchaindb start** + +``` +$ bigchaindb start --help +usage: bigchaindb start [-h] +optional arguments: + -h, --help show this help message and exit +``` ### Data model impact N/A @@ -42,19 +132,22 @@ N/A N/A ### Documentation impact -The documentation for depreciated sub-commands should indicate that they are not compatible with `localmongodb` backend. +Document the commands and sub-commands along with usage. ### Testing impact Following test cases should be added -- Set `localmongodb` as backend, then executing the depreciated sub-commands should give an error. -- Set `localmongodb` as backend, then executing `bigchaindb --help`, `bigchaindb -h` should not list the deprecated sub-commands. +- Set a backend other than `localmongodb` and see of it results in a valid unsupported + result. +- Set `localmongodb` as backend and execute `bigchaindb --help` and validate that only the above + mentioned sub-commands are displayed. ## Implementation ### Assignee(s) -Primary assignee(s): @kansi +Primary assignee(s): @muawiakh +Secondary assignee(s): @kansi, @ttmc ### Targeted Release BigchainDB 2.0 From 8ce01bf4ce6b8bddb48e2eccfa689f64c953dc2e Mon Sep 17 00:00:00 2001 From: Ahmed Muawia Khan Date: Thu, 22 Feb 2018 15:26:15 +0100 Subject: [PATCH 3/4] Update minor formatting --- proposals/migrate-cli.md | 1 + 1 file changed, 1 insertion(+) diff --git a/proposals/migrate-cli.md b/proposals/migrate-cli.md index f36112d7..2ce5fe80 100644 --- a/proposals/migrate-cli.md +++ b/proposals/migrate-cli.md @@ -147,6 +147,7 @@ Following test cases should be added ### Assignee(s) Primary assignee(s): @muawiakh + Secondary assignee(s): @kansi, @ttmc ### Targeted Release From ecee564d21d23d2c65ec4469bbd3dedd69b775b0 Mon Sep 17 00:00:00 2001 From: Ahmed Muawia Khan Date: Thu, 22 Feb 2018 16:04:43 +0100 Subject: [PATCH 4/4] Remove `create the node keypair` from bigchaindb configure --help --- proposals/migrate-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/migrate-cli.md b/proposals/migrate-cli.md index 2ce5fe80..1d50fa1e 100644 --- a/proposals/migrate-cli.md +++ b/proposals/migrate-cli.md @@ -54,7 +54,7 @@ optional arguments: Commands: {configure,show-config,export-my-pubkey,init,drop,start,set-shards,set-replicas,add-replicas,remove-replicas} - configure Prepare the config file and create the node keypair + configure Prepare the config file show-config Show the current configuration init Init the database drop Drop the database