tendermintUbuntu 16.04[Docker Compose][no]Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
1) clone bigchaindb
2) remove all existing bigchaindb related docker containers and images
docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -q)
3) Bring up a docker based dev environment
docker-compose -f docker-compose.tendermint.yaml up mdb
docker-compose -f docker-compose.tendermint.yaml up tendermint
docker-compose -f docker-compose.tendermint.yaml up bdb
This will result in the following errors
Successfully built 3cfb9a954908
Successfully tagged bigchaindb_bdb:latest
WARNING: Image for service bdb was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
bigchaindb_mdb_1 is up-to-date
bigchaindb_tendermint_1 is up-to-date
Creating bigchaindb_bdb_1 ... done
Attaching to bigchaindb_bdb_1
bdb_1 | INFO:bigchaindb.config_utils:Configuration loaded from `/root/.bigchaindb`
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.commands.bigchaindb) BigchainDB Version 1.4.0.dev (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.commands.bigchaindb) Initializing database (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [DEBUG] (bigchaindb.config_utils) System already configured, skipping autoconfiguration (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [DEBUG] (bigchaindb.backend.connection) Connection: <class 'bigchaindb.backend.localmongodb.connection.LocalMongoDBConnection'> (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create database `bigchain`. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `transactions` table. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `utxos` table. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `assets` table. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `blocks` table. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `metadata` table. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `transactions` secondary index. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `assets` secondary index. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `assets` secondary index. (MainProcess - pid: 1)
bdb_1 | [2018-03-12 17:16:03] [INFO] (bigchaindb.backend.localmongodb.schema) Create `utxos` secondary index. (MainProcess - pid: 1)
bdb_1 | Traceback (most recent call last):
bdb_1 | File "/usr/local/bin/bigchaindb", line 11, in <module>
bdb_1 | load_entry_point('BigchainDB', 'console_scripts', 'bigchaindb')()
bdb_1 | File "/usr/src/app/bigchaindb/commands/bigchaindb.py", line 216, in main
bdb_1 | utils.start(create_parser(), sys.argv[1:], globals())
bdb_1 | File "/usr/src/app/bigchaindb/commands/utils.py", line 160, in start
bdb_1 | return func(args)
bdb_1 | File "/usr/src/app/bigchaindb/commands/utils.py", line 45, in configure
bdb_1 | command(args)
bdb_1 | File "/usr/src/app/bigchaindb/commands/utils.py", line 72, in start_logging
bdb_1 | command(args)
bdb_1 | File "/usr/src/app/bigchaindb/commands/bigchaindb.py", line 159, in run_start
bdb_1 | _run_init()
bdb_1 | File "/usr/src/app/bigchaindb/commands/bigchaindb.py", line 100, in _run_init
bdb_1 | b.create_genesis_block()
bdb_1 | File "/usr/src/app/bigchaindb/core.py", line 555, in create_genesis_block
bdb_1 | block = self.prepare_genesis_block()
bdb_1 | File "/usr/src/app/bigchaindb/core.py", line 528, in prepare_genesis_block
bdb_1 | metadata=metadata)
bdb_1 | File "/usr/src/app/bigchaindb/common/transaction.py", line 638, in create
bdb_1 | outputs.append(Output.generate(pub_keys, amount))
bdb_1 | File "/usr/src/app/bigchaindb/common/transaction.py", line 386, in generate
bdb_1 | public_key=base58.b58decode(public_keys[0]))
bdb_1 | File "/usr/local/lib/python3.6/site-packages/base58.py", line 77, in b58decode
bdb_1 | v = v.decode('ascii')
bdb_1 | AttributeError: 'NoneType' object has no attribute 'decode'
But now if you kill the bdb container and again do docker-compose -f docker-compose.tendermint.yaml up bdb you might not get the error and it would start successfully.
BigchainDB 1.x creates a block called genesis. To create the genesis block, you need the private key of the node (that is missing, that's why you get this exception).
BigchainDB 2.0 delegates this to Tendermint, but for whatever reason we left the initialization of the genesis block聽in the code. A short term solution is to remove the line bigchaindb/commands/bigchaindb.py:100. A better solution is to grep for genesis and do a proper cleanup
@vrde thanks for the triage I'll go ahead with the cleanup
@shahbazn it might be tricky, fell free to ping me if you need support :muscle: