From 962a88b1d9f5ef2f6a0c7b207793f31ef2f514e8 Mon Sep 17 00:00:00 2001
From: Troy McConaghy <troy@bigchaindb.com>
Date: Sat, 11 Mar 2017 13:59:23 +0100
Subject: [PATCH 1/3] removed 'bigchaindb load' command & tests

---
 bigchaindb/commands/bigchain.py | 56 ---------------------------------
 tests/commands/test_commands.py | 22 -------------
 2 files changed, 78 deletions(-)

diff --git a/bigchaindb/commands/bigchain.py b/bigchaindb/commands/bigchain.py
index efefa9d7..767f6ccc 100644
--- a/bigchaindb/commands/bigchain.py
+++ b/bigchaindb/commands/bigchain.py
@@ -9,15 +9,11 @@ import copy
 import json
 import sys
 
-import logstats
-
 from bigchaindb.common import crypto
 from bigchaindb.common.exceptions import (StartupError,
                                           DatabaseAlreadyExists,
                                           KeypairNotFoundException)
 import bigchaindb
-from bigchaindb.models import Transaction
-from bigchaindb.utils import ProcessGroup
 from bigchaindb import backend, processes
 from bigchaindb.backend import schema
 from bigchaindb.backend.admin import (set_replicas, set_shards, add_replicas,
@@ -206,39 +202,6 @@ def run_start(args):
     processes.start()
 
 
-def _run_load(tx_left, stats):
-    logstats.thread.start(stats)
-    b = bigchaindb.Bigchain()
-
-    while True:
-        tx = Transaction.create([b.me], [([b.me], 1)])
-        tx = tx.sign([b.me_private])
-        b.write_transaction(tx)
-
-        stats['transactions'] += 1
-
-        if tx_left is not None:
-            tx_left -= 1
-            if tx_left == 0:
-                break
-
-
-@configure_bigchaindb
-def run_load(args):
-    logger.info('Starting %s processes', args.multiprocess)
-    stats = logstats.Logstats()
-    logstats.thread.start(stats)
-
-    tx_left = None
-    if args.count > 0:
-        tx_left = int(args.count / args.multiprocess)
-
-    workers = ProcessGroup(concurrency=args.multiprocess,
-                           target=_run_load,
-                           args=(tx_left, stats.get_child()))
-    workers.start()
-
-
 @configure_bigchaindb
 def run_set_shards(args):
     conn = backend.connect()
@@ -373,25 +336,6 @@ def create_parser():
                                     help='A list of space separated hosts to '
                                          'remove from the replicaset. Each host '
                                          'should be in the form `host:port`.')
-
-    load_parser = subparsers.add_parser('load',
-                                        help='Write transactions to the backlog')
-
-    load_parser.add_argument('-m', '--multiprocess',
-                             nargs='?',
-                             type=int,
-                             default=False,
-                             help='Spawn multiple processes to run the command, '
-                                  'if no value is provided, the number of processes '
-                                  'is equal to the number of cores of the host machine')
-
-    load_parser.add_argument('-c', '--count',
-                             default=0,
-                             type=int,
-                             help='Number of transactions to push. If the parameter -m '
-                                  'is set, the count is distributed equally to all the '
-                                  'processes')
-
     return parser
 
 
diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py
index e10b3157..198c39d1 100644
--- a/tests/commands/test_commands.py
+++ b/tests/commands/test_commands.py
@@ -21,7 +21,6 @@ def test_make_sure_we_dont_remove_any_command():
     assert parser.parse_args(['start']).command
     assert parser.parse_args(['set-shards', '1']).command
     assert parser.parse_args(['set-replicas', '1']).command
-    assert parser.parse_args(['load']).command
     assert parser.parse_args(['add-replicas', 'localhost:27017']).command
     assert parser.parse_args(['remove-replicas', 'localhost:27017']).command
 
@@ -382,27 +381,6 @@ def test_calling_main(start_mock, base_parser_mock, parse_args_mock,
                                                help='Number of replicas (i.e. '
                                                'the replication factor)')
 
-    subparsers.add_parser.assert_any_call('load',
-                                          help='Write transactions to the '
-                                          'backlog')
-
-    subsubparsers.add_argument.assert_any_call('-m', '--multiprocess',
-                                               nargs='?', type=int,
-                                               default=False,
-                                               help='Spawn multiple processes '
-                                               'to run the command, if no '
-                                               'value is provided, the number '
-                                               'of processes is equal to the '
-                                               'number of cores of the host '
-                                               'machine')
-    subsubparsers.add_argument.assert_any_call('-c', '--count',
-                                               default=0,
-                                               type=int,
-                                               help='Number of transactions '
-                                               'to push. If the parameter -m '
-                                               'is set, the count is '
-                                               'distributed equally to all '
-                                               'the processes')
     assert start_mock.called is True
 
 

From 042133faf8caeeb4847bf5c5b9fa649a0a277f1d Mon Sep 17 00:00:00 2001
From: Troy McConaghy <troy@bigchaindb.com>
Date: Sat, 11 Mar 2017 14:00:01 +0100
Subject: [PATCH 2/3] removed docs about 'bigchaindb load' command

---
 docs/server/source/server-reference/bigchaindb-cli.md | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/docs/server/source/server-reference/bigchaindb-cli.md b/docs/server/source/server-reference/bigchaindb-cli.md
index 5fdf8fdf..9612fd30 100644
--- a/docs/server/source/server-reference/bigchaindb-cli.md
+++ b/docs/server/source/server-reference/bigchaindb-cli.md
@@ -69,16 +69,6 @@ e.g. `bigchaindb --dev-start-rethinkdb start`. Note that this will also shutdown
 The option `--dev-allow-temp-keypair` will generate a keypair on the fly if no keypair is found, this is useful when you want to run a temporary instance of BigchainDB in a Docker container, for example.
 
 
-## bigchaindb load
-
-Write transactions to the backlog (for benchmarking tests). You can learn more about it using:
-```text
-$ bigchaindb load -h
-```
-
-Note: This command uses the Python Server API to write transactions to the database. It _doesn't_ use the HTTP API or a driver that wraps the HTTP API.
-
-
 ## bigchaindb set-shards
 
 This command is specific to RethinkDB so it will only run if BigchainDB is

From c3d9717b07069e08ea96270a1ff5280bd311bdf3 Mon Sep 17 00:00:00 2001
From: Scott Sadler <scott@alphanode.co>
Date: Tue, 14 Mar 2017 18:40:04 +0100
Subject: [PATCH 3/3] fix breakage from other branch

---
 tests/common/schema/test_schema.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/common/schema/test_schema.py b/tests/common/schema/test_schema.py
index 02a00ee2..3116fa7d 100644
--- a/tests/common/schema/test_schema.py
+++ b/tests/common/schema/test_schema.py
@@ -1,5 +1,5 @@
 from bigchaindb.common.schema import (
-    TX_SCHEMA, VOTE_SCHEMA, drop_schema_descriptions)
+    TX_SCHEMA_COMMON, VOTE_SCHEMA, drop_schema_descriptions)
 
 
 def _test_additionalproperties(node, path=''):
@@ -19,7 +19,7 @@ def _test_additionalproperties(node, path=''):
 
 
 def test_transaction_schema_additionalproperties():
-    _test_additionalproperties(TX_SCHEMA)
+    _test_additionalproperties(TX_SCHEMA_COMMON)
 
 
 def test_vote_schema_additionalproperties():