Compare commits

..

2467 Commits

Author SHA1 Message Date
yongtheskill
3c89d306ef
Capitalisation mistake (#2734)
Changed "BigchaindB" to "BigchainDB"
2022-05-17 00:30:19 +02:00
Jürgen Eckel
ad83ef1d35
fixed chardet version to 3.0.4 (#2736)
* fixed chardet version to 3.0.4

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>

* defined working version of jinga2

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>

* removed obsolete doc building commands

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>

* defined werkzeug version explicitly

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2022-05-17 00:29:54 +02:00
Tim Gates
0961aa6b26
docs: fix simple typo, neeeded -> needed (#2717)
There is a small typo in bigchaindb/lib.py, tests/tendermint/test_lib.py.

Should read `needed` rather than `neeeded`.
2021-12-06 14:11:29 +01:00
zzappie
6a6a19207c
[WIP] Maintenance release (#2728)
* Dependencies update

Signed-off-by: David Dashyan <mail@davie.li>

* Dockerfile-dev: update python version + remove system pynacl

Signed-off-by: David Dashyan <mail@davie.li>

* Set dummy_transaction fixture scope to "session"

Signed-off-by: David Dashyan <mail@davie.li>

* Add 3.7 and 3.8 python tests

* setup.py: fix version typo
2021-12-06 14:09:51 +01:00
David Dashyan
caf31647e0 Update priv validator format in k8s to support tm v0.28.0+
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
8630e74f77 Remove @asyncio.coroutine decorators
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
5166fa6b46 Update changelog
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
22cf5f26c3 chmod +x tm_config_gen tm_start
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
62ae66fef7 Update priv validator format in stack.sh to support tm v0.28.0+
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
Andrijan Ostrun
d77ab60651 Problem: Fixed stack.sh & tendermint's start.yml script (#2708)
* Fixed tendermint start task - fixed parsing of priv_validatorX.json files

* Fixed tendermint start task - fixed parsing of priv_validatorX.json files

Signed-off-by: Andrijan Ostrun <andrijan.ostrun@gmail.com>

Co-authored-by: Andrijan Ostrun <andrijan.ostrun@suprabit.eu>
2020-09-29 12:17:46 +00:00
David Dashyan
af2517b2ae Update k8s container versions
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
8895d50f5b Version bump
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
40a92756f9 Update Dockerfile-alpine and losen 'packaging' version
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
41f7534f3a Update dependencies and fix versions
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
David Dashyan
26cb560bb1 Tidy up setup.py 2020-09-29 12:17:46 +00:00
David Dashyan
2b0babb95b Update email addresses
Signed-off-by: David Dashyan <mail@davie.li>
2020-09-29 12:17:46 +00:00
Amartya Gaur
b272fb342a
owners_before error message correction (#2698)
* owners_before error message correction
Signed-off-by: Amartya Gaur amarkaushik1999@gmail.com

* Changed some formatting
Signed-off-by: Amartya Gaur amarkaushik1999@gmail.com

* Changes essential to pass tests
Signed-off-by: Amartya Gaur amarkaushik1999@gmail.com

* Resolve conflicts with master
Signed-off-by: Amartya Gaur amarkaushik1999@gmail.com
2020-08-12 12:32:33 +00:00
Karthikeyan Singaravelan
e86666b6b3
Import ABC from collections.abc (#2704)
Signed-off-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-07-22 08:51:58 +00:00
David Dashyan
d9dfa98819
Flask update (#2700)
* Flask security update

The Pallets Project Flask before 1.0 is affected by: unexpected memory
usage. The impact is: denial of service.
The attack vector is: crafted encoded JSON data. The fixed version is:
1. NOTE: this may overlap CVE-2018-1000656.

Signed-off-by: David Dashyan <mail@davie.li>

* Make send_naughty_tx error regex more robust

Signed-off-by: David Dashyan <mail@davie.li>
2020-06-02 14:36:56 +07:00
lana-shanghai
4a008e51e3
[WIP] Documentation re-org (#2694)
* Reorganized docs

* Fixed internal links in basic usage

* fixed the docker-compose command and volume for docs

* fixed docs tests

* fix travis docs test

* tox ini file

* fixed readme localhost links

* edited tox and test docs to previous state

* Fix tests errors related to docs reorganization

Signed-off-by: David Dashyan <mail@davie.li>

* Added ansible script installation option

Signed-off-by: Lana Ivina <lana@ipdb.io>

* Added ansible script to network setup guide

Signed-off-by: Lana Ivina <lana@ipdb.io>

* Hid the non-working button for now. 

Signed-off: Lana Ivina <lana@ipdb.io>

* Try now button

Co-authored-by: David Dashyan <mail@davie.li>
2020-05-18 20:22:26 +07:00
David Dashyan
2accca9ff1
Fix Docker-all-in-one Tendermint download link (#2692)
Resolves issue #2691

Signed-off-by: David Dashyan <mail@davie.li>
2020-05-13 16:13:29 +07:00
David Dashyan
186cd87444
Updated bigchaindb-abci (#2689)
* Updated bigchaindb-abci

Reason: gevent API change breaks BigchainDB installation
Signed-off-by: David Dashyan <mail@davie.li>

* Version bump

Signed-off-by: David Dashyan <mail@davie.li>

* Updated changelog
2020-04-14 23:59:51 +02:00
David Dashyan
9e99c024d3
Replace headers (#2683)
Signed-off-by: David Dashyan <mail@davie.li>
2020-04-06 11:52:18 +02:00
David Dashyan
09391351a4
Version bump to 2.2.0 (#2682)
Signed-off-by: David Dashyan <mail@davie.li>
2020-02-20 16:30:37 +01:00
Zac Hatfield-Dodds
f795301f90 Update Hypothesis (#2678)
Fixes #1738

Signed-off-by: Zac Hatfield-Dodds <zac@zhd.dev>
2020-01-26 22:18:40 +03:00
David Dashyan
7df59994e9 Tendermint v0.22.8 backward compatibility (#2677)
Problem statement:

BigchainDB v2.0.0b9 has been around for quite a while. Recently we have updated
Tendermint supported version to v0.31.5 which has incompatible blockchain.
Despite the fact that we have defined instructions on chain migration, no one
expected to migrate to incompatible chain within patch version range. So there
is a demand for Tendermint v0.22.8 compatibility among BigchainDB users.

Work has been done:

bigchaindb-abci package was upgraded to support multiple API versions.
New configuration field stating tendermint version was added.

Signed-off-by: David Dashyan <mail@davie.li>
2020-01-23 23:17:27 +01:00
Yuliya Palamarchuk
86472157db Fixed not being able to connect to mongo (#2674)
From version 3.6+ mongodb by default binds only to localhost (127.0.0.1) IP. That can be checked with "netstat -tulpn | grep LISTEN" command in container. It will return "127.0.0.1:27017 | 0.0.0.0:* | LISTEN | 15/mongod" for mongod. That causes inability to connect to running mongo from host machine. Proposed change allows mongo to bind to container network interface, thus allowing connections from host machine.
2019-12-02 15:23:10 +03:00
Jürgen Eckel
b54c31539f
Transcation API extension: last_tx parameter (#2667)
* added last_tx switch to the TX get query to only get the latest TX for a given asset.
* extended test case to contain last_tx field
* Add last_tx option in query module
* Fix natural descending cursor sort argument
2019-11-06 23:23:14 +01:00
David Dashyan
ecd6e9cc46 Update issue templates (#2670) 2019-10-28 20:30:14 +01:00
David Dashyan
f12d44ff82 Fix bigchaidb-tendermint version mismatch 2019-10-15 15:24:37 +03:00
Jürgen Eckel
9bcefdf3e2
Tendermint upgrade (#2666)
* migrated to tendermint 0.35.1

* increased bigchaindb_abci version

* fixed API adjustments due to Tendermint upgrade

Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>

* migrated to bigchaindb-abci == py-abci 0.7.1

Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>
2019-10-07 16:32:35 +02:00
Giuseppe Raveduto
16a9888d1e using alpine v3.9 (#2658)
Since version 3.10, Alpine linux has removed mongodb from the available packages.
Using v3.9 it's still possible to build the all-in-one configuration using the provided Dockerfile.

Signed-off-by: Giuseppe Raveduto <giuseppe.raveduto@eng.it>
2019-09-30 09:32:01 +02:00
Simon Pfeifhofer
645d457b7b Add quotes to env-variables (#2662)
Signed-off-by: Simon Pfeifhofer <simon.pfeifhofer@gmail.com>
2019-09-26 13:10:09 +02:00
Nikita Chernyi
2975c372c8 Remove pysha3 for python >= 3.6 (#2652)
* Init pypy support

* Fixed setup
2019-09-25 22:22:51 +02:00
Troy McConaghy
df23bec320 Add a docs link to the ANSI C driver (#2650)
Signed-off-by: Troy McConaghy <troy@bigchaindb.com>
2019-09-25 22:20:02 +02:00
Mike Klimontov
c801c833fc Add unit transaction_mode_types (#2648)
Signed-off-by: Mike Klimontov <klimontovm@gmail.com>
2019-06-12 16:28:24 +02:00
Troy McConaghy
a5452169b9 pip 19+ is now needed to install bigchaindb (#2645)
Signed-off-by: Troy McConaghy <troy@bigchaindb.com>
2019-05-26 22:11:41 +02:00
Troy McConaghy
a24c0f429b Note the new C# driver in the server docs (#2644)
Signed-off-by: Troy McConaghy <troy@bigchaindb.com>
2019-05-20 21:11:00 +02:00
Troy McConaghy
835fdfcf59 Updates for the switch from BEP-16 to BEP-24 (#2641)
Signed-off-by: Troy McConaghy <troy@bigchaindb.com>
2019-04-15 23:47:56 +02:00
manjush08
20a59a9640 Problem: No volume mounted to store tendermint data (#2637)
* Fix: mount volume to store tendermint data

* Fix: mount volume to store tendermint data
2019-03-14 13:38:19 +01:00
manjush08
f0dc9986aa Update main.yml (#2636) 2019-03-13 14:33:36 +01:00
Chuseuiti
6bed80cff3 Restart on sporadic failures on BDB container#2624 (#2634)
To account for sporadic failures on bigchaindb server and container stop, it would be beneficial to include in docker-compose the ability for the containers to restart on failure or docker daemon restart. Issue #2624
2019-02-26 09:57:38 +01:00
Troy McConaghy
7781f5aae8
Remove --no-cache-dir from all pip install cmds (#2628)
because it broke in pip 19
2019-01-29 13:51:29 +01:00
Troy McConaghy
eb2f8ddc73
Sphinx changed how it handles rel links in .md (#2627)
* Sphinx changed how it handles rel links in .md

* Remove all --process-dependency-links everywhere
2019-01-24 14:21:21 +01:00
Troy McConaghy
d8f51d8999
Replace rel link with absolute URL 2019-01-24 13:57:44 +01:00
Troy McConaghy
3b72181b3d
Fix a link in the docs 2019-01-13 14:56:03 +01:00
Troy McConaghy
ca012ae8b6
Update pyyaml, part 2 2019-01-13 14:51:16 +01:00
Troy McConaghy
1a9c5d47e6
Update pyyaml, part 1 2019-01-13 14:50:33 +01:00
Kuro1
edcd59e235 Translate the readme to Chinese (#2615) 2018-12-24 15:51:24 +01:00
Troy McConaghy
11817b9590
Change email to devs@bigchaindb.com (#2612)
* Change email to devs@bigchaindb.com

* Update Travis build badge URL

* Update some other email addresses
2018-12-10 18:10:58 +01:00
Troy McConaghy
d9725d483b
Revised docs based on tips from user (#2611) 2018-12-02 22:07:31 +01:00
xunconnectedx
f0df5bd2e0 corrected the syntax for which an error occurred in the execution stack.sh (#2609) 2018-11-29 11:59:45 +01:00
Troy McConaghy
f8191b0d8e
Last commit before v2.0.0b9 (#2608) 2018-11-27 19:50:05 +01:00
Troy McConaghy
dcfe23f292
Account for values that are arrays/lists (#2607)
when checking if keys are valid.
2018-11-25 20:24:03 +01:00
Troy McConaghy
5de2fef284
Problem: "language" values are not being checked in metadata (#2606)
Check "language" values in metadata too, not just in `asset.data`.
2018-11-25 19:11:35 +01:00
gamjapark
a62cc4e101 Translated docs to Korean (#2603)
Add Korean translations of all the BigchainDB root docs
2018-11-22 09:28:11 +01:00
Troy McConaghy
288c2ecd2a
In NGINX conf files under k8s/: Drop TLSv1 & TLSv1.1, enable TLSv1.3 (#2601)
because TLS v1 and v1.1 are old
2018-11-17 09:23:08 +01:00
Troy McConaghy
fe467fddbd
nginx.conf: Drop TLSv1 & TLSv1.1, enable TLSv1.3
Because TLS v1 and v1.1 are old. See http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_protocols
2018-11-17 09:08:08 +01:00
Troy McConaghy
0b935c09c7
Add extra step to RELEASE_PROCESS.md
because readthedocs.org has gotten even more arcane
2018-11-09 20:21:06 +01:00
Salah Alsasa
1bd5845a83 Fix links in network setup readme file (#2600)
* Fix links in network setup readme file

* Update docs/server/source/simple-deployment-template/network-setup.md

Co-Authored-By: sd189 <salahalsasa@gmail.com>
2018-11-08 11:16:23 +01:00
Troy McConaghy
d85b9df615
Last PR before the release of v2.0.0b8 (#2596) 2018-11-03 18:37:27 +01:00
Troy McConaghy
ff906b0abe
Updated some package version requirements (#2595) 2018-11-03 17:51:52 +01:00
Troy McConaghy
20e6c6a686
Update acceptance Dockerfile to use latest Python driver (#2594)
* Update acceptance Dockerfile to use latest Python driver

* Fixed four Flake8 errors
2018-11-03 17:34:36 +01:00
gamjapark
73afc38697 Translate the readme to Korean (#2592) 2018-11-01 15:17:47 +01:00
Troy McConaghy
c5fea574b5
Updated Python driver version for acceptance tests 2018-10-20 22:03:50 +02:00
Troy McConaghy
ee7bd938dc
Fixed typo in k8s configmap template (#2583)
Thanks to @aberey for pointing this out.
2018-10-18 09:21:02 +02:00
Troy McConaghy
e2b3c78d9c
Edit nginx/nginx.conf to enable CORS (#2580)
* Edit nginx/nginx.conf to enable CORS

* In nginx/nginx.conf, add more allowed headers w/ OPTIONS requests
2018-10-11 09:53:24 +02:00
Troy McConaghy
f1353a3db9
Fixed some docs (#2579)
in the intro page about the Simple Deployment Template:
- removed the note about the BigchainDB Testnet for now
- changed the link to the docs about contributing to BigchainDB from Markdown to RST
2018-10-09 18:10:49 +02:00
Troy McConaghy
c1993c3787
Revised Simple Deployment Template: added NGINX instructions (#2578) 2018-10-09 12:27:06 +02:00
Troy McConaghy
5c1511b479
Add help with make release to release process 2018-09-28 13:35:33 +02:00
Troy McConaghy
3da13eda3d
Last PR before releasing 2.0.0b7 (#2576)
* Updated changelog for 2.0.0b7

* Change 2.0.0b3 to b7 in network-setup.md

* Updated k8s yamls for 2.0.0b7 release

* Updated version.py for 2.0.0b7 release
2018-09-28 13:23:04 +02:00
Lev Berman
0c4d6ec906 Implement crash recovery for elections. (#2566)
1. Save pre-commit state in the beginning of end block. 
2. Provide an interface for custom elections to rollback on crash recovery. 
3. Simplify pre-commit management. 
4. Add crash recovery for updert-validator and chain migration elecitons.
2018-09-28 12:32:45 +02:00
Troy McConaghy
f4d6ccbacf
Added server.bind note re connecting via IPv6 & edited reverse proxy instructions. (#2575) 2018-09-28 10:45:03 +02:00
Troy McConaghy
009cbe4e11
Copy-edited the log rotation page (docs) (#2546)
* Copy-edited the log rotation page (docs)

* Fix and add some hyperlinks re/ logging.

* Add back the section/link to log-rotation.html

* Correct the location of BigchainDB logs. Omit mention of bigchaindb-benchmark.log

* Revive notes re BigchainDB Server log rotation
2018-09-28 09:19:20 +02:00
Troy McConaghy
54ac7adaa9
Changed packaging~=17.0 to 18.0 in four places (#2573) 2018-09-27 15:31:30 +02:00
Troy McConaghy
4f01dd4997
See what happens if packaging~=17.0 in setup.py AND docs/*/requirements.txt (#2572) 2018-09-27 13:30:58 +02:00
Vanshdeep Singh
72d7986a58 Problem: 'packaging' version not pinned (#2571)
Solution: Pin the version
2018-09-26 16:33:23 +02:00
Vanshdeep Singh
78dafce146 Problem: Outputs API responds with incorrect outputs (#2567).
* Problem: Outputs API doesn't respond with correct unspent/spent outputs

Solution: Fix fastquery such that embedded document is queried properly

* Problem: key order agnostic queries not implemented

Solution: get_spent queries embedded documents which respect key order. This is
not expected by the application hence the query should be altered to query any
kind of key order

* Problem: Mongo query for get_spent too complicated

Solution: Simplify query using $elemMatch

* Problem: No test for checking mixed spent outputs

Solution: Add test for `get_spending_transactions` to check that correct
matching is done when querying documents with multiple inputs

* Problem: tranasction ids not assert when getting spent outputs

Solution: assert tranasction ids
2018-09-26 10:17:39 +02:00
Troy McConaghy
bedb1945a9 Added docs & link re/ adding/removing validators (#2570) 2018-09-25 17:33:59 +02:00
Lev Berman
cb74cb43d2 Extend chain migration show command (#2558)
* Extend `election show` with migration data.

* Test chain-migration show.
2018-09-25 11:38:29 +02:00
Lev Berman
40ea961d4a Update elections documentation (#2563)
* Improve election docs. Reference relevant BEPs.

* Fix typos and headings (election docs).

* Enumerate supported election types (election docs).

* Clarify the BEP-42 ref (election docs).
2018-09-25 10:46:30 +02:00
Lev Berman
24ca0b32a9 Separate pending and effective validator updates. (#2556)
* Separate pending and effective validator updates.

- Pending validator updates do not prevent elections from concluding.
- ValidatorElection overrides has_conclude to not conclude when there is a pending update for the matching height.
- Effective validator updates deem past elections inconclusive.

* Problem: Looking for election block is inefficient.

Solution: Record placed elections, update the records upon election conclusion.

* Clarify the conclusion order in Election.process_blocks.

* Insert election records in bulk.

Otherwise, one can significantly slow nodes down by posting a whole bunch of unique elections.

* Change get_election to use find_one.

* Calculate total votes without making extra query.

* Fix the pending valset check.

* Fix election test setup.
2018-09-21 10:51:57 +02:00
Troy McConaghy
39be7a2fdf
Renamed "consensus" to "validation" where relevant (#2561) 2018-09-20 17:17:33 +02:00
Muawia Khan
eb139fba00 Remove benchmark logging (#2565).
* Problem: Benchmark logging is not needed.

* Solution: Clean it up.
2018-09-20 14:30:30 +02:00
codegeschrei
407571ddf4 Problem: send function has a deprecation warning in the driver (#2547)
Solution: replace send with the matching new functions
2018-09-20 10:31:05 +02:00
Troy McConaghy
2f6bbaeb4b
Link to Alberto's tips from Troubleshooting page (#2562)
because they are useful!
2018-09-20 09:54:34 +02:00
Lev Berman
126e90e732 Adjust multiple elections conclusion. (#2553)
- Do not conclude migration election if there is a migration in progress.
- Rewrite election tests to not use mocks and assert many different things.
- Record concluded elections in the `election` collection.
2018-09-18 12:32:16 +02:00
Vanshdeep Singh
cf6fa6b553 Problem: Election type not casted for runnign command (#2551)
Solution: Replace '-' with '_' before running election sub-command
2018-09-17 15:36:38 +02:00
Troy McConaghy
528ba07c68
Last PR before 2.0.0b6 (#2550)
* Update k8s files for 2.0.0b6

* Update version.py for 2.0.0b6
2018-09-17 15:00:26 +02:00
Troy McConaghy
eb0e387b18
Problem: CHANGELOG.md hasn't been updated since Aug. 1 (#2509)
Last update to CHANGELOG.md before 2.0.0b6
2018-09-17 14:43:03 +02:00
Vanshdeep Singh
16355748dd Problem: Docs build fails (#2549)
Solution: Create __init__.py so that migrations can be imported properly
2018-09-17 14:39:00 +02:00
Muawia Khan
e3e95836d0 Problem: bigchaindb not starting because of a module dependency (#2548) 2018-09-17 14:10:22 +02:00
Troy McConaghy
8e5f770707 List the "blocks" endpoint in response to HTTP info requests (#2545)
* Problem: HTTP info endpoints don't include "blocks"

Solution: Add "blocks" to the response to the HTTP info endpoints

* Removed "blocks" endpoints from "Advanced Usage"
because they are really not that advanced
2018-09-17 14:06:48 +02:00
Zachary Bowen
e6893632dc Create migration election class (#2535).
* Problem: We need a way to synchronize a halt to block production to allow for upgrades across breaking changes.

* Solution: Created `MigrationElection`.

* Problem: Need documentation for `migration` elections.

* Solution: Updated the docs.

* Problem: `MigrationElection` needs 'new' CLI method.

* Solution: Updated the definition of `election` to include the new `migration` type.

* Problem: The way `end_block` checks for concluded elections assumes there is only one type of election (so we can't conclude an `upsert-validator` and a `chain-migration` at the same height).

* Solution: Re-engineered the code in `Elections` to conclude multiple elections in the same block. If more than one election change the validator set, only one of them is applied.

* Problem: Tendermint change to store validator changes at height h+2 will break `Election.get_status`.

* Solution: Reworked `get_validator_change` to look at only the latest block height or less.
2018-09-17 13:59:57 +02:00
Troy McConaghy
3cb0f8e2ab
Update the list of MongoDB collections in query.rst (#2543) 2018-09-14 16:25:36 +02:00
Muawia Khan
bd39076522 Problem: Users trying to use an incompatible version of Tendermint (#2541)
-  Hard-wire the supported Tendermint version(s) right in the code of BigchainDB Server. Check the version of Tendermint and disconnect if Tendermint version is an unsupported one.
- Expose a CLI command bigchaindb tendermint-version to display the supported Tendermint versions.
- PR also takes care the long list of warnings we get when we run tests.
    - Updated deprecated pymongo methods
    - Do not call pytest fixtures directly.
    - Also added the doc for the new cli command
2018-09-14 15:37:18 +02:00
Troy McConaghy
754730a045 Update the Quickstart page (#2538)
* Update the Quickstart page

* Add links to docs about how to deploy a local node
2018-09-14 11:47:39 +02:00
Troy McConaghy
5394054132 Add Troubleshooting page to Simple Deployment Template (#2517) 2018-09-13 16:46:02 +02:00
Troy McConaghy
61ce427e1d Problem: Unclear that we want users to use Monit (#2533)
Solution: Edit the "How to Set Up a BigchainDB Network" page
so that the Monit way is the only fully-documented way.
Give a tip for do-it-yourselfers.
2018-09-13 16:43:15 +02:00
Shahbaz Nazir
c68fab6c31 Problem: A duplicate tx may result in HTTP 500.
* Improve parsing of errors received from Tendermint RPC.
2018-09-13 16:03:22 +02:00
Lev Berman
f55f22144f Problem: the skip_id param is redundant. (#2531)
Solution: remove the param; only call validate_id where it is needed.
2018-09-13 15:35:24 +02:00
Troy McConaghy
6a9064196a Make requirements.txt files consistent with setup.py (#2539) 2018-09-13 14:11:15 +02:00
vrde
241aae335d Problem: validation is slow (#2489)
Solution: parallelize the validation of transactions. This patch adds a
new flag for the `start` command, namely
`--experimental-parallel-validation`, that can be used to enable this
experimental feature.
2018-09-13 12:16:45 +02:00
vrde
901b6b9d02 Problem: Sphinx deprecated a config option (#2537)
Solution: Move from `autodoc_default_flags` to
`autodoc_default_options`.

Related issue:
- https://github.com/sphinx-doc/sphinx/issues/5421
2018-09-13 12:05:01 +02:00
vrde
4b54e702f8 Problem: Events API is unreliable (#2529)
Solution: Stop getting events from the Tendermint events API. Get the
event right before returning from the COMMIT phase of Tendermint, and
publish it to the events queue.
2018-09-12 16:55:23 +02:00
Troy McConaghy
0f41869bea Updated the Python Driver version in acceptance/python/Dockerfile (#2532)
* Updated the Python Driver version in acceptance/python/Dockerfile

* Let package manager auto-update to latest patch version
2018-09-12 16:53:07 +02:00
Lev Berman
35e35ecd57 Problem: New collections are not created in existing DB. (#2520)
Solution: Do not abort the initialisation if a collection exists. Unify the index creation.
2018-09-12 14:39:07 +02:00
Zachary Bowen
8a7650c13a Generalize election management commands (#2515)
* Problem: `ValidatorElection` and `MigrationElection` need to inherit from a common `Election` class

Solution: Factored the common logic out of `ValidatorElection` and moved it to `Election` parent class

* Problem: Adding base58 as a requirement seems to break the build...

Solution: Reverting the changes

* Problem: Responding to a suggestion for improved method naming

Solution: Refactored `get_result_by_election_id` to `get_election_result_by_id`

* Problem: No need to store different types of elections in their own tables

Solution: Remove `DB_TABLE` property from `Election` class

* Revert "Problem: No need to store different types of elections in their own tables"

This reverts commit db45374d3c690429d18a25bcc319f8056c016500.

* Problem: Missed a method in `Bigchain` class when updating the naming for an election method

Solution: Finished the refactoring

* Problem: Need a table to store data for all elections

Solution: Created the `elections` table with secondary_index `election_id`

* Problem: `Election` class needs to be updated to store concluded elections in the `elections` table

Solution: Updated the class to use the new table

* Problem: `UpsertValidatorVote` can be generalized to just be `Vote`

Solution: Renamed, refactored and moved the `Vote` class to tie in with the more general `Election` base class

* Problem: Error in docstring return signature

Solution: Fixed the docstring

* Problem: Hardcoded reference to the `VOTE_TYPE` in `Election` base class

Solution: Pointed the reference to the class variable

* Problem: Schema still refers to `ValidatorElectionVote` instead of `Vote`

Solution:  Renamed `TX_SCHEMA_VALIDATOR_ELECTION_VOTE` as `TX_SCHEMA_VOTE`

* Problem: `Election` class variable `ELECTION_TYPE` is overly specific

Solution: Renamed `ELECTION_TYPE` to `OPERATION`

* Problem: Command line options for `upsert-validator` can be generalized to manage any type of election

Solution: Refactored the CLI to manage generalized elections

* Problem: Default for `show_election` not implemented for `Election` class

Solution: Create a default method that work if all fields in the 'asset[data]' can be displayed without additional formatting

* Problem: Multiple small issues with style etc.

Solution: Addressed comments from PR

* Problem: `Election` class variable to `VOTE_TYPE` unnecessary

Solution: Removed the variable and hardcoded everything to use the `Vote` class

* Problem: Minor style issues with PR

Solution: Addressing comments

* Problem: Changes to format for validator keys broke some tests

Solution: Aligned the tests to reflect the changed key format

* Problem: `election show` command displaying the base56 public key

Solution: Cast any public key to base64

* Problem: `election_parser` help message still refers to upsert-validator

Solution: Updated the help message
2018-09-12 13:41:16 +02:00
Muawia Khan
5a440843b6 Problem: No log rotation when BigchainDB and Tendermint started with Monit (#2528)
* Log rotation for tendermint and BigchainDB using Monit

* Change file size from 100KB used for testing to 200 MB for test envs

* Add docs for log rotation

* remove --consensus.create_empty_blocks from monit start

Because already taken care of in the config file

* do not run bigchaindb with debug flag instead use config file

* Address comments I

- Rephrase log rotation to imply monit is not default
- Add statement to explain where bigchaindb log files are created
- Fix HTML comment
- Add log rotation to index

* Address comments II
2018-09-12 11:14:51 +02:00
Lev Berman
b33e3808a6 Problem: Test fails if Tendermint is not up. (#2530)
Solution: Mark the test with the abci mark since it requires running BigchainDB and Tendermint. Fails since the mark cleanup in #2522.
2018-09-11 16:41:27 +02:00
Zachary Bowen
0fe749d830 Create abstract election class (#2498).
* Problem: `ValidatorElection` and `MigrationElection` need to inherit from a common `Election` class.

Solution: Factored the common logic out of `ValidatorElection` and moved it to `Election` parent class.

* Problem: No need to store different types of elections in their own tables

Solution: Remove `DB_TABLE` property from `Election` class.

Solution: Created the `elections` table with secondary_index `election_id`.

* Problem: `UpsertValidatorVote` can be generalized to just be `Vote`

Solution: Renamed, refactored and moved the `Vote` class to tie in with the more general `Election` base class.

* Problem: `election_id` is not unique if two elections have the same properties.

Solution: Added a random `uuid4` seed to enforce uniqueness.
2018-09-11 15:39:46 +02:00
Troy McConaghy
c79848d66a Problem: Docs say install highest Tendermint version (#2524)
Solution: Change the docs to recommend installing a specific Tendermint version.
Also update our release process so we change that version number before a release, if necessary.
2018-09-11 14:28:55 +02:00
codegeschrei
dd84d4eb6f Problem: There are unnecessary markers (#2522)
* Problem: we have unused and outdated fixtures
Solution: clean up fixtures and tests accordingly

* Problem: there are still unused fixtures
Solution: remove Merlin keys

* Problem: There are unnecessary markers
Solution: remove the tendermint marker for tests
2018-09-10 09:53:18 +02:00
Vanshdeep Singh
cbfbfa8fc4 Problem: Public key format not standardized (#2508)
Solution: Add 'type' field to public key so that it can be decoded properly
2018-09-06 16:06:36 +02:00
Lev Berman
699494613f Problem: The commit mode behaves incorrectly. (#2510)
* Problem: The commit mode behaves incorrectly.

Solution: Parse the Tendermint response properly. The functionality was disabled in https://github.com/bigchaindb/bigchaindb/pull/2235/files#diff-c6511560546a7dc577e7e647b5bfdaceL68 and was not fixed since then.

* Add a test case for the sync mode.

* Do not strictly expect deliver_tx in the response.

* Fix post_mock in web/test_transactions.py.

* Check for the error field first.
2018-09-06 15:49:00 +02:00
Vanshdeep Singh
2656302c60 Problem: Bigchaindb crashes when restarted after init chain (#2519)
Solution: Return appropirate height so that Tendermint doesn't execute
init_chain more than once
2018-09-06 11:27:52 +02:00
Lev Berman
9bf09324df Problem: Txs posted in async/sync can be lost. (#2514)
Solution: Document when the transactions posted in the async and sync modes can be lost. Describe how they are stored. Mention that BigchainDB does not store or expose rejected transactions.
2018-09-05 17:18:17 +02:00
vrde
f6bee3b63e Problem: default config is slow (#2516)
Solution: update the suggested `config.toml` file to increase the
allowed network speed, and avoid rechecking transactions.
2018-09-05 16:04:37 +02:00
Zachary Bowen
bee9468bd0 Problem: test_make_sure_we_dont_remove_any_command does not check for upsert-validator show (#2499).
Solution: Extend the test.
2018-09-05 10:51:32 +02:00
Vanshdeep Singh
af2b5424c0 Problem: Cryptoconditions not pinned which is casuing build failure (#2512)
Solution: Pin cryptoconditions so that docs build properly
2018-09-04 15:45:48 +02:00
Vanshdeep Singh
cb22557771 Problem: Validation code not optimized (#2490)
Solution: memoize data
2018-09-04 15:30:52 +02:00
Troy McConaghy
c72c7a4626 Problem: tests/README.md either wrong or redundant (#2479)
The information on that page was either wrong or redundant, so I either deleted it or linked to where to find the same information in the docs about contributing to BigchainDB.
2018-09-04 13:31:00 +02:00
Troy McConaghy
f8bb29535a
Problem: Code Reference docs hidden in appendices (#2473)
Solution: Move the Code Reference docs into their own section
2018-09-04 12:17:27 +02:00
Lev Berman
230a5b2d69 ABCI chain migration conclusion (#2488)
* Problem: No good way to check for val set absence.

Solution: Make get_validator_set/get_validators return None/[] when there are no validators yet.

* Problem: Incompatible ABCI chain upgrades.

Solution: Record known chains and sync through InitChain. Triggering the migration and adjusting other ABCI endpoints will follow.
2018-09-03 15:41:49 +02:00
Lev Berman
fe0a4c494b
Problem: No MongoDB support for election ID index. (#2507)
Solution: Election ID has to be unique but not every validator set record has it. MongoDB does not support partial indexes, does not even allow for multiple Nones. This is a temporary fix since we are introducing an `election` collection to store election IDs in #2498.
2018-09-03 15:09:16 +02:00
Muawia Khan
8e55b11da2 Problem: cyrptoconditions dependency updated because of vulnerability (#2494)
* Problem: cyrptoconditions dependency updated because of vulnerability CVE-2018-10903

* update cc to ~=0.7.2

* Fix test using b58encode

* Fixing some more tests failing because of base58 update
2018-09-03 13:25:58 +02:00
Troy McConaghy
80b6881797 Problem: Docs page 'BigchainDB and Smart Contracts' is stale (#2504)
Solution: Update that page to reflect our current thinking on how BigchainDB relates to smart contracts
2018-09-02 00:23:17 +02:00
Troy McConaghy
905b1a5141
Problem: Root docs page about decentralization has two incorrect sentences (#2505)
Solution: Delete them
2018-08-31 20:43:08 +02:00
Muawia Khan
cf1f253019 Update bigchaindb-driver version -> 0.5.2 in acceptance test (#2503) 2018-08-31 16:56:34 +02:00
Troy McConaghy
96932793b1
Problem: The docs about database.ssl are wrong (#2500)
Solution: Rewrite the docs about the database.ssl config setting
2018-08-31 15:27:35 +02:00
Shahbaz Nazir
2d1f670eec
Problem: BigchainDB has un-necessary code to initialize a replica set and check if MongoDB was started with replicaSet (#2491)
Solution: Remove un-necessary code. Deployment of MongoDB with or without replicaSet should be the responsibility of MongoDB admin which can and cannot be a BigchainDB node operator. As far as BigchainDB is concerned replicaset, if provided in bigchaindb configs, should be used to establish connection with MongoDB.
2018-08-31 13:54:32 +02:00
Shahbaz Nazir
cb418265b6
Problem: No documentation for hosted MongoDB (#2495)
Solution: Add documentation.
2018-08-31 13:24:04 +02:00
Zachary Bowen
cfc2c5900b Rework upsert-validator show status (#2496)
* Problem: We need to store the `election_id` as part of the `validator_update` so we can efficiently check which election was resposible for the change

Solution: Added the parameter to `store_validator_set` and aligned the tests

* Problem: Logic for `upsert-validator show` is convoluted

Solution: Rewrote the function to be much simpler

* Problem: Need a uniqueness constraint for election_id wrt validator changes

Solution: Added a new key to the db schema
2018-08-31 09:47:47 +02:00
Zachary Bowen
7a0b474d11 Problem: Users want to know upsert-validator election status.
Solution: Introduce the `upsert-validator show` command. Soon to be re-implemented via storing and querying identifiers of concluded elections.
2018-08-30 10:47:37 +02:00
Vanshdeep Singh
3cf368aab7 Problem: No unique indexes on transaction id and block height (#2492)
Solution: Created unique indexes when setting up the collections
2018-08-29 17:45:08 +02:00
vrde
3f7b521809 Problem: make unit-test-watch loops forever (#2486)
Solution: BigchainDB by default writes logs in the same directory it is
run. The `looponfail` feature provided by pytest waits for changes in
the current directory, so it is continuously triggered. This patch tells
pytest to only watch the `bigchaindb` and `tests` directories.
2018-08-29 14:14:47 +02:00
vrde
407b771185 Problem: validating create+transfer might crash the system (#2487)
Solution: if a TRANSFER transaction is validated after a CREATE
transaction, the system crashes with `AttributeError: 'NoneType' object
has no attribute 'txid'`.

This happens because querying `get_spent` checks the attributes `txid`
and `output` of `input.fulfills` for every transaction in the current
buffer (`current_transactions`). For a CREATE, `input.fulfills` is None,
so the check would fail.

The solution is to check if `input.fulfills` is defined. If not, then
the current transaction cannot spend any output, so we can safely skip
it.
2018-08-29 14:13:22 +02:00
Vanshdeep Singh
8e97c753eb Problem: upsert-validator 'approve' command does not transfer vote to election public key (#2480)
Solution: Transfer vote to the election public key; generalize implemenation to handle election txn type

* Problem: Upsert valdiator 'new' doesn't accept public in base64 format

Solution: Tendermint stores all keys in base64 format so it would suitable to
abandon base58 encoding in favour of base64 encoding

* Problem: Not test for invalid execution of upsert-validator 'new'

Solution: Write tests to when invalid power or private key path has been supplied

* Problem: Exceptions are not informational when executing upsert-validator

Solution: generate error logs or print statement indicating success
2018-08-28 14:21:59 +02:00
Troy McConaghy
dfadbff60f Problem: All Tendermint docs moved (#2483)
Solution: Update all links to Tendermint docs
2018-08-28 11:13:59 +02:00
Troy McConaghy
d78ff75225 Problem: HTTP API docs wrong regarding the mode parameter (#2481)
Solution: Edit those docs to be accurate
2018-08-27 15:01:55 +02:00
vrde
41a2687b9b Problem: websocket fails with ELECTION transaction (#2482)
Solution: have a more general approach to process transaction types. If
a transaction does *not* contain `asset.id`, then the `id` of the
`asset` is the `id` of the transaction.
2018-08-27 15:00:02 +02:00
codegeschrei
6fdcaf44a7 Problem: we have unused and outdated fixtures (#2476)
* Problem: we have unused and outdated fixtures
Solution: clean up fixtures and tests accordingly
2018-08-27 09:48:20 +02:00
codegeschrei
d31ab9fb40 Problem: There is no way to vote for an election (#2458)
* Problem: `run_upsert_validator_approve` was getting the voting power in a convoluted way

Solution: Changed it to get the voting power from the election outputs

* Problem: `run_upsert_validator_approve` casts votes for *all* voters, not just the user calling the command

Solution: Filter vote txs by the users public key

* Problem: Docs needed a more specific description of how to input the path to the private-key file

Solution: Changed the wording a bit
2018-08-24 09:52:00 +02:00
Troy McConaghy
a16d561f54
Add link to the Java driver in Contributing docs (#2478) 2018-08-23 15:17:05 +02:00
codegeschrei
e2aafb9cf9 Problem: there is a new version of the python driver (#2477)
Solution: update the Dockerfile for acceptance tests
2018-08-23 14:49:04 +02:00
Troy McConaghy
045136f9a6 Problem: Not clear that simple-network-setup (old name) is the analog of Kubernetes Deployment template (#2475)
Solution: Rename it the "Simple Deployment Template" & fix all refs
2018-08-23 09:44:12 +02:00
codegeschrei
90f2fdfc23 Problem: several tests are skipped (#2452)
* Problem: several tests are skipped
Solution: activate or remove tests

* Problem: store_transaction is deprecated
Solution: replace it with store_bulk_transaction

* Problem: we don't test the transaction split
Solution: undelete `test_store_transaction`

* Problem: failing tests
Solution: merge master and change deprecated store_transaction
2018-08-22 10:48:43 +02:00
codegeschrei
55a9151c14 Problem: tests in test_bigchain_api are not activated (#2456)
* Problem: tests in test_bigchain_api are not activated
Solution: remove or active tests

* Problem: TransactionNotInValidBlock was removed
Solution: remove TransactionNotInValidBlock from tests
2018-08-22 09:56:44 +02:00
Troy McConaghy
acc60bcce1 Problem: 'backlog' still referenced by some code & comments (#2474)
Solution: Remove all references to 'backlog'.
Also make the tuple of TABLES common to all backend databases.
2018-08-21 10:27:25 +02:00
Troy McConaghy
4815e75855 Problem: People reading HTTP API docs not told about the option to query MongoDB directly (#2463)
Solution: Tell them
2018-08-21 10:26:39 +02:00
Vanshdeep Singh
01dba7e883 Problem: Cannot conclude validator election (#2445)
Solution: Gather votes and conclude election when supermajority is achieved
2018-08-20 16:57:32 +02:00
Troy McConaghy
a3dce723be
Problem: Config settings docs missing some configs & inconsistent (#2461)
* Problem: Config settings docs missing some configs & inconsistent

Solution: Document some undocumented config settings and make the config settings docs page more consistent

* Problem: No docs about how config setting env var name determined

Solution: Explain and show the relationship between the config-file name and the environment variable name of config settings
2018-08-20 09:34:55 +02:00
Troy McConaghy
bd49a3804f
Problem: Docs say "BigchainDB cluster" but IRL we say "BigchainDB network" (#2471)
Solution: Edit the docs to say "BigchainDB network" instead
2018-08-17 16:04:58 +02:00
Troy McConaghy
423820bcda
Problem: simple-network-setup page getting long (#2464)
Solution: Start refactoring it into a new section
2018-08-17 14:19:58 +02:00
vrde
0142e98dba Problem: Rapid JSON is outdated and slow (#2470)
Solution: Use the last version of Rapid JSON.
2018-08-17 14:08:49 +02:00
Troy McConaghy
abdd23f5a6 Problem: Source files contain no license info (#2455)
* Problem: Source files contain no license info

Solution: Add comments with SPDX license info to source files

* Python 3 files don't need # -*- coding: utf-8 -*-
2018-08-16 12:31:32 +02:00
Zachary Bowen
3092beb995 Reenable test bigchain api - part 1 (#2415)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Problem: Tests in class `TestBigChainAPI` from `tests/db/test_bigchain_api.py` were disabled

Solution: Fixed the tests that still made sense, and deleted the rest.

* Problem: Flake8 style complaints

Solution: Made things prettier

* Problem: Debugging comments were slightly NSFW

Solution: Deleted the debugging comments

* Problem: Stale use of `pytest.mark.genesis` decorator on these tests

Solution: Removed the decorator

* Problem: CriticalDoubleInclusion exception was no longer used anywhere in the code

Solution: Deleted it

* Problem: Unused exception `GenesisBlockAlreadyExistsError`

Solution: Deleted it

* Problem: I removed a test that covered writing to the DB and checking that everything is stored faithfully

Solution: Replaced it and got it working again
2018-08-13 09:54:45 +02:00
Troy McConaghy
bbf5310ac8
Problem: community drivers not working w/ latest BDB (#2443)
Solution: In the docs page listing the Community-Driven Libraries and Tools, make it clear that they might not work with the latest version of BigchainDB. Make it a warning rather than a note.
2018-08-10 11:39:44 +02:00
Zachary Bowen
3760824261 Create dynamic upsert validator commands (#2446)
* Problem: Need a method to initiate a new upsert-validator election

Solution: Added subcommand `new` to `upsert_validator`

* Problem: Changes to upsert-validator needed to be reflected in the docs

Solution: Wrote a section for `upsert-validator new`
2018-08-09 17:29:21 +02:00
Muawia Khan
3011548317 Problem: remove autodraft from download link (#2454) 2018-08-09 15:17:46 +02:00
Troy McConaghy
4636a48918 Problem: Glossary no longer referenced by any docs (#2441)
Solution: Remove Glossary section from the server docs
2018-08-09 11:16:56 +02:00
Troy McConaghy
205e2cf3fd Problem: Immutability page in docs sometimes wrong or controversial (#2435)
Solution: Edit that page
2018-08-09 11:16:05 +02:00
Troy McConaghy
4806b81577 Problem: Inconsistent HTTP API docs (#2403)
- Make the title of the asset search section consistent with the example (and consistent with the metadata search title and example).
- Add a note that one can use `asset?search` or `asset/?search`, and the same for metadata.
2018-08-09 11:14:48 +02:00
Troy McConaghy
65b6040e6b Problem: Codecov shield commented-out in README.md (#2421)
Solution: Uncomment it, since Codecov is working again

![Codecov](https://img.shields.io/codecov/c/github/bigchaindb/bigchaindb/master.svg)
2018-08-08 16:46:23 +02:00
Dan Acristinii
ab41b463d8 fixed validator curl port (#2447) 2018-08-08 15:45:08 +02:00
codegeschrei
44be8f572f Problem: Block parameters are not required anymore (#2374)
* Problem: all blocks are valid
Solution: remove the status from transactions

* Problem: changed the return type of get_transaction_filtered
Solution: return tx class instead of dict
2018-08-08 15:08:34 +02:00
Vanshdeep Singh
54b81d3ae8 Problem: Random failure for event handler test (#2423)
Solution: Random failure of test
`tests/test_events.py::test_event_handler_raises_when_called_after_start` seem
to be because of `get_nowait` which returns way to quickly even when the queue
has data. Increasing timeout seems to fix the issue.
2018-08-08 14:23:07 +02:00
Troy McConaghy
66fd001311
Problem: Doc re/ handling external PRs has moved (#2444)
Solution: Modify the file `HOW_TO_HANDLE_PULL_REQUESTS.md` to point its readers to the new document about how to handle external pull requests: [BEP-16](https://github.com/bigchaindb/BEPs/tree/master/16).
2018-08-08 13:27:48 +02:00
codegeschrei
bdfa059046 Problem: some tests are not activated (#2390)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Problem: some tests are not activated
Solution: activate and remove or fix tests

* Problem: accidentally un-skipped test_get_blocks_status_containing_tx during merge

Solution: Replaced the skip
2018-08-08 12:17:44 +02:00
Troy McConaghy
9b4273a987
Problem: Docs: 'Production Deployment Template' not a good name anymore (#2440)
Solution: Rename that section to 'Kubernetes Deployment Template'
2018-08-07 13:20:47 +02:00
Troy McConaghy
32b64ccc2a Problem: k8s docs not clear about who they're for (#2439)
Solution: Add a note atop k8s docs pages to clarify who they're for
2018-08-06 15:20:31 +02:00
innoprenuer
01dbb20248
moved java driver to officially supported category 2018-08-06 14:03:36 +02:00
Vanshdeep Singh
2e9a9b1121 Problem: Validator set not tracked by BigchainDB (#2436)
* Problem: Validator set not tracked by BigchainDB

Solution: BigchainDB depends on tendermint's RPC API to get the validator set
which is not avaiable during replay so the validators set should be tracked
inside BigchainDB

* Problem: Unclear code and documentation

Solution: Fix decode_validator and docs strings

* Problem: Doc strings missing

Solution: Add doc string for store_validato_set
2018-08-06 11:37:43 +02:00
Troy McConaghy
e0676306b7 Problem: old page in Appendices is redundant (#2388)
Solution: remove the old Appendices page about installing OS-level dependencies
2018-08-06 11:37:28 +02:00
Troy McConaghy
8090a35676
Problem: Docs say little re/ privacy & handling private data (#2437)
* Problem: Docs should say more about how to handle privacy & private data

Solution: Write a new docs page about that

* Problem: Server docs say little re/ prod. node security & privacy

Solution: Create a new docs page, "Production Node Security & Privacy"

* Address initial comments from @gautamdhameja
2018-08-06 10:15:09 +02:00
Troy McConaghy
d25d806cd8 Problem: pylint's GPL license isn't Apache2-compatible (#2406)
Solution: Remove pylint from setup.py. It occurred nowhere else.
2018-08-02 16:35:07 +02:00
Muawia Khan
66b243a2b4 Problem: People request all-in-one BigchainDB container (#2424).
Solution: Provide a stand-alone all-in-one BigchainDB container.

* Document it.
* Clarify that the image is not suited for joining a network.
2018-08-02 14:05:23 +02:00
Vanshdeep Singh
1a74afa9cd Problem: Node operator cannot vote on a ValidatorElection (#2428)
* Problem: Node operator cannot vote on a ValidatorElection

Solution: Implement validator election voting spec

* Problem: Incorrent code comments

Solution: Update comments with correct context

* Problem: Delegated vote not casted back to election

Solution: Update test to cast votes back to election id and assert their validity
2018-08-02 11:49:59 +02:00
Troy McConaghy
c2e61ae8c1 Problem: simple-network-setup docs trouble Ubuntu 16.04 users (#2432)
Solution: Make that docs page super-clear that it's for Ubuntu 18.04, and give hints for users of other distros
2018-08-02 10:36:04 +02:00
Muawia Khan
49bc495cc4 Last pr before 2.0 beta 5 (#2430)
* Last PR before the release of BigchainDB 2.0 Beta 5

* Fix editing error

* Change development status back to 4 - beta

* Rephrase some fixes I

* Rephrase some fixes II
2018-08-01 15:40:05 +02:00
Muawia Khan
b1c34523ed Problem: Simple network guide outdated, some new parameters required (#2429) 2018-08-01 11:27:20 +02:00
Troy McConaghy
6693a8933a
Change the docs license from CC-BY-SA-4 to CC-BY-4 (#2427) 2018-07-31 17:38:07 +02:00
Muawia Khan
5b05f6505d Upgrade tm_version to 0.22.8 (#2426)
* Upgrade tm_version to 0.22.8

* Fix tendermint download link
2018-07-31 17:27:16 +02:00
Vanshdeep Singh
533030cdae Problem: No test to validate duplicate inputs (#2425)
Solution: Update tests
2018-07-31 14:33:28 +02:00
Vanshdeep Singh
f13c9a9d57 Problem: Stateful validation doesn't raise double spend exception (#2422)
* Problem: Stateful validation doesn't raise double spend exception

Solution: Transaction.validate should raise exception DoubleSpend if the given
transaction is already a part of the database

* Problem: Double spend exception message not accurate

Solution: The exception message should state that the double spend is because of
spending the same input more than once in the transaction
2018-07-31 14:06:21 +02:00
Lev Berman
4795a78d49
Last PR before the release of BigchainDB 2.0 Beta 4 (#2420) 2018-07-30 16:23:00 +02:00
Troy McConaghy
b8ad5d9cec
Problem: Release process instructions for Docker Hub incomplete (#2407)
Solution: Expand the release process instructions for Docker Hub
2018-07-30 15:47:26 +02:00
Vanshdeep Singh
5adc1cac3e Problem: ReadTheDocs build fails. (#2419)
Solution: Move the schema spec for validator election to common directory so
that the yaml schema files can be found
2018-07-30 15:19:51 +02:00
Troy McConaghy
199adc81b6 Problem: Example priv_validator.json is out-of-date in docs (#2416).
Solution: In the simple-network-setup docs page, update the example priv_validator.json contents.
2018-07-27 17:42:35 +02:00
Vanshdeep Singh
7dcdefc58b Problem: There is no way to add new validators (BEP-21) (#2392).
Solution: Start by integrating the new election spec specifed in BEP-21.
2018-07-27 17:38:24 +02:00
Lev Berman
a0670b6d06
Problem: config utils tests are disabled. (#2402)
Solution: enable them back, cleanup no longer relevant parts.
2018-07-27 17:35:44 +02:00
Muawia Khan
c3f5e2a654 Problem: It is cumbersome to manage BigchainDB and Tendermint processes (#2410).
* Introduce a Monit-based setup for managing processes. Add the corresponding section to the network setup guide.
2018-07-27 17:33:55 +02:00
Lev Berman
2f6413fcd0 Problem: Transaction schema tests were disabled. (#2404)
Solution: Re-enable the tests. Remove some no longer relevant parts.
2018-07-26 16:44:56 +02:00
vrde
af2bf61dc8 Problem: websocket might be unresponsive (#2413)
Solution: It might be related on how aiohttp 2.x handles `send_str`.
AFAIK the call `send_str` was not "fully async". In aiohttp 3.x they
[changed it][1]:

> send_str(), send_bytes(), send_json(), ping() and pong() are genuine
async functions now. (#2475)

So this patch adds support for aiohttp 3.x, and uses the `send_str`
coroutine.

[1]: https://github.com/aio-libs/aiohttp/blob/master/HISTORY.rst#deprecations-and-removals-1
2018-07-26 15:30:10 +02:00
vrde
2087f7090f Problem: abruptly closed sockets still in memory (#2408)
Solution: Catch the proper exception and remove socket from memory.
2018-07-26 15:29:53 +02:00
Muawia Khan
0c33b4c211 Problem: Signals do not propagate to child BigchainDB processes (#2395).
Solution: Run child processes as daemons to make the signals propagate. Add a short shutdown description to the setup guide.
2018-07-26 14:42:32 +02:00
Zachary Bowen
2386ca9d71 Refactor tendermint directory to project root (#2401)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Problem: BigchainDB class should be part of project root

Solution: Removed the /tendermint directory and moved its contents to project root

* Problem: Flake8 complained that imports were not at the top of the file

Solution: Had to play around with the order of imports to avoid cyclic dependencies, but its working and style compliant now

* Problem: Stale reference to /tendermint directory in the index

Solution: Removed the references to /tendermint

* Problem: Flake8 complaining of unused import in __init__.py

Solution: The import is there so I can import App directly from bigchaindb, rather than from bigchaindb.core (which I think improves code readability. I added a # noqa to silence Flake8.

* Problem: Stale references to `bigchaindb.tendermint.BigchainDB` in the rst files cause Sphinx to fail

Solution: Updated the autodoc files to use `bigchaindb.BigchainDB` instead

* Problem: Stale reference to the `tendermint` directory in an @patch in a disabled test

Solution: Updated the @patch for completeness

* Problem: BigchainDB class should be part of project root

Solution: Removed the /tendermint directory and moved its contents to project root

* Problem: Flake8 complained that imports were not at the top of the file

Solution: Had to play around with the order of imports to avoid cyclic dependencies, but its working and style compliant now

* Problem: Stale reference to /tendermint directory in the index

Solution: Removed the references to /tendermint

* Problem: Flake8 complaining of unused import in __init__.py

Solution: The import is there so I can import App directly from bigchaindb, rather than from bigchaindb.core (which I think improves code readability. I added a # noqa to silence Flake8.

* Problem: Stale references to `bigchaindb.tendermint.BigchainDB` in the rst files cause Sphinx to fail

Solution: Updated the autodoc files to use `bigchaindb.BigchainDB` instead

* Problem: Stale reference to the `tendermint` directory in an @patch in a disabled test

Solution: Updated the @patch for completeness
2018-07-25 16:59:25 +02:00
vrde
d0a24ef584 Problem: validation runs redundant queries (#2409)
Solution: when a transaction is stored, the system splits it in three
components, data, metadata, and the other fields of the transaction.
When the system retrieves a transaction, it needs to make three
different queries to reconstruct the original transaction. If a
transaction does not exist, the system does three queries anyway, even
if just one query is enough. This patch fixes this by doing the
additional queries if and only if the transaction exists.
2018-07-25 16:16:06 +02:00
Troy McConaghy
d5dda74643
Dummy PR (#2405)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2
2018-07-25 10:02:55 +02:00
Troy McConaghy
12740686e9
Problem: Docs say Crypto Conditions are part of ILP (#2399)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2

* Problem: Docs say Crypto Conditions are part of ILP

Solution: Edit the docs so they no longer say that
2018-07-23 18:03:21 +02:00
Muawia Khan
75c22141ad
Problem: mongodb repos different for debian and ubuntu (#2385)
* Problem: mongodb repos different for debian and ubuntu

* Ignore errors for checking bdb process
2018-07-23 17:38:24 +02:00
Troy McConaghy
42cc0d0e86 Problem: No troubleshooting help for users of simple-network-setup (#2398)
Solution: Add a Troubleshooting section to the simple-network-setup docs
2018-07-23 16:54:27 +02:00
Troy McConaghy
e681427b75
Problem: The write-a-bep page/process is daunting (#2347)
* Problem: The write-a-bep page/process is daunting

Solution: Make the BEP writing process easier and more approachable

* Problem: BEP should be written uppercase

Solution: Change bigchaindb/BEPs label names to use uppercase "BEP"
2018-07-23 10:42:36 +02:00
Troy McConaghy
abc6db7999
Last PR before the release of BigchainDB 2.0 Beta 3 (#2391)
* Update CHANGELOG.md for 2.0 Beta 3 release

* Update docs re/ installation for 2.0.0b3

* Update version.py and k8s files for 2.0.0b3
2018-07-18 15:20:13 +02:00
codegeschrei
d521a00925 Problem: a valid transaction is detected as double spend (#2389)
Solution: query the wanted data per input
2018-07-18 10:52:33 +02:00
codegeschrei
fdf0283508 Problem: consensus and blocks are deprecated (#2384)
Solution: remove test files for consensus and blocks
2018-07-16 19:21:27 +02:00
Troy McConaghy
b122e7e83b
Last PR before the BigchainDB 2.0 beta 2 release (#2382)
* Updated CHANGELOG.md for the 2.0b2 release

* Update bigchaindb docker image names for k8s for the 2.0b2 release

* Update version.py for the 2.0b2 release

* In CHANGELOG.md, added note re port 46657->26657
2018-07-16 15:39:07 +02:00
Muawia Khan
9cfc1e6f5a Update to tendermint version 0.22.3 (#2380)
* Update to tendermint version 0.22.3 for dev/test deployment docs and scripts

* Update version and parameters for 0.22.3

- Sync docker-compose
- Power should be a "string" not a int,uint
2018-07-11 16:59:42 +02:00
Zachary Bowen
4d2e58416c Problem: Bigchain class is unused and redundant (#2366)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Merge with master and re-do some changes
2018-07-10 17:34:51 +02:00
Zachary Bowen
f243b252ca Problem: we don't have any tests to cover malicious strings (#2334)
* Problem: we don't have any tests for malicious strings

Solution: Use a parameterized test that fuzzes over a library of potentially hazardous strings

* Needed to update the Dockerfile to install blns

* Removed unnecessary import from Dockerfile-dev

* Made the conditions under which the test expects an error more explicit

* Improved reporting in case of a bad status code

* Removed some over-zealous assertions.

* Removed `sent_transaction` from assertation error response

* *Problem: blns was removed as a dependency while fixing a merge conflict

Solution: added it back to the Dockerfile

* *Problem: made a typo when adding blns to the Dockerfile

Solution: fixed the typo
2018-07-10 17:30:00 +02:00
Troy McConaghy
10953a64e7 Problem: "IPDB Transaction Spec" referenced in .../schema/README.md (#2376)
Solution: Update `bigchaindb/common/schema/README.md` to link to the BigchainDB Transactions Specs instead.
2018-07-10 14:19:45 +02:00
Vanshdeep Singh
c7503f5689 Problem: Support for latest Tendermint missing (#2375)
Solution: Upgrade to py-abci 0.5.1 to use latest Tendermint
2018-07-10 14:16:02 +02:00
vrde
1118ddffa2 Problem: performance issue on transaction lookup (#2378)
Solution: create the correct index for transaction id.
Close #2377
2018-07-10 13:51:59 +02:00
Lev Berman
744ab3d5ef Problem: 2 implementations of fastquery exist. (#2365)
* Problem: 2 implementations of fastquery exist.

Solution: Remove the old deprecated implementation. Update the tests.

* Problem: There are still 3 outdated fastquery tests.

Solution: Fix the tests.
2018-06-29 15:48:58 +02:00
Muawia Khan
1bad851e07
Problem: Tendermint configuration not present in BigchainDB config (#2342)
* Problem: Tendermint configuration not present in BigchainDB config

* Handle tendermint configurations properly

- Update docs

* Nitpick

* Missed some conflicts

* Make changes in tendermint/lib.py instead of deprecated core.py

- Also remove redundant info from docs about default values

* Fix docsserver automethod
2018-06-29 18:45:22 +05:00
codegeschrei
af996650c3 Problem: The Block class is deprecated (#2368)
* Problem: docs are not building anymore
Solution: add wget to the requirements for docs

* Problem: The Block class is deprecated
Solution: remove the block class and all occurrences
2018-06-29 15:32:16 +02:00
codegeschrei
278ff1ddb2 Problem: docs are not building anymore (#2360)
Solution: add wget to the requirements for docs
2018-06-28 18:08:55 +02:00
Muawia Khan
00553c8324
Problem: Typos in variable names left during some conflict resolution (#2364) 2018-06-28 17:44:28 +05:00
codegeschrei
7449b026fa Problem: voting code is not used anymore (#2357)
* Problem: voting code is not used anymore
Solution: remove all voting related code

* Problem: Some voting functionality is still present.

Solution: Remove it. Update some of the related tests.

* Problem: some skipped tests are now running
Solution: remove pytest mark to not run them

* Problem: fastquery is not related to votes
Solution: remove it in another PR
2018-06-28 11:30:13 +02:00
Vanshdeep Singh
67c4ce964a Problem: Upsert validator not marked experimental (#2356)
Solution: Update documentation to mark it experimental
2018-06-20 10:15:14 +02:00
codegeschrei
119dcef75f Problem: Code codecoverage does not work (#2355).
* Problem: Code coverage does not work.
* Solution: Fix the code coverage script.
2018-06-19 10:58:12 +02:00
Vanshdeep Singh
971efb5f1c Problem: Bigchaindb processes cannot be recogonized in shell easily (#2354)
Solution: Append 'bigchaindb_' to the name of each process
2018-06-18 14:15:24 +02:00
Troy McConaghy
d0293c5285
Problem: Users need more help querying mongodb (#2352)
* Add info how to connect to MDB & example MDB documents

* Add JS code examples & blogpost link to Query page
2018-06-14 17:21:15 +02:00
Shahbaz Nazir
2da720e542 Problem: There is no logging for benchmark stats (#2349)
* add log level for benchmarking

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* Bug fixes and code re-factor

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* remove un-necessary imports

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix failing tests

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* update docs

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix typo

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix flake8

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix flake8 issues

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* nitpic fixes

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-06-14 15:19:26 +02:00
Troy McConaghy
58fbccf3f1 Problem: © year out-of-date in footer of docs (#2353)
Solution: Compute the © year so it's always up-to-date
2018-06-14 13:03:31 +02:00
codegeschrei
181c9a13b5 Problem: there is a new python driver version (#2351)
Solution: update the version for acceptance tests
2018-06-14 11:08:48 +02:00
Lev Berman
6b5fe19036
Problem: Tendermint freezes due to docker-compose bug. (#2341)
Solution: Do not rely on depends_on when running containers in the foreground. Solves #2322.
2018-06-12 10:26:52 +02:00
Troy McConaghy
04514fe17f Problem: No diagrams of transactions in docs (#2346)
Solution: Put some simple diagrams of BigchainDB transactions in the docs
2018-06-11 17:25:27 +02:00
Troy McConaghy
46b3720bf5 Problem: CHANGELOG didn't accurately describe known issues (#2344).
Solution: Revise the CHANGELOG to more accuratly describe all known issues (at the time of the Beta release).
2018-06-11 14:11:11 +02:00
Shahbaz Nazir
bec8d13e36
Problem: Current logging server keeps running in some tear down scenarios (#2304)
Solution: Remove the current pub/sub based logging infra as this model is no longer necessary. This can now be replaced by a simple system level logging config.
2018-06-11 13:08:03 +02:00
Troy McConaghy
d492485357
Fixed a typo in README.md 2018-06-09 09:32:58 +02:00
Troy McConaghy
36930248a4
In README.md, make the shields line up on 1 line 2018-06-09 09:31:52 +02:00
Muawia Khan
1c7d5dcd2a
Problem: Stack installation on Centos 7 caused issues with some packages (#2339) 2018-06-08 15:52:22 +02:00
Muawia Khan
2b39566a4b Problem: Some configurations are defunct (#2338)
* Problem: BigchainDB config has stale/deprecated parameters

- Remove `keyring` and `keypair` from config
- Update tests
- Add `tendermint` config

* Fix flake8

* Update some naming conventions and redundant changes

* Remove redundant routine `fast_query`

* Remove deprecated parameters and descriptions

* remove some more unwanted code

* Problem: Two flake8 errors made Travis fail

Solution: Fix the two flake8 errors

* Address comments

- Remove reference of nodes_except_me and me_private and me
  as attributes of BigchainDB instances
- Update and re-add test(s)
- Do not introduce `tendermint` in configuration instead handle that
  in a separate PR along with docs

* Address comments

- Remove tests that are already covered with 2.0
- Remove tests that are no longer relevant
- Add TODO for more cleanup

* Remove tendermint config from configure command
2018-06-08 15:50:50 +02:00
Troy McConaghy
58a5959170 Problem: README.md is outdated & has broken links (#2340)
Solution: Update README.md and fix broken links & shields
2018-06-08 11:31:10 +02:00
Lev Berman
6f9dc5168b Problem: Tendermint RPC server gets stuck. (#2337)
Solution: Upgrade Tendermint to v0.19.0. Fixes #2322.
2018-06-06 14:18:27 +02:00
Troy McConaghy
cf1202fe0c Copyedit simple-network-setup completeness & grammar (#2312)
* Copyedit simple-network-setup completeness & grammar

* Problem: Member doesn't know their BigchainDB Root URL

Solution: Add a section to tell the Member their BigchainDB Root URL

* Problem: Operator doesn't know how to reset their node

Solution: Add a section with commands an operator can use to reset their node

* Problem: Repeated previous sentence w/o changing it

Solution: Repeat previous sentence but change 'BigchainDB' to 'Tendermint' and delete the parenthetical sentence about MongoDB

* Address the comments by @vrde
2018-06-06 10:03:25 +02:00
Muawia Khan
fa72b722f7 Problem: Docker images of tendermint/tendermint:0.19.7 tagged but not updated in bdb (#2335) 2018-06-04 16:10:50 +02:00
Troy McConaghy
241db4ee48 Problem: backlog_reassign_delay is defunct but still listed (#2332)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2

* Problem: backlog_reassign_delay is defunct but still listed

Solution: remove all mentions of & calls for backlog_reassign_delay
2018-06-04 12:19:24 +02:00
Troy McConaghy
1753a7019b Problem: Appendices page 'The Bigchain Class' not Updated for Tendermint (#2330)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2

* In the Appendices, update page re/ The Bigchain Class
2018-06-04 12:19:04 +02:00
Takanori Hirano
c5b4fa357d Problem: nginx_container document is incorrect (#2331)
Solution
Fixed nginx_container volume path and environment name.
2018-06-04 12:18:03 +02:00
Troy McConaghy
00cb5108ca Problem: vote.yaml & vote schema validation not used anymore (#2319).
Solution: remove vote.yaml & all vote schema validation code.
2018-06-04 10:53:01 +02:00
Troy McConaghy
51fa3155f6
Problem: what if someone agrees to CLA but no PR? (#2313)
Solution: ask them if they meant to agree to the CLA, and if so, where is their PR?
2018-06-01 14:54:51 +02:00
Troy McConaghy
6b0f22aeb8
Last PR before 2.0 beta 1 (#2328)
* Update CHANGELOG.md for 2.0 Beta 1 release

* Changed 2.0.0b1 release date to 2018-06-01

* k8s: Updated bigchaindb docker image tag to 2.0.0-beta1

* Updated version.py for the 2.0 Beta 1 release

* Updated dev status to '4 - Beta' in setup.py for the 2.0 Beta 1 release
2018-06-01 13:49:23 +02:00
Troy McConaghy
02ee8a9ac1
Upgrade Tendermint to 0.19.7, except for Docker image still at 0.19.2 (#2327)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2
2018-06-01 13:29:58 +02:00
Troy McConaghy
ccb7a86428 Copy-edited & updated page on Running a Local Dev Node as Processes (#2324) 2018-06-01 12:46:25 +02:00
Troy McConaghy
54229d1faf Problem: Still using "team bot" after installing Codecov (#2325)
Solution: Remove the "team bot" from the `codecov.yml` file.

I installed Codecov on all "bigchaindb" (GitHub organization) repos today, so we can remove the "team bot", according to [the Codecov docs](https://docs.codecov.io/docs/team-bot), i.e.

> The best way to integrate with Codecov is to Install Codecov's GitHub Integration.

> Once installed, you are done! You do not need to set a Team Bot because Codecov will use the integration to post statuses and comments.
2018-06-01 10:51:35 +02:00
vrde
357c3ee8eb Problem: API returns 404 for existing empty blocks (#2321)
* Problem: API returns 404 for existing empty blocks

Solution: Empty blocks are not store in MongoDB because Tendermint does
not notify BigchainDB about them. In case a user requests a block that
is not in our MongoDB, we check if the requested height is less than or
equal to latest_block_height. If that's the case, we return an empty
block. If the requested height is greater than latest_block_height, then
we return 404.

* Address Lev's comment

* address Lev and Vansh comment
2018-05-31 17:15:17 +02:00
Muawia Khan
10e55aa4e7
Problem: No automated way to set up a dev/test network (#2300)
* Problem: No automated way to set up a dev/test network

* Problem: docs not updated for stack, ansible and docker based dev environments

* Problem: Using apt triggers java runtime installation on MacOS

- Update pre_tasks in ansible
- Update bigchaindb-stop playbook to handle pre_tasks

* Update Tendermint version to 0.19.3 from 0.19.2

* Update tendermint version to 0.19.3 everywhere else

* Problem: Sphinx warns about duplicate section labels

Solution: Don't use sphinx.ext.autosectionlabel

* Problem: Sphinx complains that run-node-with-docker not in any TOC

Solution: Add run-node-with-docker to a TOC (i.e. to an index.rst file)

* Tendermint has not tagged `0.19.3` container

* Problem: Internal hyperlinks to new pages not working

Solution: Add .html to the ends of the filename strings

* Problem: Invalid script imports

* Problem: Invalid comparison for supported OS version

* Addressing comments I

* Problem: No way to configure dev/forked repo for developers

* Problem: Docs not updated with STACK_REPO parameter

* Addressing comments II
2018-05-31 16:56:45 +02:00
Muawia Khan
0f56e4372d Revert: bigchaindb configure does not write the correct configuration (#2323) 2018-05-31 15:18:59 +02:00
Troy McConaghy
f3683854e8 Problem: Can't connect to local MongoDB when make start (#2320)
Solution: Expose MongoDB port 27017 when using `make start`, i.e. when using docker-compose.yml
2018-05-30 15:58:56 +02:00
Troy McConaghy
298ff8a3fd Problem: We continue to be asked about production-readiness (#2316)
Solution: Add more explanation to the docs page about production-readiness
2018-05-29 17:47:59 +02:00
Vanshdeep Singh
a2aa4554c0 Problem: Spending transaction doesn't return properly (#2318)
Solution: Differentiate between stored spent txns and current spending txns
2018-05-29 17:43:42 +02:00
vrde
340d0a2ea1
Problem: no instructions on simple network setup (#2296)
Solution: write a step-by-step tutorial on who should do what.
2018-05-24 01:39:03 +02:00
Troy McConaghy
acc2710d7b Problem: There are old links to the IPDB tx spec (#2290)
Solution: Replace those links with appropriate links to the BigchainDB Transactions Specs
2018-05-24 01:36:43 +02:00
Troy McConaghy
dfa4b70f23 Problem: make doc doesn't build the /contributing docs (#2293)
Solution: Make `make doc` build the docs in docs/contributing as well
2018-05-24 01:35:04 +02:00
Ahmed Muawia Khan
208085e16b
Problem: bigchaindb configure does not write the correct configuration (#2306) 2018-05-23 12:20:18 +02:00
Lev Berman
89b28b8471 Remove unsupported backends (#2289)
* Problem: RethinkDB, change feed, old mongo, admin interface are not supported any longer.

Solution: Remove unsupported functionality. Bring the MongoDB backend implementation completely to the localmongodb package. Fix the test setup.

* Problem: Nothing depends on multipipes any longer.

Solution: Remove multipipes from setup.py.

* Problem: The how-to-run-tests doc uses --database-backend.

Solution: Do not include the --database-backend option into the documented pytest usage.

* Problem: The backends docs are outdated.

Solution: Document MongoDB as the default and only backend for BigchainDB.

* Problem: The inputs fixtures uses old blocks API.

Solution: Change the inputs fixtures to use the new blocks API.

* Problem: rethinkdb package is not used anymore.

Solution: Remove the rethinkdb dependency from setup.py.

* Problem: The abci-marked tests use outdated Mongo conn.

Solution: Replace MongoDBConnection with LocalMongoDBConnection for them.
2018-05-23 11:34:00 +02:00
Troy McConaghy
5403f7bfcc Remove "Post-Release Steps" from release process (#2305)
The release process had some "Post-Release Steps" but I haven't been doing them lately. What were they?

The idea was to change the version number so that someone working on the `master` branch would see a version number reflecting what the `master` branch is. For example, if version 0.9.0 was just released, then the `master` branch would be changed to have the version number 0.10.0.dev, to indicate that it's the in-development version of 0.10.0.

My thinking now is that if someone is developing new code, then they don't need the version number to help them remember what they're doing. Moreover, if someone purposefully changes the docs to view the `master` branch docs, then they probably know what that means, and they don't need help from a version number.
2018-05-18 11:26:37 +02:00
Troy McConaghy
6fd8558bef
Last PR before releasing version 2.0.0a6 (#2301)
* Update CHANGELOG.md for 2.0.0a6

* Update image tags in k8s YAML files for 2.0.0a6

* Update version.py for 2.0.0a6
2018-05-17 15:42:31 +02:00
vrde
f86704bae9 Problem: BigchainDB does not support newer MongoDB (#2298)
* Problem: BigchainDB does not support newer MongoDB

Solution: Update driver to the last version, that is compatible with all
versions of MongoDB

* Update to MongoDB 3.6
2018-05-17 15:19:56 +02:00
vrde
474fe80abb Problem: dev env doesn't allow P2P connections (#2299)
Solution: expose Tendermint P2P port 46656
2018-05-17 15:19:12 +02:00
codegeschrei
e2ab561eef Problem: we don't have enough acceptance tests (#2294)
* Problem: we don't have enough acceptance tests
Solution: test different scenarios for divisible assets
2018-05-16 17:07:43 +02:00
codegeschrei
04b3b15c66 Problem: not all transaction scenarios in acceptance tests (#2291)
Solution: test multiple owners for a transaction
2018-05-16 15:54:54 +02:00
Lev Berman
2e9c20491c Problem: web transaction tests were broken or disabled. (#2278)
Solution: Fix or reenable the tests after the migration to BigchainDB 2.*.
2018-05-16 15:17:33 +02:00
Lev Berman
d44bec1b7d Problem: Pre-commit does not validate acceptance tests. (#2295)
Soluton: Adjust the pre-commit config.
2018-05-16 14:45:34 +02:00
vrde
dbf1b23c43 Problem: acceptance tests are using old pydriver (#2282)
Solution: update to the new driver version, and simplify the code
removing the `mode` parameter.
2018-05-15 11:46:58 +02:00
Lev Berman
89d665c01e Problem: Asset tests are disabled. (#2277)
Solution: Update the tests to work with BigchainDB 2.* and enable them back.
2018-05-15 11:19:47 +02:00
Ahmed Muawia Khan
48cabdd6b9 Problem: Nginx deployment is broken for k8s (#2287) 2018-05-15 10:59:35 +02:00
Lev Berman
2c171312cf Problem: The pipelines library is not used anymore. (#2286)
Solution: Remove pipelines. This is part of the BigchainDB 2.* migration cleanup.
2018-05-14 16:16:57 +02:00
Troy McConaghy
b9bceb7e3a Problem: Broken hyperlink in write-code.rst (#2288)
Solution: Fix the broken link
2018-05-14 09:57:48 +02:00
Ahmed Muawia Khan
ecaffb3308 Problem: Bash renders the quotes around apicast and openresty as variables (#2285) 2018-05-14 09:29:13 +02:00
Troy McConaghy
aeaf9c934d
Last PR before the release of version 2.0 Alpha 5 (#2283)
* Updated CHANGELOG.md for version 2.0 Alpha 5

* Updated image tags in k8s files for 2.0 Alpha 5

* Updated version.py for 2.0 Alpha 5

* Problem: Missing alpha5 image update for test network containers

* Problem: CHANGELOG not updated with 2284

* Problem: Liveness probe frequency change not the important
2018-05-11 15:23:15 +02:00
Ahmed Muawia Khan
bcfb577cfb
Problem: Liveness probe too aggressive (#2284) 2018-05-11 14:58:59 +02:00
Vanshdeep Singh
d2685052a6 Problem: py-abci not upgraded (#2281)
Solution: Upgrade py-abci
2018-05-11 10:32:39 +02:00
vrde
31bae195e7 Problem: acceptance-test suite is not documented (#2267)
* Problem: acceptance-test suite is not documented

Solution: add README.md in the root of the acceptance tests, unify
`Makefile` and commands, remove more cached files when `make clean` is
ran.

* Problem: documentation does not mention Makefile

Solution: update docs with our new and shiny commands
2018-05-11 09:50:08 +02:00
vrde
4a23fa6629 Problem: Python version not check before running (#2179) (#2280)
Solution: Check python version
2018-05-11 09:15:48 +02:00
Troy McConaghy
089cb5d24f
Last PR before the 2.0 Alpha 4 release (#2274)
* Initial CHANGELOG.md edits for the 2.0 Alpha 4 release

* Added PR #2275 to CHANGELOG.md for the 2.0 Alpha 4 release

* Update k8s image tags for the 2.0 Alpha 4 release

* Update version.py for the 2.0 Alpha 4 release
2018-05-09 14:03:19 +02:00
Vanshdeep Singh
7384a49d9a Problem: Invalid transaction posted to Tendermint (#2270)
* Problem: Amount error is not tested on the HTTP level.

Solution: A failed web test to reproduce the problem.

* Problem: Invalid transaction posted to Tendermint

Solution: Pass the exception to HTTP POST handler function

* Problem: DoubleSpend and CriticalDoubleSpend not differentiated

Solution: Handle these exceptions differently in `get_spent`

* Problem: No test for checking exception DoubleSpend and CriticalDoubleSpend

Solution: Add necessary tests

* Problem: find doesn't raise IndexError

Solution: Remove exception handling for IndexError
2018-05-09 13:41:22 +02:00
Ahmed Muawia Khan
97b2d554e9 Problem: abci_info liveness probe check is not enough (#2275) 2018-05-09 11:58:46 +02:00
Troy McConaghy
722401ada9 Problem: How do I store files in BigchainDB? (#2259)
Solution: Write a new root docs page about how to store files in BigchainDB.
2018-05-08 10:35:21 +02:00
Artus Vranken
9020348073 Fixed the doc link to "node-on-kubernetes" (#2263) 2018-05-05 17:12:26 +02:00
Troy McConaghy
a388bd5122
Updated RELEASE_PROCESS.md based on things noticed in the 2.0 Alpha 3 release (#2266) 2018-05-04 12:09:17 +02:00
Lev Berman
3eb0b15aa0 Problem: Tendermint creates empty blocks in the Docker-based setup. See #2204. (#2265)
Solution: Set the --consensus.create_empty_blocks=false option in docker-compose.yml.
2018-05-04 12:02:22 +02:00
Vanshdeep Singh
63635f12fc Problem: Event stream test failing (#2262)
Solution: Extend the wait time for Tendermint to start
2018-05-03 16:42:43 +02:00
Troy McConaghy
b408b57eda
[WIP] Last PR to merge before releasing BigchainDB 2.0 Alpha 3 (#2257)
* Initial CHANGELOG.md updates for 2.0 Alpha 3

* More updates to CHANGELOG.md for 2.0 Alpha 3

* Added note in CHANGELOG.md about the bigchaindb-abci package we're using for now

* Updated Docker image tags to bigchaindb/bigchaindb:2.0.0-alpha3

* Updated version.py for BigchainDB 2.0 Alpha 3
2018-05-03 16:34:05 +02:00
Vanshdeep Singh
551cf58c7c Problem: pypi bigchaindb-abci not used (#2261)
Solution: Migrate to pypi abci
2018-05-03 16:04:16 +02:00
Lev Berman
e271ae9e5b Problem: the Tendermint install instructions are outdated (#2260)
Solution: post the link to the relevant Tendermint documentation page
2018-05-03 15:48:55 +02:00
Vanshdeep Singh
cf36a6fe47 Problem: Multi-threading not enabled (#2258)
Solution: Enable multi-threading
2018-05-03 11:52:54 +02:00
Ahmed Muawia Khan
11c0ea916c
Problem: Acceptance tests on ci failing (#2256) 2018-05-02 18:16:54 +02:00
Ahmed Muawia Khan
82e3f21c9a Merge branch 'alpha-3' 2018-05-02 16:35:49 +02:00
Vanshdeep Singh
920d69b0c4 Problem: Upsert validator not migrated to Tendermint 0.19.0 (#2252)
* Problem: Upsert validator not migrated to Tendermint 0.19.0

Solution: Migrate the same to Tendermint 0.19.0

* Problem: There are no tests for public key encoding/decoding

Solution: Add necessary tests
2018-05-02 16:21:28 +02:00
Ahmed Muawia Khan
fd48abebae
Problem: Tendermint 0.19.0 missing crucial fixes (#2253) 2018-05-02 14:39:41 +02:00
Ahmed Muawia Khan
85683af2eb Problem: BigchainDB liveness probe should be HTTP API (#2251) 2018-05-02 11:41:47 +02:00
Vanshdeep Singh
7b0f6f6322 Problem: py-abci not upgraded (#2250)
Solution: Upgrade py-abci to the latest fix
2018-05-02 10:42:32 +02:00
Ahmed Muawia Khan
5ce0538c61 Problem: Old --p2p.seeds is now --p2p.persistent_peers (#2249)
Solution
As per Tendermint 0.16.0 , --p2p.seeds is now --p2p.persistent_peers. Update bigchaindb/tendermint container to use that configuration. Also disable --p2p.pex, we currently don't want the peer exchange.
2018-04-30 17:42:14 +02:00
Vanshdeep Singh
f81dfc744d Problem: Insufficent logs (#2248)
Solution: Add debug log statements
2018-04-30 15:49:07 +02:00
vrde
8d589d0181
Problem: we don't have acceptance tests (#2216)
Solution: have a simple way to start a node and run scripts against it.
2018-04-30 14:43:39 +02:00
Ahmed Muawia Khan
4e93ede5ad Problem: Nodes cannot exchange pub keys (#2246)
Solution: Open port for communication between nodes to access public key add node_id
2018-04-27 19:15:36 +02:00
Ahmed Muawia Khan
b41c6a6514 Problem: abci dependency not processed (#2245) 2018-04-27 18:54:26 +02:00
Ahmed Muawia Khan
b19465d19a Problem: Unbound variable (#2244) 2018-04-27 17:47:54 +02:00
Ahmed Muawia Khan
2bf53423e7 Problem: BigchainDB instance name is now unique (#2243)
Solution: Use BDB_INSTANCE_NAME from vars instead of static INDEX, to generate configurations for the bdb-instance.
2018-04-27 17:37:52 +02:00
Ahmed Muawia Khan
dbabe94887 Problem: BigchainDB and Tendermint inconsistencies because disjoint services (#2242)
Solution
Since BigchainDB and Tendermint are so tightly coupled we need to introduce a process supervisor to make them act like a single microservice, so that if BigchainDB crashes, Tendermint does as well and both are restarted and Tendermint requests a connection towards the proxy app.

In Kubernetes, they can be exposed as part of a one POD.
For BigchainDB as a system service/process, we need to introduce a process supervisor such as systemd.
This PR only solves the former.

Changes
Upgrade deployment from Tendermint v0.12.0 to v0.19.0
Update some documentation
Fix nginx-http entrypoint issues.
Update generate-configs.sh script to handle config generation without https-certificates.
Update Dockerfile to process dependency links introduced by abci
Integrate BigchainDB and Tendermint as a single microservice.
This required making BigchainDB to be exposed as a statefulset.
Introduce new liveness probe checks.
Issues Resolved
Partially fixes #2232
2018-04-27 15:54:47 +02:00
Shahbaz Nazir
9b71026d4b Problem: Arbitrary max_tries in bigchaindb when connecting to tendermint ws (#2241)
* remove max_tries while connecting to tendermint ws

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* leave healthcheck as is for now

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-04-26 16:50:20 +02:00
Vanshdeep Singh
651573ef77 Problem: Required ABCI fix not available (#2237)
Solution: Use the ABCI release 0.4.3 from kansi/py-abci
2018-04-26 13:53:19 +02:00
Ahmed Muawia Khan
119420785d
Problem: Kubernetes template broken for threescale/apicast deployment (#2206) 2018-04-26 11:37:41 +02:00
Vanshdeep Singh
44f19a398c Problem: Tests failing with py-abci 0.4.1 (#2235)
Solution: Fix tests and Migrate to Tendermint 0.19.0
2018-04-26 11:09:38 +02:00
vrde
e90b5fa5f2 Problem: make test doesn't run tests (#2234)
Solution: patch Makefile to be compatible with the new integration
testing suite. Fix #2230
2018-04-25 09:40:45 +02:00
Vanshdeep Singh
65bb6e5c91 Problem: No integration test for upsert-validator (#2212)
Solution: Write necessary test
2018-04-24 16:17:49 +02:00
Troy McConaghy
d066bfe132
Problem: No docs explaining use of MongoDB for querying (#2193)
* Problem: No docs explaining use of MongoDB for querying

Solution: Start a new root docs page explaining how a node operator can use the full power of MongoDB's query engine, and can expose as much of that as they like to end users.

* Finished first draft of new docs page 'Querying BigchainDB'
2018-04-23 19:30:45 +02:00
Troy McConaghy
99d46605ae Problem: GitHub can't detect the code license (#2227)
Solution: Create a `LICENSE` file in this repo, containing the Apache v2 license, so that GitHub can detect the code license in this repo.

Please leave the `LICENSES.md` file. It also specifies the license on the documentation, and notes that some code is NOT licensed Apache v2 (i.e. the code we got from Runscope and modified).

This pull request was inspired by https://github.com/bigchaindb/bigchaindb-driver/pull/406 by @codegeschrei
2018-04-20 10:23:19 +02:00
Troy McConaghy
389b3e3279
Last PR before release of 2.0.0 Alpha 2 (#2221)
* Initial update to CHANGELOG.md for the 2.0 Alpha 2 release

* Add Known Issues section to 2.0 Alpha 2 changelog

* Update Docker image tag to bigchaindb/bigchaindb:2.0.0-alpha2

* Update version.py for 2.0.0 Alpha 2
2018-04-18 14:51:16 +02:00
Troy McConaghy
9404bad5b5 Problem: RELEASE_PROCESS.md wrong about docker image tags (#2176)
Solution: Fix what RELEASE_PROCESS.md says about how we set docker image tags
2018-04-18 14:14:32 +02:00
Vanshdeep Singh
127ee08053 Problem: No crash recovery mechanism (#2207)
Solution: Add crash recovery logic based on BEP#8
2018-04-18 10:46:16 +02:00
Vanshdeep Singh
1823818315 Problem: Error response not handled in POST transaction to tendermint (#2219)
Solution: Handle the error response
2018-04-17 16:39:43 +02:00
Vanshdeep Singh
0cf0927193 Problem: No debug statement for post transaction (#2213)
Solution: write debug statement for response received from POST transaction
2018-04-16 17:36:37 +02:00
Vanshdeep Singh
a62cd68f8c Problem: No test for reponses from Tendermint during POST txn (#2210)
Solution: write tests
2018-04-16 15:30:02 +02:00
Ahmed Muawia Khan
b97b3842d9 Problem: Not enough logs to debug an issue while developing (#2209) 2018-04-16 14:46:45 +02:00
Vanshdeep Singh
a29e9c6dd9 Problem: Imprecise POST transaction responses (#2198)
Solution: Improve responses
2018-04-16 12:14:15 +02:00
Troy McConaghy
006a0a6a2a
Change license back to Apache v2 again (#2208)
I changed the license from AGPL v3 to Apache v2 in January. See pull request #2020

Somehow, the license got changed back to AGPL without us noticing. It was noticed by @dscook who asked us about it on Gitter, see https://gitter.im/bigchaindb/bigchaindb?at=5ad0cfc66d7e07082bef276b 

This pull request changes the license back to Apache v2, which is what it should have been ever since January.
2018-04-15 10:47:37 +02:00
Ahmed Muawia Khan
160b7334c7 Problem: Empty blocks not being retrieved from BigchainDB (#2205) 2018-04-12 14:08:02 +02:00
Vanshdeep Singh
a4986b7e71 Problem: No queries to store pre-commit state (#2135)
Solution: Add backend logic to store and retireve pre-commit state
2018-04-12 13:36:21 +02:00
Vanshdeep Singh
7f6782e31d Problem: ABCI server not run for tests (#2138)
Solution: Create seperate test mark for which the ABCI server will be running
2018-04-10 17:29:25 +02:00
codegeschrei
6f69f39ff4 Problem: there are no f-strings in python 3.5 (#2185)
Solution: change f-strings to a compatible format for Python 3.5
2018-04-09 17:02:59 +02:00
Ahmed Muawia Khan
d4934b9525
Problem: Websocket connection fails and retries are exhausted (#2188)
* Problem: Websocket connection fails and retries are burnt out

* Fix minor commit `specifiec` to `specified`
2018-04-09 13:47:24 +02:00
codegeschrei
b8f78e34d0 Problem: Python version is not compatible with the Driver (#2183)
Solution: revert commit d28b9019c08495789f86b81ef8283865fb031184.
2018-04-06 11:13:42 +02:00
Ahmed Muawia Khan
8c1ee8329e Problem: Typo with get kube-dns IP (#2181) 2018-04-05 17:56:30 +02:00
Troy McConaghy
c8682a1d89 Problem: bigchaindb upsert-validator labelled "insecure" (#2180)
Solution: Remove the "insecure" label from the docs on `bigchaindb upsert-validator`
2018-04-05 17:47:11 +02:00
Vanshdeep Singh
d28b9019c0 Problem: Python version not check before running (#2179)
Solution: Check python version
2018-04-05 15:29:32 +02:00
vrde
6181e52dbd Problem: Exchange can fail silently (#2177)
Solution: Raise a RuntimeError if Exchange is running and a new
subscriber queue is requested.
2018-04-05 13:57:07 +02:00
Troy McConaghy
cc88b4d286 Final PR Before the Release of 2.0 Alpha (#2175)
* Problem: docker image tag wrong in dev-setup/bigchaindb.yaml

Solution: change the docker image tag to 2.0.0-alpha in that file

* Problem: version.py needed updating for 2.0 Alpha

Solution: Updated the contents of bigchaindb/version.py for the release of 2.0.0 Alpha
2018-04-03 15:37:46 +02:00
Troy McConaghy
07f03dbd5e Problem: CHANGELOG.md isn't updated for the 2.0 Alpha release (#2159)
* Update CHANGELOG.md for the 2.0 release

* Problem: BigchainDB 2.0 Alpha name & tag wrong in CHANGELOG.md

Solution: Name="BigchainDB 2.0 Alpha" tag="v2.0.0a1"

* Problem: Blogpost link missing & no Known Issues

Solution: Hyperlink the blog post with the missing link and
document the Known Issues.

* Problem: The 2.0 Alpha release date in CHANGELOG.md was wrong

Solution: Changed the release date of 2.0 Alpha to April 3, 2018 in CHANGELOG.md
2018-04-03 15:10:03 +02:00
Vanshdeep Singh
ea8ac4b80e Problem: Event stream api crashing (#2173)
Solution: Fix Exchange initialization
2018-04-03 14:57:44 +02:00
Ahmed Muawia Khan
7683ea00fc Problem: Outdated docker image tags for 2.0.0-alpha release (#2174) 2018-04-03 14:52:30 +02:00
Troy McConaghy
58432807a0 Problem: No link back to Root Docs from Contrib. Docs (#2170)
Solution: Add a link back to the Root Docs from the 'Contributing to BigchainDB' Docs
2018-04-03 12:28:47 +02:00
Troy McConaghy
ef7a276aad Problem: Some links in Quickstart page are broken or wrong (#2171)
Solution: Update the links in the Quickstart page of the BigchainDB Server docs
2018-04-03 12:26:47 +02:00
Troy McConaghy
55fafef577 Problem: There were more broken links to CONTRIBUTING.md (#2172)
Solution: Fix those links by linking directly to the new 'Contributing to BigchainDB' docs
2018-04-03 12:17:11 +02:00
Troy McConaghy
ec5f66ba4f Problem: Issue #2217 is unresolved (#2169)
* Problem: Some docs still say to run MongoDB w/ replica set

Solution: Update the relevant docs

* Problem: A docs mention of upsert-validator wasn't linked to BEP-3.

Solution: Link that docs mention to BEP-3 on GitHub.
2018-04-03 12:14:36 +02:00
vrde
8086f75ec8 Problem: there are no events for invalid blocks (#2163)
Solution: update the documentation to reflect this. I've also removed
the documentation about the event plugin API. That part needs to be
refactored to work properly with BigchainDB 2.0. We can reintroduce it
later.
2018-04-03 12:12:33 +02:00
Vanshdeep Singh
25043bc993 Problem: Block height in event stream is string. (#2167) 2018-04-03 12:08:00 +02:00
Vanshdeep Singh
e4e528e5c4 Problem: Changing validators requires a network restart (#2070)
Solution: Allow nodes to add, update, or remove validators at runtime using a new command. Implements BEP3.
2018-03-29 18:25:26 +02:00
Vanshdeep Singh
0f86e7d368 Problem: Multi-threading not configured (#2165)
* Problem: Multi-threading not configured

Solution: Auto-generate multi-threading config with default threads and workers set to 1

* Problem: Documentation not updated for multi-threading

Solution: Updated necessary docs
2018-03-29 16:26:54 +02:00
Ahmed Muawia Khan
b4401d27e4
Merge pull request #2156 from ttmc/reorder-developer-contrib-process-pages
Problem: The order of the dev contrib docs was weird
2018-03-29 12:01:40 +02:00
Ahmed Muawia Khan
7f2ed58de9
Merge pull request #2164 from muawiakh/update-config
Problem: BigchainDB server configuration causing failure
2018-03-28 20:08:47 +02:00
Ahmed Muawia Khan
933e68bf53 Update some configuration for alpha release containers
- Update bigchaindb server threads/workers
- Configure `debug` log-level for tendermint
2018-03-28 19:46:05 +02:00
Troy McConaghy
3000e52795 Problem: RELEASE_PROCESS.md doesn't follow BEP-1 (#2161)
Solution: Update RELEASE_PROCESS.md to use only the `master` branch
to use Git tags (never branches) to identify new versions.
2018-03-28 15:40:30 +02:00
Troy McConaghy
42f9160f46
Merge pull request #2154 from ttmc/update-marketing-copy
Problem: Some marketing copy (text blurbs) was old
2018-03-28 14:33:55 +02:00
Troy McConaghy
e3be475ebd
Merge pull request #2160 from vrde/reintroduce-dist-and-release
Problem: maintainers are not able to do a release
2018-03-28 14:10:46 +02:00
vrde
3ed3334188
Problem: maintainers are not able to do a release
Solution: reintroduce `make dist` and `make release`
2018-03-28 14:02:18 +02:00
Troy McConaghy
03c8f16475
Merge pull request #2106 from kansi/bep/3/get-validators-api
Get validator set from the node
2018-03-28 11:44:09 +02:00
Troy McConaghy
f71818c837
Merge pull request #2158 from muawiakh/invalid-kube-dns-command
Problem: Invalid command to get kube-dns IP
2018-03-27 20:01:11 +02:00
Ahmed Muawia Khan
5162a0a163 Problem: Invalid command to get kube-dns IP 2018-03-27 19:44:00 +02:00
Ahmed Muawia Khan
3cf921b32d
Merge pull request #2157 from muawiakh/fix-arg-parse
Problem: argument not parsed properly while generating configs
2018-03-27 17:04:26 +02:00
Ahmed Muawia Khan
a047838ec3 Problem: argument not parsed properly while generating configs
Solution: Handle all the positional arguments using curly braces
2018-03-27 16:44:45 +02:00
Troy McConaghy
3d1f341c44 Remove accidentally-pasted URL from docs 2018-03-27 16:41:26 +02:00
Troy McConaghy
8ce48f75a1 Renamed 2 files/pages of notes on running a node 2018-03-27 16:38:58 +02:00
Troy McConaghy
75caf76c62 Problem: The order of the dev contrib docs was weird
Solution: Reorder & relabel those pages
2018-03-27 12:02:33 +02:00
Troy McConaghy
3f2d40f670
Merge pull request #2155 from ttmc/clarify-contributing-docs
Problem: Docs re contributing needed editing & reorg
2018-03-27 10:34:15 +02:00
Troy McConaghy
4fb963d149 Don't include docs fetched-at-build-time in Git repo 2018-03-27 10:27:27 +02:00
Troy McConaghy
3566c97873 Problem: Docs re contributing needed editing & reorg
Solution: Edit & reorg them
2018-03-27 10:18:51 +02:00
Troy McConaghy
dea76f7c91
Merge pull request #2141 from muawiakh/update-dns-server
Problem: Cluster DNS and Health check terminology is incorrect
2018-03-26 16:37:49 +02:00
Ahmed Muawia Khan
a8e68c3706 Replace clusters Web UI to k8s cluster web ui 2018-03-26 16:00:25 +02:00
Ahmed Muawia Khan
339078ae68 Address comments
- remove confusion between NODE-IP<->CLUSTER-IP just replace with IP
- remove confusion between node<->cluster just replace with Kubernetes
  cluster
2018-03-26 15:37:05 +02:00
Troy McConaghy
d1bc21809e Problem: Some marketing copy (text blurbs) was old
Solution: Update the marketing copy!
2018-03-25 13:28:21 +02:00
Troy McConaghy
ff62675c01
THE blockchain database. 2018-03-24 06:01:12 +01:00
Troy McConaghy
1d053bbad8
Two fixes to root docs home page
- Added a button to link to the new "Contributing to BigchainDB" docs
- Changed the opening tag line
2018-03-24 05:40:14 +01:00
Vanshdeep Singh
283f685f07 Problem: FastQuery not working (#2153)
Solution: Fix FastQuery Class
2018-03-23 17:16:00 +01:00
Vanshdeep Singh
cffd68f7cf Problem: Event stream test incomplete (#2152)
Solution: Complete the test by checking connection status returned in the 'result' field
2018-03-23 15:39:47 +01:00
Vanshdeep Singh
358899b3b1 Problem: 'TRANSFER' Transaction fails. (#2151)
Solution: The asset storage and retrieval logic leads to different txn bodies
causing a validation error. Concequently the logic has been simplied.
2018-03-23 15:08:30 +01:00
vrde
4c992198db Problem: version doesn't reflect reality (#2150)
Solution: change the version to 2.0.dev, and add a cool banner.

 mmm     mmmm   mmmm  mmmmmm
   #    "   "# "   "#     #"
   #      mmm"   mmm"    m"
   #        "#     "#   m"
 mm#mm  "mmm#" "mmm#"  m"

 #         mm          mmmm
 # mm     m"#  m   m  m"  "m  m mm
 #"  #   #" #   #m#   #  m #  #"  "
 #   #  #mmm#m  m#m   #    #  #
 #   #      #  m" "m   #mm#   #

        #                        #
  mmm   # mm    mmm    mmm    mmm#
 "   #  #"  #  #"  #  "   #  #" "#
 m"""#  #   #  #""""  m"""#  #   #
 "mm"#  #   #  "#mm"  "mm"#  "#m##

:D
2018-03-23 14:41:15 +01:00
vrde
283b664e6a Problem: there is no way to easily reset the DB (#2149)
Solution: Add a `reset` recipe for our Makefile
2018-03-23 14:39:43 +01:00
vrde
f157096699 Problem: No reason to check the BEP (+typo) (#2144)
Solution: Say why there is a link to the BEP, and fix a typo.
2018-03-23 14:39:15 +01:00
Manolo
0e7adb33d2
Merge pull request #2148 from vrde/ignore-vim-swap-files
Problem: vim swap files are not ignored by git
2018-03-22 17:13:16 +01:00
vrde
7a718f78d2 Update Makefile (#2147)
* Problem: it's difficult to run/test/compile docs

Solution: we already have a nice Makefile, but it's outdated. The idea
is to revamp it and make it easy to use.

* Problem: Makefile is not documented

Solution: Add basic instructions on how to use it in the main README.md

* Problem: can't connect to localhost:9984

Solution: make docker expose 9984 by default, so everyone can connect to
localhost:9984.

* Problem: make clean is TMI

Solution: add `@` to remove commands so we don't output all the details
about the cleaning

* Problem: make clean is too shy

Solution: print a message saying that cleaning went well.
2018-03-22 17:12:39 +01:00
Ahmed Muawia Khan
5676a6e088 Problem: No error message/logs if tendermint container cannot find peers (#2146)
Solution: retry every 30 seconds for a maximum of 10 times.
2018-03-22 17:12:21 +01:00
vrde
ee6170ee88
Problem: vim swap files are not ignored by git
Solution: add patterns to ignore them.
2018-03-22 16:00:39 +01:00
Ahmed Muawia Khan
73555b96ff Unwanted env var BIGCHAINDB_START_TENDERMINT (#2145) 2018-03-21 15:19:00 +01:00
vrde
9cdd46c084
Merging development branch to master! 2018-03-21 14:18:23 +01:00
Troy McConaghy
15c16c5a97 Update setup.py for BigchainDB 2.0 (#2126)
* Update setup.py for BigchainDB 2.0

I took the license name from this list of valid PyPI licenses:
https://jlesquembre.github.io/autopilot/license_list.html

* Remove 'Programming Language :: Python :: 3.6'
from `setup.py` since we actually use features from Python 3.6.

* Changed dev status back to 3 - Alpha for now
2018-03-21 14:03:15 +01:00
Ahmed Muawia Khan
9be68c972d Problem: standardize docker-compose workflows (#2130)
- Standardize docker-compose workflow
- Change docker-compose version to 2.1
  - why one might ask? because compose version
    3.0 does not support depends on and inherits
    like we want to and is more aimed towards migration to using
    `docker stack`, for our current strategy `2.1` is a better choice.
- change `bdb` service `bigchaindb` service
  - why? Introduced a new proxy service `bdb` which is just a dummy
    `busybox` image.
    - why? because this ensure via healthcheck of bigchaindb that BigchainDB
      has started properly and makes a `curl` to ensure HTTP API server is up
      and running.
      - why? Because we have had scenarios where BigchainDB is not started
        via docker compose and user has to check out the logs to find out what
        the problem might be. This ensure that bigchaindb is up and running.
- Does this change deployment workflow? No.
  - The only thing change is that if you want to run commands inside a bigchaindb
    container e.g. `pytest` now you have to run the following command:
    `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb`
     as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb`
- Remove env variable `BIGCHAINDB_START_TENDERMINT`
- Remove TENDERMINT_INTEGRATION.rst and move to the new docs
- Change mdb -> mongodb because the other services were named with
  full name.
- Add example to run specific tests or from a file
- Update config.toml for tendermint to use `bigchaindb` as proxy app
  instead of `bdb`
- Remove `network` directory because it is deprecated
- Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
Ahmed Muawia Khan
cf543d8f41 Problem: docs build failing
Solution: Fix docs build
2018-03-21 11:15:25 +01:00
Vanshdeep Singh
ef26220c7f Problem: Docs for BEP#3 implementation not updated (#2123)
* Problem: Docs for BEP#3 implementation not updated

Solutions: Update docs for #2070 and #2106

* Problem: 'Validator update' docs language not clear

Solution: Re-write the documentation which explains when validators are updated

* Problem: Typos and BEP reference missing

Solution: Fix typos and add BEP reference
2018-03-21 09:23:08 +01:00
Ahmed Muawia Khan
757b4fc14c Remove cluster-dns 2018-03-20 19:34:01 +01:00
Troy McConaghy
59abb358f8
Merge pull request #2133 from bigchaindb/update-contributing-md
Problem: CONTRIBUTING.MD and the 2 GitHub templates were old
2018-03-17 08:49:20 +01:00
Shahbaz Nazir
e8e02cac50 Problem: Bigchaindb startup sometimes fails due genesis block creation during init (#2129)
* removing GENESIS transaction type
* remove GENESIS transaction schema
* all blocks are same in the eyes of GOD no checks needed for genesis blocks
2018-03-16 16:19:12 +01:00
kansi
5b3fab666d Problem: Unkown exceptions being handled
Solution: Handle only known exceptions
2018-03-16 11:47:15 +05:30
Troy McConaghy
c047487523
Merge pull request #2119 from bigchaindb/new-docs-set-on-contributing
New docs set on "Contributing to BigchainDB"
2018-03-15 20:36:58 +01:00
Ahmed Muawia Khan
0125368d8e Problem: K8s deployment with Access Token Authorization expects Access Token for GET calls and others (#2134)
* Fix for access token authorization for GET calls

- Naming inconsistency for cluster-fqdn causing issues
- Change cluster-frontend-port to node-frontend-port

* Change hardcoded 9984 to configurable
2018-03-15 16:20:15 +01:00
Troy McConaghy
24119a1b73 Problem: Was getting Shared Workspace Protocol from old location
Solution: Get it from new location in bigchaindb/BEPs
2018-03-15 13:44:22 +01:00
Vanshdeep Singh
8c32ae798b Problem: UTXO implementation unfinished for release. (#2132)
Solution: Rollback UTXO for the alpha release.
2018-03-14 17:58:05 +01:00
Troy McConaghy
c5054e7239 Problem: Unclear how Travis and Codecov get configured
Solution: Document where Travis and Codecov look for configuration settings and setup.
2018-03-14 13:06:52 +01:00
Troy McConaghy
b9d500ac09 Problem: CONTRIBUTING.MD and the 2 GitHub templates were old
Solution: Update those three files to reflect the new way we do things
2018-03-14 11:22:39 +01:00
Troy McConaghy
f54090af6d Cleanup 'Ways to Contribute' even more 2018-03-14 01:40:05 +01:00
Troy McConaghy
d4e8f415a1 Add JS and Python style guides to policies 2018-03-14 00:48:10 +01:00
Troy McConaghy
8f4bc46e8b
Typo fix good grief 2018-03-14 00:24:29 +01:00
Troy McConaghy
d8893c11e7
Merge pull request #2131 from bigchaindb/quick-fix-to-release-process-for-now
Add note at top how this is old, will be updated
2018-03-14 00:20:41 +01:00
Troy McConaghy
5caa49e945
Add note at top how this is old, will be updated
A more complete fix will have to be done later. This is what we can do for now.
2018-03-14 00:19:02 +01:00
vrde
617f0ba94b Problem: exchange pubsub doesn't start on boot (#2079)
Solution: start it on boot.
2018-03-12 16:48:03 +01:00
Troy McConaghy
0e29517145 Revisions to: Contributing to BigchainDB (docs) 2018-03-12 14:23:49 +01:00
Ahmed Muawia Khan
f537d061d5 Problem: Migrate-CLI changes were reverted because of travis changes (#2121)
* Testing tendermint docker compose for travis

* Typo tendermint*

* Re-do migrate cli changes

* don't skip event stream test

* Fix flake8 and unskip a test skipped during dev

* Revert styling changes made from editor

* skip a failing test case which was already disabled

* Remove reference to 'keypair' in commands
2018-03-09 13:08:37 +01:00
Troy McConaghy
5283c32abb
Under den Linden -> Unter 2018-03-07 12:40:12 +01:00
Troy McConaghy
9180d00282
codding -> coding 2018-03-07 12:37:08 +01:00
Troy McConaghy
cf53ce8d32 First draft of new docset on Contributing to BigchainDB 2018-03-06 23:55:18 +01:00
Ahmed Muawia Khan
60f2ccaead Revert "Migrate cli for tendermint integration" 2018-03-05 15:49:55 +01:00
Troy McConaghy
81c6975501
Merge pull request #2071 from bigchaindb/text-edits-in-http-api-docs
Copy-edited the HTTP API docs
2018-03-05 12:31:56 +01:00
Troy McConaghy
c2fd9e7b7b
Merge pull request #2113 from bigchaindb/rm-stand-alone
Problem: The node-on-kubernetes docs aren't just for a "stand-alone" node
2018-03-05 12:28:34 +01:00
Troy McConaghy
6ee8224491
Merge pull request #2112 from bigchaindb/revise-azure-acs-page
Problem: User gets error about "Service Principal" when they try to deploy a k8s cluster on Azure
2018-03-05 12:27:44 +01:00
Troy McConaghy
cfdb558729
Merge pull request #2111 from bigchaindb/revise-workflow-page
Edited the "Overview" page in Production Deployment Template for clarity
2018-03-05 12:27:29 +01:00
Ahmed Muawia Khan
2a3acecdff
Merge pull request #2108 from bigchaindb/uncomment-storageaccount-in-tendermint-sc
Problem: Inconsistent treatment of storageAccount across two storageClasses
2018-03-05 11:38:36 +01:00
Troy McConaghy
09083f41ef
Merge pull request #2082 from vrde/do-not-start-tendermint-by-default
Problem: tendermint is started by default
2018-03-04 19:53:34 +01:00
Troy McConaghy
7acdb1a565
Problem: The docs aren't just for a "stand-alone" node
Solution: Remove "stand-alone"
2018-03-04 19:34:18 +01:00
Troy McConaghy
5f206acc63 Revised docs re az acs create 2018-03-04 14:36:55 +01:00
Troy McConaghy
95b4647a22 Added instructions for including secret token header in POST requests 2018-03-03 19:15:01 +01:00
Troy McConaghy
74d86cc83e Add example secret token 2018-03-03 15:02:45 +01:00
Troy McConaghy
2304f8cd10 Revisions to Overview page in prod dep. template 2018-03-03 14:55:31 +01:00
Sylvain Bellemare
802cc73d33 Problem: import order does not follow pep8
Solution: follow pep8
2018-03-01 17:50:20 +01:00
Sylvain Bellemare
56dfd9bab0 Problem: represent utxoset state as a hash
Solution: create a merkle tree out of the utxoset and compute its merkle
root
2018-03-01 17:50:20 +01:00
Sylvain Bellemare
2d2182dd19 Problem: unhandled error when deleting zero utxo
Solution: only execute the query if *unspent_outputs is not empty
2018-03-01 15:11:58 +01:00
Sylvain Bellemare
aaec67724a Problem: unhandled error when storing zero utxo
Solution: only execute the query if *unspent_outputs is not empty
2018-03-01 15:11:58 +01:00
Sylvain Bellemare
c85c664215 Problem: fixture with no asset fails
Solution: instantiate the transaction with a dummy asset
2018-03-01 15:11:58 +01:00
Sylvain Bellemare
967d5727e2 Problem: store_metadata was renamed
Solution: perform required update

Note: see #2034
2018-03-01 15:11:58 +01:00
Sylvain Bellemare
51d4f0f2d9 Problem: utxoset needs to be updated
Solution: update utxoset via store_transaction
2018-03-01 15:11:58 +01:00
Ahmed Muawia Khan
00ec69a4bd
Merge pull request #1976 from bigchaindb/proposal/migrate-cli
Proposal: Migrate cli for Tendermint
2018-02-28 14:46:55 +01:00
Ahmed Muawia Khan
5f06ad5493
Merge pull request #2092 from muawiakh/migrate-cli
Migrate cli for tendermint integration
2018-02-28 14:44:43 +01:00
Ahmed Muawia Khan
9cb84b165f
Merge pull request #2093 from muawiakh/migrate-cli-docs
Migrate CLI documentation
2018-02-28 14:44:17 +01:00
Troy McConaghy
5154444cb2
Uncomment storageAccount in tendermint-sc.yaml
In pull request #2107, the `storageAccount` was uncommented in `mongo-sc.yaml`

This pull request does the same in `tendermint-sc.yaml`
2018-02-28 13:32:02 +01:00
vrde
be297f8b4f
Problem: tendermint is an external service
Solution: Do not start tendermint on boot. It's up to the user to decide
how to start tendermint.
2018-02-28 13:13:02 +01:00
Troy McConaghy
36007ec5af
Merge pull request #2107 from muawiakh/update-prod-template-docs
Problem: Production deployment template was not updated after v1.0 automation
2018-02-28 11:04:13 +01:00
Ahmed Muawia Khan
98c939bd29 use mdb-instance-0 as default name for configuring users 2018-02-27 13:35:20 +01:00
Ahmed Muawia Khan
4c6ac6bd19 Update production deployment template after v1 automation 2018-02-27 13:26:51 +01:00
kansi
610e6f00f2 Problem: fake8 errors for handling exceptions
Solution: Handle fake8 error for exception handling by using base Exception class
2018-02-27 13:47:05 +05:30
kansi
375cd0b499 Problem: No tests for GET /api/v1/validators
Solution: Add tests for the same
2018-02-27 13:31:44 +05:30
kansi
2a20e7042e Problem: Get validators api doesn't exist
Solution: Add `GET /api/v1/validators` endpoint
2018-02-27 13:30:56 +05:30
Ahmed Muawia Khan
b752b4cbf2
Merge pull request #2105 from shahbazn/k8s-config-automation-script
Problem: bugs in k8s automation
2018-02-27 02:51:19 +01:00
Ahmed Muawia Khan
a250b90727
Merge pull request #2104 from bigchaindb/revise-beginning-of-overview
Revised intro of Overview page in prod dep template docs
2018-02-27 02:46:24 +01:00
Shahbaz Nazir
517ece3be5 uncomment
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-27 02:45:27 +01:00
Shahbaz Nazir
dc423d80ef Merge branch 'k8s-config-automation-script' of github.com:shahbazn/bigchaindb into k8s-config-automation-script 2018-02-27 02:41:45 +01:00
Shahbaz Nazir
d69c75ee93 fixes for k8s deployment automation
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-27 02:40:59 +01:00
Shahbaz Nazir
4b06378bbf fix nginx https issues
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-27 02:40:59 +01:00
Shahbaz Nazir
287ab88012 fixes for k8s deployment automation
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-27 02:29:44 +01:00
Troy McConaghy
3d0720ce42 Revised intro of Overview page in prod dep template docs 2018-02-27 00:37:59 +01:00
Shahbaz Nazir
e68c77338e fix nginx https issues
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-26 19:46:21 +01:00
Shahbaz Nazir
582025ba3d
Problem: nginx k8s deployment missing parameters (#2102) 2018-02-26 19:11:28 +01:00
Ahmed Muawia Khan
d0874ccf9a
Merge pull request #2101 from muawiakh/mongodb-container-update
Add support for optional users in MongoDB user creation
2018-02-26 18:42:42 +01:00
Shahbaz Nazir
334d4769ca nginx instance fixes
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-26 18:39:02 +01:00
Shahbaz Nazir
5a4378dbb5
fixes for deployment script (#2100) 2018-02-26 18:00:04 +01:00
Ahmed Muawia Khan
8835fd5fd7 Add support for optional users in MongoDB user creation 2018-02-26 17:54:07 +01:00
Shahbaz Nazir
dc447249f5 fixes for deployment script
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-02-26 17:36:42 +01:00
Sylvain Bellemare
06cbd9e2de Problem: docker-compose.docs.yml it outdated
It does not use the Dockerfile for the localmongodb/tendermint backends.

Solution: Use ./compose/bigchaindb-server/Dockerfile
2018-02-26 16:26:40 +01:00
Sylvain Bellemare
f32649d802 Problem: docker-compose.docs.yml version is 2
Solution: Update the version to 3 (latest)
2018-02-26 16:26:40 +01:00
Sylvain Bellemare
12f603b8d2 Problem: There are no docs for the tendermint integration API
Solution: Add docs for the tendermint integration in Appendices for now.
2018-02-26 16:26:40 +01:00
Shahbaz Nazir
c2e9dd6e1c
Problem: Automate k8s deployment configs & secretes (#2096)
We manually add all the required configurations and secretes in config-map.yaml and secret.yaml. There is a need for a wrapper script which takes these generated mongodb certs and also process https certificates and populates config-map.yaml and secret.yaml
2018-02-26 16:25:13 +01:00
Ahmed Muawia Khan
3c290d64a5 re-add f-string to web stream 2018-02-26 15:42:17 +01:00
Ahmed Muawia Khan
847183a7d8
Merge pull request #2099 from muawiakh/check-kubectl-installed
Check if kubectl is installed otherwise exit
2018-02-26 15:28:12 +01:00
Ahmed Muawia Khan
d85396b220 Check if kubectl is installed otherwise exit 2018-02-26 15:07:27 +01:00
Troy McConaghy
6d27cbe868
Merge pull request #2095 from muawiakh/automate-mdb-user-creation
Automate MongoDB user creation for prod/test deployments
2018-02-26 14:58:50 +01:00
Ahmed Muawia Khan
3c09de97b0 remove redundant variable assignment 2018-02-26 14:54:34 +01:00
Ahmed Muawia Khan
7cea7298f0 Update mongodb user configuration
- Update docs for azure cluster deployment template
- Update entrypoint for MongoDB to handle user configuration
  more efficiently
- remove `use admin` in js file, that is an invalid format
2018-02-26 14:45:21 +01:00
Ahmed Muawia Khan
d977753831 Automate MongoDB user creation for prod/test deployments
- Currently, we had to manually log into the MongoDB container
  and create users, this change will configure the relevant users
  from a single script `configure_mdb.sh`
- Improvements can be done but keeping it minimal for the workshop
2018-02-26 03:37:43 +01:00
Troy McConaghy
86e7b2a881 Some minor copy-editing 2018-02-25 18:05:18 +01:00
Shahbaz Nazir
0ddfc62e3b
Problem: No authorization mode without threescale (#2088)
Problem
The current production deployment template uses 3scale to ensure that POST requests to the network (from anyone) only get through if they come from a client with an account (app_id and app_key).

A private network wants to launch so that all HTTP requests (POST and GET) sent to the nodes in the network get be dropped unless they come from a small set of known (and unchanging) clients/sources. They don't need 3scale. They will want a modified version of the production deployment template.

Solution
Generate a special HTTP header and share it with all the known clients/sources.
Have a single NGINX in each node which checks for that HTTP header value. If it's present, let the request pass through to the network. (HTTP headers are encrypted if HTTPS is used.)
Are there other simpler or better options?
2018-02-23 16:00:36 +01:00
Ahmed Muawia Khan
8fd50b23c8 Re-add travis changes
- This actually follows one concern on PR.
2018-02-23 15:33:32 +01:00
Ahmed Muawia Khan
8bfb903d4e [Chandler fix]: Bing -> Bind 2018-02-23 15:31:30 +01:00
Ahmed Muawia Khan
624d4e7459 Revert travis changes
- Follow one concern one PR.
2018-02-23 15:28:35 +01:00
Ahmed Muawia Khan
8e8e328205 Migrate CLI documentation
- Remove documentation for CLI commands that are not needed with
  Tendermint integration.
2018-02-23 14:53:28 +01:00
Ahmed Muawia Khan
d0089ca373 Fixing flake8 2018-02-23 14:43:14 +01:00
Vanshdeep Singh
cdec60a7c0 Rollback crash recovery mechanism (#2091) 2018-02-23 14:35:18 +01:00
Ahmed Muawia Khan
5cea9c28bf Migrate CLI for tendermint integration
- Remove commands that were not required.
  - export-my-pubkey
  - set-shards
  - set-replicas
  - add-replicas
  - remove-replicas
- Update bigchaindb --help, usage description
- Re-enable tests
- Update docker-compose.travis.yml and Dockerfile for travis
  because some env variables are not needed
2018-02-22 21:48:42 +01:00
Troy McConaghy
497e1039ef
Merge branch 'tendermint' into text-edits-in-http-api-docs 2018-02-22 21:02:33 +01:00
Ahmed Muawia Khan
ecee564d21 Remove create the node keypair from bigchaindb configure --help 2018-02-22 16:04:43 +01:00
Ahmed Muawia Khan
8ce01bf4ce Update minor formatting 2018-02-22 15:26:15 +01:00
Ahmed Muawia Khan
7f50003303 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.
2018-02-22 12:54:26 +01:00
Troy McConaghy
e6c77d5fcd
Merge pull request #2086 from bigchaindb/helpful-response-to-votes-endpoint
Make votes endpoint return 404 and a helpful message
2018-02-22 12:49:27 +01:00
Troy McConaghy
303c951137 Fixed flake8 errors 2018-02-22 12:41:20 +01:00
Ahmed Muawia Khan
96db5b9f12
Merge pull request #2084 from bigchaindb/update-bdb-docker-image-k8s
Update docker images and Dockerfiles
2018-02-22 12:23:31 +01:00
Troy McConaghy
8e4a2398a7 Make votes endpoint return 404 & helpful msg 2018-02-22 12:02:00 +01:00
Ahmed Muawia Khan
93e2b3bb4c Update imagePullPolicy for unstable images
- Update imagePullPolicy from IfNotPresent to Always
  for all unstable images we are using in k8s template,
  because those images are updated regularly, we will
  keep it unstable until the official release.
- Use Tendermint v0.13 as base docker image, since our current
  integration is based out of v0.13
2018-02-22 11:56:58 +01:00
Shahbaz Nazir
a782fa4635
Hardcode static ports for k8s deployment (#2080)
Description
Currently we manually configure ports in deployment and service files for k8s deployment e.g here. Instead these ports should be constant since these are always the same for each deployment

Issues This PR Fixes
Fixes #2077
2018-02-22 11:52:41 +01:00
Troy McConaghy
1aece3c10d
Merge pull request #2068 from bigchaindb/remove-refs-to-whitepaper-in-tendermint-branch
Remove all refs/links to whitepaper in tendermint branch
2018-02-21 22:04:29 +01:00
Troy McConaghy
77b70c3821
Merge pull request #2067 from bigchaindb/remove-refs-to-whitepaper-in-master
Remove whitepaper refs/links from the master branch
2018-02-21 22:04:09 +01:00
Ahmed Muawia Khan
a8a10edf0e Update Dockerfiles and remove tmt references 2018-02-21 20:31:53 +01:00
Ahmed Muawia Khan
8e6b4332b0 Update mongodb base image 2018-02-21 20:22:38 +01:00
Ahmed Muawia Khan
2978caaee6 Update images used by yaml files
- Using tag `unstable` currently, until BDB+Tendermint is released
2018-02-21 20:17:24 +01:00
Ahmed Muawia Khan
13e750705e
Merge pull request #2083 from bigchaindb/cert-gen-script
Certificate generation script for k8s deployment
2018-02-21 20:08:21 +01:00
Ahmed Muawia Khan
53019ff02a
Merge pull request #1992 from bigchaindb/tendermint-docs-k8s-dep
Template for BigchainDB + Tendermint Kubernetes Deployment
2018-02-21 19:23:14 +01:00
Ahmed Muawia Khan
55f212d885 Certificate generation script for k8s deployment 2018-02-21 19:18:24 +01:00
vrde
14d523efd5 Problem: processes don't have an intelligible name (#2078)
Solution: when a process starts, update the "process title" as well.
2018-02-21 17:54:50 +01:00
Ahmed Muawia Khan
5669514ee7 Fix label docs 2018-02-21 12:13:45 +01:00
Ahmed Muawia Khan
d5f45d4094
Merge pull request #1985 from bigchaindb/tendermint-k8s-dep
Deployment of Tendermint + BigchainDB cluster
2018-02-21 11:48:37 +01:00
Ahmed Muawia Khan
669b2d586b Merge branch 'tendermint' into tendermint-docs-k8s-dep 2018-02-21 11:48:02 +01:00
Ahmed Muawia Khan
df485d0983 Rename docker image tags and names 2018-02-21 11:38:24 +01:00
Ahmed Muawia Khan
de05e5bc3e Merge branch 'tendermint' into tendermint-k8s-dep 2018-02-21 11:32:45 +01:00
Vanshdeep Singh
5bfa8e29d8 Crash recovery mechanism (#2045)
* Crash recovery mechanism

* Propogate exception

* Added docs and crash receovery during block write

* Fix flake8 issue

* Remove approach 1 for crash recovery, recover db on 'bigchiandb start'

* Fix CI build issues

* Remove documentation
2018-02-21 10:50:12 +01:00
Troy McConaghy
55c1509362
Merge pull request #2076 from bigchaindb/patch-master-with-pr-2075-commit
Same as PR #2075 but for master branch
2018-02-20 15:03:41 +01:00
Troy McConaghy
15ce6e99f6 Fix the requirements.txt file for docs/server, update README.md 2018-02-20 14:13:28 +01:00
Troy McConaghy
58c5498d35
Merge pull request #2075 from bigchaindb/fix-issue-2072-http-api-examples
Resolve issue #2072
2018-02-20 13:11:07 +01:00
Troy McConaghy
c5fdaf24ad Fix the requirements.txt file for docs/server, update README.md 2018-02-20 12:58:23 +01:00
Troy McConaghy
8fb0682868
Merge pull request #2063 from bigchaindb/fix-common-schema-readme-md
Some edits to common/schema/README.md
2018-02-20 09:37:50 +01:00
Troy McConaghy
5c783be546
Merge branch 'tendermint' into text-edits-in-http-api-docs 2018-02-19 16:45:03 +01:00
Troy McConaghy
e1bdd41030 Copy-edited the HTTP API docs 2018-02-19 16:33:46 +01:00
Troy McConaghy
0ffcb36b7e
Merge pull request #2065 from bigchaindb/rm-docs-about-votes
Updated (almost) all docs regarding "votes" once Tendermint integrated
2018-02-19 15:21:05 +01:00
Troy McConaghy
5af6c7b7a3
Merge pull request #2069 from bigchaindb/remove-all-statuses-endpoints-for-realz
Remove all code for all /statuses endpoints
2018-02-19 12:31:37 +01:00
Troy McConaghy
1b6d0adc01 removed code for all /statuses endpoints 2018-02-19 12:04:10 +01:00
Troy McConaghy
8b8f137463 Remove all refs/links to whitepaper in tendermint branch 2018-02-19 11:06:06 +01:00
Troy McConaghy
0ae08ad31e Remove whitepaper refs/links from master branch 2018-02-19 10:56:39 +01:00
Troy McConaghy
7f94242f85 Update all docs re/ votes when Tendermint integrated 2018-02-16 16:24:44 +01:00
Troy McConaghy
7a292ba6ec Edits to the common/schema/README.md file 2018-02-16 15:48:12 +01:00
Troy McConaghy
37150c4849
Merge pull request #2059 from bigchaindb/master-branch-equivalent-of-pr2056
Same as PR #2056 but merging into master branch
2018-02-16 15:28:23 +01:00
Troy McConaghy
96f30da875
Merge pull request #2056 from bigchaindb/rm-refs-to-transaction-cli-tool
Problem: Transaction CLI Tool deprecated but linked from some docs
2018-02-16 15:28:10 +01:00
Troy McConaghy
a3c49cc336
Merge pull request #2062 from bigchaindb/docs/2036/three-http-api-endpoints-gone
Remove the HTTP API docs for the /statuses & /votes endpoints
2018-02-16 15:20:57 +01:00
Troy McConaghy
6982dfbe79 Put back the accidentally-removed post-tx-response 2018-02-16 14:54:20 +01:00
Troy McConaghy
7c3d7f4f63 Tidy up some grammar and Tendermint refs 2018-02-16 14:53:30 +01:00
Troy McConaghy
0139e53ab4 rm code to gen example HTTP stuff for /statuses & /votes 2018-02-16 14:35:35 +01:00
Troy McConaghy
9ef2271a5d In HTTP API docs, removed all /statuses & /votes endpoints 2018-02-16 14:31:26 +01:00
kansi
27865d848c Merge branch 'iss/2060/remove-post-txn-resp-header' into tendermint 2018-02-16 18:54:18 +05:30
kansi
6cf86be033 Remove location header from post txn response 2018-02-16 18:42:06 +05:30
Troy McConaghy
0337a4e2eb Remove 2 refs/links to the deprecated Transaction CLI tool 2018-02-16 10:00:46 +01:00
Sylvain Bellemare
1f537b1557 Problem: to get tx utxoset & inputs is cumbersome (#2055)
Solution: add properties to more easily get the utxoset and inputs of a
transaction
2018-02-15 18:23:29 +01:00
Troy McConaghy
46a2909c4d Remove 2 refs/links to the deprecated Transaction CLI tool 2018-02-15 17:34:51 +01:00
Sylvain Bellemare
3542d01893 Update tx version (#2054)
* Problem: common/test_transaction.py is excluded

Solution: add marker to file

* Problem: fixture tx version is outdated

Solution: update the version
2018-02-15 16:19:13 +01:00
Troy McConaghy
63bd698b21 changed constructed/allowed tx 'version' from '1.0' to '2.0' (#2048)
- Created three new JSON Schema files for the v2.0 transaction schema, based on the v1.0 files. The only change is the allowed value of version (from "^1\\.0$" to "^2\\.0$").
- I didn't delete the v1.0 JSON Schema files because we might want those some day (to validate old transactions).
- Updated the __init__.py in the directory with the JSON Schema files so that it now uses the version 2.0 JSON Schema files.
- Updated all relevant tests. I only found one, in tests/validation/test_transaction_structure.py
- Updated VERSION in common/transaction.py
- Checked to make sure the example HTTP API docs show "version" with value "2.0". They do.
- Updated the docs page about "The Transaction Model". It just points to the IPDB Transaction Spec.
- If someone submits a transaction with "version" having value "1.0" then the error message comes from the JSON Schema checker.
2018-02-15 11:07:16 +01:00
vrde
cd6095e854 Problem: test suite doesn't pick up env vars
Solution: call `env_config` from the configuration fixture
2018-02-14 16:43:09 +01:00
vrde
254035150d Problem: default config uses env vars
Solution: this is managed by the function
`bigchaindb.config_utils::env_config`, we don't need to call
`os.environ.get` for each value.
2018-02-14 16:43:09 +01:00
vrde
bf2a1c6a60 Problem: older backends are no longer supported
Solution: when running the command `bigchaindb configure`, configure for
`localmongodb` only.
2018-02-14 16:43:09 +01:00
Sylvain Bellemare
161ccdda5d Implement UTXO set backend (#2033) 2018-02-14 15:37:19 +01:00
Troy McConaghy
8bd39439f2
Merge pull request #2052 from bigchaindb/bug/2049/fix-readthedocs-build
Add yml config for readthedocs build
2018-02-14 15:18:25 +01:00
kansi
e9521aad44 Added build yml for readthedocs 2018-02-14 19:40:36 +05:30
kansi
f483f9c97a Add build config for docs 2018-02-14 14:32:44 +01:00
vrde
55073366ec Problem: new env vars are not managed by the conf
Solution: add `BIGCHAINDB_` to new tendermint vars. Reference:
https://github.com/bigchaindb/bigchaindb/pull/2039#discussion_r167880795
2018-02-14 12:18:59 +01:00
Sylvain Bellemare
6e3f9e8f54 Docker compose for travis (#2039)
* Replace double quotes with single quotes (flake8)

* Test event subscriber to tendermint via ws

* Problem: Tendermint is not part of stack for CI

Solution: Add Tendermint to stack for CI. For simplicity's sake
docker-compose is being used.
2018-02-14 10:19:04 +01:00
vrde
9d720f6d45 Problem: statsd configuration is no longer supported
Solution: remove monitoring code, completes #1138
2018-02-13 14:36:03 +01:00
vrde
4157244df7 Problem: statsd config is no longer supported
Solution: remove monitoring code, completes #1138
2018-02-13 14:35:47 +01:00
Sylvain Bellemare
c35e37be64 Problem: Unpublished ports with docker-compose
Solution: Publish the ports.

Closes #2041.
2018-02-13 12:08:19 +01:00
Sylvain Bellemare
b8a33e0f30 Problem: tmdata tracked files change in dev env
Solution: Only track config.toml and generate the other files such as
genesis.json and priv_validator.json in the container via `tendermint
init`

Related issue: #1997
2018-02-13 12:02:34 +01:00
Sylvain Bellemare
87d74a704b Problem: .pytest_cache is tracked by git
Solution: Put .pytest_cache/ in the .gitignore file.
2018-02-12 18:29:22 +01:00
muawiakh
a4ac9cf308 Address comments
- Update docs for better readability
2018-02-12 14:35:02 +01:00
Troy McConaghy
e7b65410dd
Merge pull request #1993 from bigchaindb/update-ipdb-tx-spec-url-in-docs
Updated all refs to the IPDB Transaction Spec and its URL
2018-02-10 16:52:26 +01:00
Troy McConaghy
ee997359b8
Merge branch 'tendermint' into update-ipdb-tx-spec-url-in-docs 2018-02-09 22:10:53 +01:00
Sylvain Bellemare
1611e6e04b Mount other volumes for docker-compose dev 2018-02-08 16:48:04 +01:00
muawiakh
320e09dee3 Resolved merge conflicts again 2018-02-08 15:57:37 +01:00
Ahmed Muawia Khan
1f172b1b3c
Merge pull request #2029 from bigchaindb/vagrant-fix-ubuntu-xenial
Fixing Vagrant tutorial
2018-02-08 15:57:05 +01:00
muawiakh
d6a7500abc Resolved merge conflicts with tendermint branch 2018-02-08 15:52:31 +01:00
muawiakh
b68c0ccbc0 Addressing comments and removing *-tm* or *-tmt* references 2018-02-08 15:48:45 +01:00
Sylvain Bellemare
5d0463282b Add tendermint marker to pytest.ini 2018-02-08 15:41:44 +01:00
Sylvain Bellemare
cc069fa640 Add db_context fixture 2018-02-08 15:26:50 +01:00
Sylvain Bellemare
b2584dd0fa Order imports as per pep 8 2018-02-08 15:19:47 +01:00
Troy McConaghy
1ba9233310 tendermint-instance-? --> tm-instance-? 2018-02-08 14:52:45 +01:00
muawiakh
1df86234d6 Fix Vagrant tutorial 2018-02-08 14:52:37 +01:00
Vanshdeep Singh
fa33fc26af Integrate get block with transaction id api (#2021)
* Integrate api, get block with transaction id

* Fixed docs and docstrings

* Fix docs

* Remove status from tendermint, fix mongo query
2018-02-08 14:32:21 +01:00
Troy McConaghy
8945dd2332 Re-org headings in Prod. Dep. Template - Overview page 2018-02-08 14:20:50 +01:00
muawiakh
6052043a03 Remove unwanted references 2018-02-08 12:17:40 +01:00
muawiakh
03219a9371 Remove references from BigchainDB 1.x deployment strategy
- Remove references from existing deployment model
- Address comments, fix typos, minor structure changes.
2018-02-08 11:54:57 +01:00
Ahmed Muawia Khan
f88ce7c1eb
Merge pull request #1877 from bigchaindb/template-spec
Add guidelines for new features in BigchainDB
2018-02-06 12:40:05 +01:00
Ahmed Muawia Khan
b4acee0425
Merge pull request #2019 from bigchaindb/storage-engine-fix
Fix storage-engine-cache size issue
2018-02-06 11:51:27 +01:00
muawiakh
75e90c964f Merge branch 'master' into storage-engine-fix 2018-02-05 18:06:25 +01:00
muawiakh
8477392abd Merge branch 'master' into template-spec 2018-02-05 18:03:55 +01:00
Vanshdeep Singh
a7ed8cf4cb Write transactions on commit (#2017)
* Write transacitons on commit

* Fix docs strings, lazy check for duplicates
2018-02-02 14:40:24 +01:00
Ahmed Muawia Khan
4147e59edb
Merge pull request #2023 from sbellem/update-ssl-certs-for-tests
Update SSL certs and keys for tests
2018-02-02 12:03:12 +01:00
Sylvain Bellemare
5cec22d659
Update SSL certs and keys for tests
fixes #2015
2018-02-01 17:24:52 +01:00
muawiakh
1a0c165487 Address comments
- Keep only tendermint specific files, remove reference to older
  deployment strategy
- Update Bigchaindb Dockerfile
2018-02-01 13:02:39 +01:00
Troy McConaghy
402abe72e8
Merge pull request #2020 from bigchaindb/update-main-license-to-apache-v2
Updated main code license to Apache v2 in LICENSES.md
2018-01-31 16:30:33 +01:00
Troy McConaghy
2759320ea3 Updated main code license to Apache v2 in LICENSES.md 2018-01-31 16:15:16 +01:00
muawiakh
6e055c642c Fix storage-engine-cache size issue
- Allow for empty values
- Allow if you don't specify the --storage-engine-cache-size
2018-01-31 15:46:39 +01:00
Vanshdeep Singh
e25d365828 Integrate blocks API (#1970)
* Integrate blocks api

* Update docs

* Fix docs

* Fixed mismatch between code and documentation

* Fixed docs
2018-01-31 14:42:41 +01:00
muawiakh
6a8cb99597 Merge branch 'master' into template-spec 2018-01-30 16:41:01 +01:00
muawiakh
1048d6a170 Update document reference in issue_template 2018-01-30 14:24:50 +01:00
muawiakh
d9f927bcd9 Update minor typos and directory references 2018-01-30 14:21:52 +01:00
vrde
c156d0bfe8
Merge pull request #1996 from bigchaindb/1995-mode-API
add mode parameter to transaction endpoint, fixes #1995
2018-01-29 12:00:32 +01:00
Troy McConaghy
328f2ed193 Some minor copy-editing 2018-01-24 16:43:35 +01:00
muawiakh
0216ffd1e8 minor change
- update formatting in example spec
2018-01-24 13:41:07 +01:00
muawiakh
407935c982 Move bigchaindb/docs/specs to bigchaindb/proposals
- Use *.md for example spec instead of *.rst
2018-01-24 13:32:50 +01:00
codegeschrei
e74fb096fc requested changes 2018-01-24 11:59:50 +01:00
codegeschrei
ff50d243bc Merge branch 'tendermint' into 1995-mode-API 2018-01-24 11:58:13 +01:00
vrde
73ba3f5eb0
Merge pull request #1967 from sbellem/measure-branch-coverage
Closes #1736
2018-01-23 17:28:33 +01:00
muawiakh
0016c86e0b Address comments
- Remove release process changes
- Specs per release will be tracked as part of a different PR
  and proposal
2018-01-17 10:43:35 +01:00
Sylvain Bellemare
8c600e7137 Pin tendermint to 0.13 2018-01-16 14:18:52 +01:00
Sylvain Bellemare
077b7d3589
Merge branch 'master' of github.com:bigchaindb/bigchaindb into tendermint 2018-01-16 12:07:34 +01:00
Sylvain Bellemare
afda1686e6 Upgrade aiohttp
related to https://github.com/aio-libs/aiohttp/pull/2667
2018-01-16 12:05:47 +01:00
Sylvain Bellemare
d2f1282333
Merge branch 'master' of github.com:bigchaindb/bigchaindb into tendermint 2018-01-15 19:29:35 +01:00
Sylvain Bellemare
9bed8f363a Fixes #1930 2018-01-15 19:08:58 +01:00
muawiakh
ab9e1f71c7 Pin yarl version to 0.18.* in setup.py
- We need to pin this dependency because version 1.0.0 of yarl
  does not expose `unquote` and if we do not pin it, the latest
  version >=1.*.* is downloaded and `aiohttp` expects it.
- This can also be fixed on `aiohttp`, but meanwhile :)
2018-01-15 18:55:09 +01:00
codegeschrei
1d99d6e8a8 requested changes 2018-01-15 17:12:17 +01:00
Sylvain Bellemare
2d0e83657e Parametrize host and port used by event stream
closes #1994
2018-01-15 16:19:08 +01:00
Sylvain Bellemare
76ac3b3c6c Order import as per PEP 8 2018-01-15 16:19:08 +01:00
muawiakh
93070bf9fe Update docs II 2018-01-12 18:21:19 +01:00
muawiakh
c4e752d379 Address comments
- Use aafigure to render text -> HTML/image
- Update some docs
2018-01-12 18:16:05 +01:00
codegeschrei
411d1963bb requested changes 2018-01-12 11:06:27 +01:00
codegeschrei
b7d235379a fix tests 2018-01-11 13:44:54 +01:00
codegeschrei
06a091e215 add mode parameter to transaction endpoint, fixes #1995 2018-01-11 13:26:06 +01:00
Ahmed Muawia Khan
f817818770
Merge pull request #1987 from bigchaindb/storage-engine-fix-mongo-k8s
Fix error checking of optional parameter `storage-engine-cache-size`
2018-01-11 12:54:46 +01:00
muawiakh
ffc2878033 Update some misleading doc mistakes 2018-01-11 12:17:55 +01:00
muawiakh
61f36435fc Separate tendermint integration deployment files
- Separate deployments, services, statefulsets etc
  `yaml` files for tendermint based deployment.
- Separate Dockerfiles for mongodb, nginx for
  tendermint integrated BigchainDB.
2018-01-11 12:13:36 +01:00
Troy McConaghy
c0b32213e4 Updated all refs to the IPDB Transaction Spec & its URL 2018-01-10 14:40:34 +01:00
muawiakh
14892fc839 Template for BigchainDB + Tendermint Kubernetes Deployment
- Template doc for BigchainDB + Tendermint single node
- Template doc for BigchainDB + Tendermint network
- Remove autosectionlabel extension from docs/server/source/conf.py
  - Removed this extension because this does not allow two different
    documents to have same headings, because it auto-indexes
- Fix and explicitly label headings and references.
2018-01-10 14:20:32 +01:00
Troy McConaghy
739ca36c2c
Merge pull request #1988 from bigchaindb/update-docs-re-ipdb-test-net
Change "IPDB Testnet" to "BigchainDB Testnet" in docs
2018-01-10 13:52:46 +01:00
muawiakh
688831467e Update naming convention in configMap 2018-01-08 12:50:38 +01:00
Troy McConaghy
31479eb3f3 docs: IPDB Testnet --> BigchainDB Testnet 2018-01-08 11:25:36 +01:00
muawiakh
9d45f735fd Improving code readability 2018-01-04 14:53:23 +01:00
muawiakh
e2316a3de8 Fix error checking of optional parameter storage-engine-cache-size
- Keep the parameter optional
- Remove redundant checking of the same parameter
- Do not exit if the parameter is not specified
2018-01-04 13:58:28 +01:00
Troy McConaghy
0b885efc85
Merge pull request #1984 from r7vme/fix/cache-size-bash
Fix issue with STORAGE_ENGINE_CACHE_SIZE parameter
2018-01-04 12:54:41 +01:00
muawiakh
a348c72696 Deployment of Tendermint + BigchainDB cluster
- Update existing docker-containers to support tendermint integration, nginx,
  mongodb, bigchaindb
- Add tendermint configuration files for statefulset, pvc, pv and service.
- Update some READMEs.
2018-01-02 14:51:23 +01:00
Roman Sokolkov
779d31ef3e
Fix issue with STORAGE_ENGINE_CACHE_SIZE parameter
In mongodb docker image STORAGE_ENGINE_CACHE_SIZE
will always be set to '' (two quotation marks)
and verification will fail. So it's impossible to
run image without --storage-engine-cache-size set.

This change removes double quotes while assigning
default value to STORAGE_ENGINE_CACHE_SIZE.
2017-12-30 17:31:55 +01:00
Sylvain Bellemare
52d0c7024a
Merge branch 'master' into tendermint 2017-12-23 04:58:18 +01:00
Sylvain Bellemare
1ebeaae6d9
Closes #1736 2017-12-22 18:05:36 +01:00
Sylvain Bellemare
8bd8dc02a4 Fixes #1969 2017-12-22 18:03:57 +01:00
Sylvain Bellemare
07ddf69fc2 Add docker-compose file for mongodb ssl tests 2017-12-22 18:03:57 +01:00
Troy McConaghy
f235d42439
Merge pull request #1957 from bigchaindb/simplify-dev-and-test-docs-for-tendermint
Simplify the "Develop & Test BigchainDB Server" section of the docs
2017-12-22 17:14:35 +01:00
kansi
9ce7455228 Migrate cli for Tendermint 2017-12-21 12:23:15 +05:30
vrde
4c5047cb20
Merge pull request #1945 from bigchaindb/update-some-docs-in-the-production-nodes-section
Updated docs in the Production Nodes section for Tendermint
2017-12-20 16:13:13 +01:00
vrde
5957fa2d39
Merge branch 'master' into tendermint 2017-12-20 16:11:00 +01:00
vrde
3a0ce37a7f
Merge pull request #1951 from bigchaindb/proposal/post-txn-mode
Proposal for extending post transaction api
2017-12-20 16:09:47 +01:00
vrde
57d4a8e895
Merge pull request #1928 from bigchaindb/feat/integrate-event-stream
Integrate event stream api
2017-12-20 16:06:16 +01:00
vrde
ab4328fa1f
Merge pull request #1939 from bigchaindb/feat/integrate-metadata-api
integrate metadata api
2017-12-20 16:01:19 +01:00
vrde
fd6b5de91f
Merge pull request #1949 from bigchaindb/proposal-integration-testing
Add proposal for integration testing
2017-12-20 15:58:52 +01:00
vrde
1f21f069dd
Merge branch 'proposal-integration-testing' of github.com:bigchaindb/bigchaindb into proposal-integration-testing 2017-12-20 15:58:11 +01:00
vrde
883ba3832c
Merge branch 'tendermint' into proposal-integration-testing 2017-12-20 15:57:01 +01:00
vrde
59ae92350c
Merge pull request #1964 from bigchaindb/proposal-integration-test-cases
add test cases for integration testing
2017-12-20 15:53:27 +01:00
Troy McConaghy
1ac112b4a0
Merge pull request #1966 from bigchaindb/new-production-ready-page-for-tendermint
New production-ready page for tendermint branch
2017-12-20 14:16:13 +01:00
kansi
f1c11ccfa2 Fix spelling errors 2017-12-19 16:53:40 +05:30
Troy McConaghy
ebb6e84ad0 New page about production-readiness for Tendermint branch 2017-12-18 17:57:13 +01:00
codegeschrei
3057544618 requested changes 2017-12-18 17:15:01 +01:00
codegeschrei
b585efc790 requested changes 2017-12-18 17:03:14 +01:00
vrde
ba8ee3fe83
Fix some typos 2017-12-18 16:06:18 +01:00
codegeschrei
b9a97133d6 add test cases for integration testing 2017-12-13 13:33:03 +01:00
Troy McConaghy
5799ede466
Merge pull request #1952 from bigchaindb/new-style-quickstart-page
Redid the Quickstart page for the tendermint branch
2017-12-13 12:21:11 +01:00
Troy McConaghy
d9850639aa
Merge pull request #1942 from bigchaindb/tendermint-docs/1934/fix-some-broken-links
[tendermint branch] Docs: Fix 5 broken links to IPDB tx spec pages
2017-12-13 11:09:20 +01:00
Troy McConaghy
babf0b173c
Merge pull request #1941 from bigchaindb/docs/1934/fix-broken-links-to-ipdb-tx-spec-pages
[master branch] Docs: Fix 5 broken links to IPDB tx spec pages
2017-12-13 11:06:05 +01:00
kansi
afd643c41d Expand abbrevation "txn" to transaction 2017-12-13 11:05:28 +05:30
kansi
a8d267f429 Fix asyncio compability with python 3.5 2017-12-12 22:34:17 +05:30
Ahmed Muawia Khan
ac2e431d9e
Merge pull request #1959 from bigchaindb/typo-firewall-notes
Typo firewall notes
2017-12-12 13:52:30 +01:00
muawiakh
4792b94201 Fix typo in firewall docs
- inbount -> inbound
2017-12-12 13:37:57 +01:00
Troy McConaghy
caf6724184 docs: made dev-and-test section just point to CONTRIBUTING.md 2017-12-12 10:55:05 +01:00
Troy McConaghy
fbd85301e1
Merge pull request #1921 from bigchaindb/docs/update-firewall-page
Updated the Notes for Firewall Setup page in docs
2017-12-12 10:35:03 +01:00
Shahbaz Nazir
6ddf37dc66
Scripts to bootstrap devstack setup for bigchaindb with tendermint (#1887)
bash scripts to setup dev environment with bigchaindb+tendermint+mongodb
2017-12-11 17:03:32 +01:00
Troy McConaghy
8c0e28ee46
Merge pull request #1947 from bigchaindb/update-contributing-md-file-for-tendermint-branch
Update the CONTRIBUTING.md file (on tendermint branch)
2017-12-11 16:38:52 +01:00
Troy McConaghy
93be14174a Redid the Quickstart page for the tendermint branch 2017-12-08 12:18:20 +01:00
kansi
7cd76c346b Proposal for extending post transaction api 2017-12-08 10:27:11 +05:30
Troy McConaghy
dab64485eb
Merge branch 'tendermint' into update-some-docs-in-the-production-nodes-section 2017-12-07 17:34:36 +01:00
vrde
efc149aaa1
Add proposal for integration testing 2017-12-07 17:30:43 +01:00
Troy McConaghy
d4e880fa36
Merge pull request #1917 from bigchaindb/rm-aws-deployment-tools-and-docs
Removed old AWS testing cluster stuff including docs
2017-12-07 17:04:04 +01:00
Troy McConaghy
b6c06b4ccc Merge remote-tracking branch 'origin/tendermint' into update-contributing-md-file-for-tendermint-branch 2017-12-07 14:28:17 +01:00
Troy McConaghy
3f369eb83c
Merge pull request #1948 from bigchaindb/fix-test-and-rm-pytest-catchlog-on-tendermint-branch
Fixed failing test and removed pytest-catchlog on tendermint branch
2017-12-07 14:26:48 +01:00
Troy McConaghy
7a491bb781 Removed pytest-catchlog from setup.py & fixed one failing test 2017-12-07 13:33:57 +01:00
Troy McConaghy
941445cace Updated the CONTRIBUTING.md file for the tendermint branch 2017-12-07 10:45:52 +01:00
Troy McConaghy
da799b74f6 Updated docs in Production Nodes section for Tendermint 2017-12-06 17:10:37 +01:00
Sylvain Bellemare
cb268a3832
Merge branch 'master' into tendermint 2017-12-06 16:59:26 +01:00
Troy McConaghy
cdb4561805
Merge pull request #1943 from bigchaindb/put-commit-c5443dc-in-master-branch-too
[master branch] Removed Azure Quickstart Template docs
2017-12-06 14:32:36 +01:00
Troy McConaghy
e0b454953c
Merge branch 'tendermint' into rm-aws-deployment-tools-and-docs 2017-12-06 14:14:04 +01:00
Troy McConaghy
47bf3215ea Removed Azure Quickstart Template docs
(cherry picked from commit c5443dc477a0f4018c3785d22760fbbcae06d3a3)
2017-12-06 14:03:45 +01:00
Troy McConaghy
c8e2f59413
Merge pull request #1933 from bigchaindb/docs/1927/remove-azure-quickstart-template-docs
Remove Azure Quickstart Template Docs
2017-12-06 13:56:57 +01:00
Troy McConaghy
d2296af3c8 Docs: Fixed 5 broken links to IPDB tx spec pages
(cherry picked from commit d9f147df6e2a8f11c4de20371954a718a299b832)
2017-12-06 11:34:47 +01:00
Troy McConaghy
d9f147df6e Docs: Fixed 5 broken links to IPDB tx spec pages 2017-12-06 11:23:45 +01:00
kansi
f5b887ac59 Integrate events api 2017-12-06 15:42:45 +05:30
Sylvain Bellemare
138aaaf8fd Remove pytest-catchlog since it is now in the core 2017-12-06 10:57:37 +01:00
kansi
cb92248855 Merge branch 'tendermint' into feat/integrate-metadata-api 2017-12-06 10:26:53 +05:30
kansi
b3f2eeb931 Integrate metadata api 2017-12-06 10:25:52 +05:30
Sylvain Bellemare
9dd2e026b0 Fixes #1891 2017-12-05 19:38:52 +01:00
Troy McConaghy
e201ba7305
Merge pull request #1919 from bigchaindb/remove-defunct-docs-pages
Removed some fully-removeable pages from the Appendices
2017-12-05 14:09:22 +01:00
Troy McConaghy
b36df932a5 Removed appendices/install-latest-pip.md 2017-12-05 13:47:24 +01:00
Troy McConaghy
c5443dc477 Removed Azure Quickstart Template docs 2017-12-05 11:27:08 +01:00
muawiakh
2f8c9d77e8 Update docker compose files for tendermint
- BigchainDB does not use --init flag anymore
- Either we use `bigchaindb init` explicitly or `bigchaindb start --no-init`
  other wise `bigchaindb start` implicitly does an init
2017-12-01 15:37:42 +01:00
Troy McConaghy
1a5bb073e3 Remove rethinkdb-backup.md 2017-12-01 15:27:55 +01:00
Troy McConaghy
b1276020b3 Updated the Notes for Firewall Setup page in docs 2017-12-01 14:26:28 +01:00
kansi
043b0c17ac Merge branch 'tendermint' into feat/upgrade-py-abci 2017-12-01 16:37:39 +05:30
Troy McConaghy
91dcce1a45 Removed some fully-removeable pages from Appendices 2017-12-01 11:16:35 +01:00
vrde
3dcd0ac25c
Merge pull request #1902 from bigchaindb/feat/integrate-output-api
Integrate output search api
2017-12-01 10:51:52 +01:00
kansi
228bd83ae7 Upgrade py-abci 2017-12-01 14:43:17 +05:30
Troy McConaghy
ae5b5fe3b8
Merge pull request #1916 from bigchaindb/update-some-root-docs-for-tendermint
Updated & deleted some root docs in the tendermint branch
2017-12-01 10:11:19 +01:00
kansi
2b3a9fa6f6 Integrate output search api 2017-11-30 23:59:42 +05:30
vrde
1e104ad2c4
Merge branch 'master' into tendermint 2017-11-30 18:17:36 +01:00
Troy McConaghy
b237a021c6 Removed old AWS testing cluster stuff including docs 2017-11-30 17:50:22 +01:00
Troy McConaghy
9c2d04d887 Updated & removed some root docs on tendermint branch 2017-11-30 15:39:45 +01:00
Katha
9d38d3d405
add tests to improve codecov (#1871)
* add tests to improve codecov
2017-11-30 15:07:45 +01:00
Katha
e377fb57af
Pre commit styling (#1914)
* run pre-commit and fix errors

* mention pre-commit in our guides
2017-11-30 15:04:14 +01:00
Katha
7aa1f09588
Merge pull request #1872 from bigchaindb/pre-commit-proposal
pre-commit proposal
2017-11-30 15:03:30 +01:00
codegeschrei
321809622a pre-commit proposal 2017-11-29 18:41:07 +01:00
vrde
044a052644
Merge branch 'master' into tendermint 2017-11-29 17:18:00 +01:00
Sylvain Bellemare
35012a6452 Fix flake8 errors 2017-11-29 16:55:32 +01:00
Troy McConaghy
7bfc665638
Merge pull request #1909 from bigchaindb/docs/point-some-pages-to-ipdb-tx-spec-docs
Changed six docs pages to just point to the IPDB Transaction Spec
2017-11-28 16:32:29 +01:00
Troy McConaghy
b52f094efa Revised several pages to point to replacement in the IPDB Transaction Spec 2017-11-28 12:16:44 +01:00
vrde
b64edf94ab
Merge pull request #1886 from bigchaindb/feat/integrate-asset-search
Integrate asset search
2017-11-24 11:55:42 +01:00
kansi
fcfe577813 Added localmongodb marker 2017-11-24 12:30:57 +05:30
kansi
6c3f176122 Integrate asset search 2017-11-23 21:28:51 +05:30
Troy McConaghy
1de7e55ac3
Merge pull request #1894 from bigchaindb/issue/1875/json-schema-validation-is-ipdb-protocol
Removed appendix page w/ tx JSON Schema files & updated transaction-m…
2017-11-23 16:37:32 +01:00
kansi
00dd16840f Added backend tests, configure app fixture 2017-11-23 16:27:35 +01:00
kansi
95c0f267e0 Integrate api GET "/transactions?asset_id={asset_id}&operation=" 2017-11-23 16:27:35 +01:00
Sylvain Bellemare
13b3d6b464 Add some docs 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
c9380f128e Start tendermint integration with bigchaindb cmd 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
b7ef4caa26 Add dev setup of 4 nodes with docker-compose 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
67c8bba17b Parametrize tendermint endpoint based on env vars 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
9ccf676204 Log debug statements 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
a19361cede Use env var to start or not, tendermint 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
6db3390b95 Log instead of printing the banner 2017-11-23 16:22:16 +01:00
Sylvain Bellemare
9b3d1e1c53 Add docker-compose for tendermint integration dev 2017-11-23 16:22:16 +01:00
Troy McConaghy
374b6301c6 In readme file about JSON Schema files, note provenance and update process 2017-11-23 16:21:19 +01:00
vrde
359efbba15
Merge pull request #1863 from bigchaindb/write-transfer-test
Write transfer test
2017-11-23 16:11:31 +01:00
vrde
f4a6b863fe
Merge branch 'tendermint' into write-transfer-test 2017-11-23 15:55:32 +01:00
vrde
cf2f13aa3c
Remove app reinitialization from tests 2017-11-23 15:53:43 +01:00
Troy McConaghy
f23a2c4042 Removed appendix page w/ tx JSON Schema files & updated transaction-model.rst page 2017-11-23 14:45:23 +01:00
Ahmed Muawia Khan
4e64a37e52
Merge pull request #1890 from bigchaindb/advertise-metadata
Add metadata endpoint to info view
2017-11-23 11:16:50 +01:00
muawiakh
020b6c1ff8 Minor change in docs 2017-11-23 10:43:48 +01:00
muawiakh
b184e83b6a [Doc]: Fix markdown formatting in rst 2017-11-23 10:24:35 +01:00
kansi
5abb6ead8b Update metadata documentation 2017-11-23 10:41:58 +05:30
muawiakh
82cd3a61ed Add metadata endpoint to info view
- Metadata search was recently added and works seamlessly
- The endpoint was not reflected in the info view i.e.
  when someone queries at root / or api/v1 endpoints.
- Handle unit tests for the change as well.
2017-11-22 18:31:35 +01:00
kansi
66601f7fa2 Moved class "Block" to namedtuple, updated tests 2017-11-22 21:38:26 +05:30
Troy McConaghy
dd24bd8fb7
Merge pull request #1878 from bigchaindb/issue/1873/version-the-tx-schema-files
Version the transaction schema files
2017-11-22 16:41:09 +01:00
muawiakh
7220e84e8d Address comments
- Add a release tracking document and example
2017-11-22 12:35:35 +01:00
muawiakh
e3654a9994 Address comments, typos 2017-11-22 11:21:19 +01:00
Troy McConaghy
e50377e801
Merge pull request #1883 from bigchaindb/update-version-py-to-1.4.0.dev
Updated version.py for 1.4.0.dev
2017-11-21 20:16:43 +01:00
Troy McConaghy
bdab5e6219 Updated version.py for 1.4.0.dev 2017-11-21 19:59:09 +01:00
Troy McConaghy
9726cacf54
Merge pull request #1881 from bigchaindb/update-docker-image-to-1.3.0-in-k8s-yamls
Updated Docker image to 1.3.0 in k8s YAML files
2017-11-21 19:00:26 +01:00
Troy McConaghy
61747b138d Updated Docker image to 1.3.0 in k8s YAML files 2017-11-21 18:58:41 +01:00
Troy McConaghy
2590043a7a
Merge pull request #1880 from bigchaindb/update-changelog-for-v1.3-release
Updated the CHANGELOG.md file for the v1.3 release
2017-11-21 18:54:30 +01:00
Troy McConaghy
9d9310d8e5 Updated CHANGELOG.md for the v1.3 release 2017-11-21 18:41:44 +01:00
muawiakh
e0a771dabb Change man days to a gender neutral term
- Now dev days
2017-11-21 16:56:17 +01:00
muawiakh
193807153e Address comments I 2017-11-21 16:41:28 +01:00
Troy McConaghy
dfe072e443 Fixed a Flake8 error 2017-11-21 14:52:15 +01:00
muawiakh
a1d85afe04 Update issue template to reflect bug reports vs new feature 2017-11-21 14:34:48 +01:00
muawiakh
789f0be547 Add changes to release process
- Also no need to `spec-index.rst`
2017-11-21 14:30:12 +01:00
Troy McConaghy
94c77ba658 Removed the line from transaction_v1.0.yaml 2017-11-21 14:13:24 +01:00
Troy McConaghy
35fa8d7d19 Updated all code/docs referencing the transaction schema files by name 2017-11-21 14:12:13 +01:00
Troy McConaghy
8482521a8b Renamed all transaction schema files: added _v1.0 in them 2017-11-21 14:10:14 +01:00
muawiakh
27aa8555aa Add guidelines for new features in BigchainDB
- Template specification document
- Update CONTRIBUTING.md to reflect changes
2017-11-21 14:07:38 +01:00
kansi
f9d8519832 Merge branch 'bug/1592/metadata-text-search' 2017-11-20 19:12:31 +05:30
kansi
c78490f44d Merge branch 'master' into bug/1592/metadata-text-search 2017-11-20 19:12:12 +05:30
Shahbaz Nazir
6c1017510b
Add standard template for creating PRs (#1776)
* Add standard template for creating PRs

Adding a standard template for creating
Pull requests for improved code QA and delegating
dependencies whenever applicable

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* Update developer docs with PR instructions

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* Addressing review comments for PR template

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2017-11-20 14:08:57 +01:00
Shahbaz Nazir
bc4f8fcab5
Fix getstarted undefined referrer issue with IPDB (#1866)
Skip Referer check on preflight request (OPTIONS) and set Referrer-Policy to origin-when-cross-origin in response to OPTIONS request. Once Referrer-Policy is set on the subsequent POST request referrer is set by the browser to expected value.
2017-11-17 20:35:57 +01:00
Troy McConaghy
f53eb1e3e7
Merge pull request #1855 from bigchaindb/update-blocks-and-votes-docs
Updated docs about blocks and votes
2017-11-17 13:32:02 +01:00
Troy McConaghy
01796b0660
Merge branch 'master' into update-blocks-and-votes-docs 2017-11-16 18:27:08 +01:00
Troy McConaghy
5642050276
Merge pull request #1853 from bigchaindb/rm-descriptions-from-yaml-files
Removed all 'description' keys & values from the YAML files
2017-11-16 18:22:52 +01:00
Troy McConaghy
73034794f8 Merge branch 'master' into rm-descriptions-from-yaml-files 2017-11-16 18:06:58 +01:00
codegeschrei
48e38b6713 fix flake8 errors 2017-11-16 17:14:21 +01:00
Ahmed Muawia Khan
7b2b343138
Merge pull request #1790 from bigchaindb/multi-node-automation
Automation of multi node BigchainDB deployment for dev/test
2017-11-16 16:56:21 +01:00
Ahmed Muawia Khan
a99c817030
Merge pull request #1824 from bigchaindb/update-tectonic-docs
Update tectonic installation guide
2017-11-16 16:56:00 +01:00
Ahmed Muawia Khan
3752e13a38
Merge pull request #1825 from bigchaindb/docker-for-mac-quickstart
Update quickstart guide for 'docker for mac' users
2017-11-16 16:55:31 +01:00
muawiakh
cd98591851 Address comments on docs and some typos 2017-11-16 12:53:36 +01:00
muawiakh
2df08430cd Remove docker network creation and use default docker bridge 2017-11-16 12:53:36 +01:00
muawiakh
c285487dfb Revert "Fix flake8 failure"
This reverts commit 5c6e7419a7fa827f1291be3ecbeda895e3a46b58.
2017-11-16 12:53:36 +01:00
muawiakh
0ee0d88da1 Fix flake8 failure 2017-11-16 12:52:35 +01:00
muawiakh
b96a754f9a Update bdb-config 2017-11-16 12:51:46 +01:00
muawiakh
b2b644db3d Fix minor docs comments 2017-11-16 12:51:46 +01:00
muawiakh
20147562f6 Fix docs build issue 2017-11-16 12:51:46 +01:00
muawiakh
0f68c41b89 Addressing comments and updating some documentation 2017-11-16 12:51:46 +01:00
muawiakh
241af47a32 Automation of multi node BigchainDB deployment for dev/test
- Setup single/multi node BigchainDB cluster using
  - Vagrant
  - Ansible
- Updated documentation
2017-11-16 12:51:46 +01:00
muawiakh
977a6426fe Make premium_lrs default 2017-11-16 12:44:21 +01:00
muawiakh
1eb8764e4a Update deployment with tectonic documentation
- Add details about CA configuration
- Update storage class template
2017-11-16 12:44:21 +01:00
muawiakh
b4ca495967 Remove redundant redirections to different docker installation pages(s)
- All the instructions are common now
- Remove redundant files
- address comments
2017-11-16 12:14:11 +01:00
codegeschrei
63f0baf1b7 add double spend test, fix double spend validation 2017-11-16 11:53:14 +01:00
muawiakh
47f872df0f Integrate some other changes 2017-11-16 11:45:46 +01:00
muawiakh
7906edcebf Update quickstart guide for 'docker for mac' users 2017-11-16 11:45:46 +01:00
Ahmed Muawia Khan
a4140e92a6
Merge pull request #1852 from bigchaindb/travis-workaround
[Workaround]: Travis failures
2017-11-16 11:33:54 +01:00
Vanshdeep Singh
e27c1e9cef Return commit hash to tendermint (#1851)
* Aggregate transaction ids for commit hash

* Setup chain and return commit hash to tendermint

* Fix function naming
2017-11-15 15:41:23 +01:00
vrde
7dc7d745ec
Split transaction from asset (#1854)
Close #1827
2017-11-15 15:05:38 +01:00
vrde
b56b1d6364
Use localmongodb as default backend for docker-compose (#1858)
* Use `localmongodb` as default backend for docker-compose

* Remove replica-set
2017-11-15 15:01:07 +01:00
muawiakh
18fed8b1d0 [Workaround]: Travis failures
- Marking test_double_create as serial
- If this works, we don't need to skip the tests
- Finger crossed.
2017-11-15 14:30:01 +01:00
kansi
5590e719ae Merge branch 'fix-readme-dev-test-node-link' 2017-11-15 18:55:27 +05:30
kansi
4d465317b6 Merge branch 'master' into fix-readme-dev-test-node-link 2017-11-15 18:54:54 +05:30
kansi
67c4b8ee3f Fix "Set Up & Run a Dev/Test Node" link 2017-11-15 16:31:46 +05:30
Troy McConaghy
c6c89bfcba Added page about the transaction schema files 2017-11-15 11:18:07 +01:00
Troy McConaghy
b3ccb09e01 Changed title of the page about vote.yaml 2017-11-15 11:17:41 +01:00
Troy McConaghy
31a0bc846b Updated docs about blocks and votes 2017-11-14 15:51:36 +01:00
kansi
860d247aa4 Fixed decouple assets 2017-11-14 19:23:22 +05:30
Troy McConaghy
e86fa1f1bb Removed drop_schema_description() & its test 2017-11-14 14:05:53 +01:00
Troy McConaghy
6291afd0f7 rm all 'description' keys & values from YAML files 2017-11-14 14:05:02 +01:00
Troy McConaghy
c2acefa6f0
Merge pull request #1847 from bigchaindb/no-more-autogen-schema-pages-in-docs
Removed auto-generated tx & vote schema documentation
2017-11-14 11:42:43 +01:00
Troy McConaghy
053b954624 Removed docs/server/source/schema from .gitignore 2017-11-14 10:20:10 +01:00
kansi
f16e30f30b Merge branch 'master' into bug/1592/metadata-text-search 2017-11-14 00:16:28 +05:30
kansi
4eca26782c Change metadata model, fix tests and update docs 2017-11-14 00:13:06 +05:30
Troy McConaghy
f0d4417d02 Removed auto-generation of tx/vote schema documentation 2017-11-13 17:28:06 +01:00
Troy McConaghy
5454b6fcd1
Merge pull request #1843 from bigchaindb/update-version-py-to-1.3.0.dev
Updated to 1.3.0.dev in version.py
2017-11-13 14:54:41 +01:00
Troy McConaghy
9bed27b98f Updated to 1.3.0.dev in version.py 2017-11-13 14:53:25 +01:00
Troy McConaghy
952ba286e6
Merge pull request #1841 from bigchaindb/update-docker-image-version-in-k8s-files
Updated Docker image version to 1.2.0 in k8s YAML files
2017-11-13 13:56:54 +01:00
Troy McConaghy
67c8c6a1cb Updated Docker image version to 1.2.0 in k8s YAML files 2017-11-13 13:54:13 +01:00
Troy McConaghy
21fc364479
Merge pull request #1840 from bigchaindb/update-changelog-for-v1.2-release
Updated the changelog for the v1.2 release
2017-11-13 13:47:50 +01:00
Troy McConaghy
cfa63ae9af Updated the changelog for the v1.2 release 2017-11-13 13:38:00 +01:00
vrde
2192003a5e
Update docs and comments 2017-11-13 00:17:07 +01:00
vrde
db7727a459
Add GET and POST transaction (#1823) 2017-11-11 02:26:50 +01:00
vrde
2815cffcb5
Flat UTXO collection and first integration with Tendermint™ (#1822)
* Remove testing for rethinkdb, mongodb, and Py3.5

* Add first tests

* Add validation

* Add command to start the ABCI Server

* Reuse existing MongoDB Connection class

* Use DuplicateTransaction

* Test only tendermint

* Update travis scripts

* Fix pep8 errors

* Update Makefile
2017-11-10 17:53:57 +01:00
vrde
0c1256b975
Merge pull request #1819 from bigchaindb/improve-ws-reliability
Handle WS CLOSE properly
2017-11-10 11:10:27 +01:00
vrde
e242345327
Remove sample code 2017-11-09 15:59:02 +01:00
kansi
832ecb5e63 Handle metadata table during test setup/tear down 2017-11-09 19:17:23 +05:30
vrde
c4e0a8e1db
Handle WS CLOSE properly 2017-11-09 14:15:46 +01:00
kansi
8939c0f341 Merge branch 'master' into bug/1592/metadata-text-search 2017-11-09 17:39:35 +05:30
kansi
2afdd86752 Merge branch 'update-docs-server-requirements-txt' 2017-11-09 17:37:06 +05:30
kansi
0092270964 Merge branch 'master' into update-docs-server-requirements-txt 2017-11-09 16:31:43 +05:30
kansi
a2ed03dabc Merge branch 'master' into bug/1813/retract-cmd-bigchaindb-flag 2017-11-09 15:41:40 +05:30
kansi
07827186bc Merge branch 'master' into bug/1810/update-asset-docs 2017-11-09 14:30:18 +05:30
kansi
b95dc306d8 Merge branch 'bug/1670/asset-language-api-fix' 2017-11-09 13:41:20 +05:30
kansi
a809a7a620 Merge branch 'master' into bug/1670/asset-language-api-fix 2017-11-09 13:39:55 +05:30
Vanshdeep Singh
5ce2eb1f97 Bypass CI issues for rethinkdb (#1821)
Add custom marker to skip some travis/rdb tests
2017-11-08 19:41:17 +01:00
vrde
b4738e2e61
Start Tendermint integration 2017-11-08 18:53:27 +01:00
Troy McConaghy
e725c23691
Added note about 'make clean-pyc' 2017-11-07 14:24:33 +01:00
kansi
1266c43ff8 Fix docker files 2017-11-07 18:44:51 +05:30
kansi
8aba802425 Fix tests 2017-11-07 15:41:55 +05:30
kansi
220465f701 Added "--no-init" flag for "bigchaindb start" command 2017-11-07 14:55:05 +05:30
Troy McConaghy
6cab2f26e9
Fix command to run tests w/ docker-compose & bdb-rdb 2017-11-07 10:20:41 +01:00
Troy McConaghy
d55004601c
Fix command to run RethinkDB in bg w/ docker-compose 2017-11-07 10:17:21 +01:00
kansi
714c1782ac Support for metadata search api and its testing suite 2017-11-07 12:20:51 +05:30
kansi
94ce03cbec Decouple metadata from transaction 2017-11-07 10:50:07 +05:30
kansi
d9d0585228 Added metadata table for mongodb 2017-11-06 20:20:06 +05:30
Troy McConaghy
cae883e9cb Edited the changes to transaction model docs 2017-11-06 14:30:01 +01:00
Troy McConaghy
636c28d311 Edited changes to the docs about the asset model 2017-11-06 14:22:17 +01:00
Troy McConaghy
c616145a66
pyyaml>=3.12 in docs/server/requirements.txt 2017-11-06 12:12:16 +01:00
kansi
50cc0facef Merge branch 'master' into bug/1810/update-asset-docs 2017-11-06 15:50:07 +05:30
kansi
3cbec5a864 Updated metadata and asset model docs 2017-11-06 12:06:01 +05:30
kansi
7941922ac0 Added type validation for data 2017-11-06 10:43:54 +05:30
kansi
e2c2c4b097 Fix spell errors. 2017-11-03 19:15:32 +05:30
kansi
a29fd7e84f Fix variable type check and docstrings 2017-11-03 18:37:19 +05:30
Trent McConaghy
3b33cdb111
Update bft.md 2017-11-03 13:48:08 +01:00
kansi
99aa38b217 Added "none" to language whitelist 2017-11-03 11:38:38 +05:30
kansi
8310b04b17 Merge branch 'master' into bug/1670/asset-language-api-fix 2017-11-03 11:38:09 +05:30
Troy McConaghy
b93b3d2af8
Merge pull request #1788 from bigchaindb/docs/1752/how-permissions-work
New root docs page about permissions in BigchainDB
2017-11-02 15:21:26 +01:00
kansi
293f7ec9e4 Merge branch 'bug/1702/invalid-asset-data-keys' 2017-11-02 19:34:38 +05:30
kansi
961d7f5b29 Merge branch 'master' into bug/1702/invalid-asset-data-keys 2017-11-02 19:33:32 +05:30
kansi
8fdf8f6ca6 Added docstrings 2017-11-02 18:02:11 +05:30
kansi
d0ca211abc Merge branch 'bug/1656/bigcahin-secondary-index' 2017-11-02 15:59:13 +05:30
kansi
263e9a25f6 Unique index for bigchain collection, fixed test case 2017-11-01 21:23:06 +05:30
kansi
f3da30aea0 Validate nested keys for asset.data and metadata 2017-11-01 17:26:16 +05:30
kansi
cd636101a7 Support abbreviated values for "language" 2017-10-31 16:54:47 +05:30
kansi
1de5375962 Validate asset data keys 2017-10-31 15:16:59 +05:30
kansi
7226584215 Api fix for asset language 2017-10-31 10:12:16 +05:30
kansi
421c67c621 Fixed mongodb tests 2017-10-27 15:31:44 +05:30
Troy McConaghy
97e1a13c7f Updated docs/server/requirements.txt
The `requirements.txt` file in `docs/server` didn't have all the Python packages needed to build the BigchainDB Server docs. I fixed that.
2017-10-27 11:51:02 +02:00
kansi
ddfce61b79 Added secondary index for "id" in bigchain collection. 2017-10-27 15:05:43 +05:30
kansi
ad6dd9a5af Merge branch 'bug/1792/events-api-docs' 2017-10-26 15:04:28 +05:30
kansi
113c408f61 Merge branch 'bug/1661/cmd-start-force-init-database' 2017-10-25 14:09:59 +05:30
kansi
25716261e0 Updated keep-alive section 2017-10-25 13:47:02 +05:30
kansi
cf19a8cb93 Updated docs 2017-10-24 18:29:31 +05:30
kansi
199473178f Fix rethinkdb tests 2017-10-24 18:03:57 +05:30
kansi
5954d6360a Added cmd flag --init to start command 2017-10-24 16:59:10 +05:30
kansi
037dd65186 Merge branch 'bug/1660/logging-server-port-config' 2017-10-24 14:24:45 +05:30
kansi
0b44c385a6 Merge branch 'master' into bug/1660/logging-server-port-config 2017-10-24 10:10:18 +05:30
kansi
76bf05529d Merge branch 'bug/1625/handle-log-env-vars' 2017-10-24 10:00:21 +05:30
kansi
fa345e5441 Updated server configuration docs. 2017-10-23 21:52:30 +05:30
kansi
020d463e8d Modified log port config checks. 2017-10-23 21:08:44 +05:30
kansi
50eb857133 Fix flake8 ambiguous variable "l" issue 2017-10-23 18:06:11 +05:30
kansi
dc00e16fda Apply "log" environment variables to config 2017-10-23 16:00:09 +05:30
kansi
6f5eef97a7 Updated server configuration docs 2017-10-23 14:31:12 +05:30
kansi
01390a8cc0 Fix code coverage 2017-10-23 10:20:56 +05:30
kansi
ce7f575e0e Merge remote-tracking branch 'upstream/master' into bug/1660/logging-server-port-config 2017-10-23 09:22:11 +05:30
kansi
0c0d3049f2 Provide log server port as config paramter 2017-10-23 09:17:58 +05:30
Sylvain Bellemare
788f2f7277 Remove dev related mount of cryptoconditions 2017-10-20 14:24:03 +02:00
Troy McConaghy
fba6e1b30b New root docs page about permissions in BigchainDB 2017-10-18 15:38:46 +02:00
Troy McConaghy
cafbb5c944 Merge pull request #1785 from bigchaindb/refactor-dev-test-node-docs
Refactored the docs on dev/test node setup
2017-10-16 10:18:17 +02:00
Troy McConaghy
ee6f0fa7dd Refactored the docs on dev/test node setup 2017-10-15 13:52:54 +02:00
Shahbaz Nazir
0a8bf89bc6 Add workflow to retain Azure storage disks on PVC or PV delete (#1782) 2017-10-13 23:26:13 +02:00
Michiel Mulders
8385b7d4ef Added Link To JavaScript Driver Docs 2017-10-12 17:23:27 +02:00
Troy McConaghy
bb9e26c694 Markdown-link http://127.0.0.1:9984/ in Quickstart 2017-10-10 09:43:53 +02:00
Troy McConaghy
22af5c8383 Quickstart: BigchainDB Root URL from text-> URL
In the Quickstart page of the docs, the BigchainDB Root URL (http://127.0.0.1:9984/) was being formatted as text (with a $ in front) rather than as an URL. I changed it to format like a clickable (linked) URL.
2017-10-10 09:29:25 +02:00
Ahmed Muawia Khan
6d5136c349 Merge pull request #1775 from bigchaindb/refactor-setup-docs
Refactor installation docs for bigchaindb node
2017-10-04 12:34:01 +02:00
muawiakh
8390cab59a Remove cloud9 pdf 2017-10-04 11:51:22 +02:00
muawiakh
f1ba935476 [refactor docs]: Remove cloud9 deployment guide
- Remove deprecated guides
- Address comments
2017-10-04 11:21:34 +02:00
muawiakh
a9625e0e62 Refactor installation docs for bigchaindb node
- Restructure docs for introduction page.
- Add vagrant and ansible deployment menthod to the list
2017-10-02 15:28:32 +02:00
Krish
44b6376f05 Add Preferred Hostname Troubleshooting steps (#1773) 2017-09-29 11:01:45 +02:00
Shahbaz Nazir
1b9dcb9ffa Change Group ID to Project ID for cloud manager config (#1772)
MongoDB cloud manager UI has been updated and they have changed Group ID to Project ID and merged Settings -> Group Settings into one consolidated panel Settings

This PR updates the k8s docs accordingly
2017-09-29 09:56:58 +02:00
krish7919 (Krish)
c211ef156a Address comments 2017-09-28 16:47:50 +02:00
krish7919 (Krish)
cba933a592 Elaborate on 502 gateway error 2017-09-28 16:47:50 +02:00
krish7919 (Krish)
df2bd10430 Add troubleshooting doc 2017-09-28 16:47:50 +02:00
Ahmed Muawia Khan
2dcc946c0c Merge pull request #1771 from bigchaindb/update_mdb_backup_agent
Update mongodb monitoring agent
2017-09-28 16:12:17 +02:00
muawiakh
9609efbb5e Update mongodb monitoring agent 2017-09-28 15:14:38 +02:00
krish7919 (Krish)
751da63e38 Address comments 2017-09-28 15:14:16 +02:00
krish7919 (Krish)
cebea3e1b8 Update image and address comments 2017-09-28 15:14:16 +02:00
krish7919 (Krish)
1761e94840 Adding high level arch description 2017-09-28 15:14:16 +02:00
krish7919 (Krish)
4ee5b4cfbc Bugfix in nginx-openresty Dockerfile 2017-09-28 15:09:43 +02:00
krish7919 (Krish)
99f5996881 Sanity check for input values 2017-09-28 15:09:29 +02:00
Ahmed Muawia Khan
f62241026c Merge pull request #1767 from bigchaindb/update-nginx-deps
Update nginx-http(s) and mongodb deployments files to use latest vers…
2017-09-28 12:37:08 +02:00
muawiakh
3d2daa3119 Update nginx-http(s) and mongodb deployments files to use latest versions 2017-09-28 10:42:28 +02:00
Ahmed Muawia Khan
f4b5b93f69 Merge pull request #1757 from bigchaindb/mongodb-crash-fix
Adjust resources for MongoDB Stateful Set
2017-09-27 15:45:42 +02:00
Troy McConaghy
060553d02f Merge pull request #1765 from bigchaindb/release-process-revisions-after-releasing-v1.1
Minor revisions to RELEASE_PROCESS.md following the release of v1.1
2017-09-27 14:44:02 +02:00
muawiakh
1e53f13be3 Use config map for storage engine cache size 2017-09-27 14:40:12 +02:00
muawiakh
8b1fd605e2 Address some bugs
- Pushed the wrong codebase in the previous commit
2017-09-27 14:19:31 +02:00
muawiakh
7abdca205a Adjust resource for MongoDB Stateful Set
- Currently, MongoDB container crashed because of resource constaints i.e.
out of memory exception. This change updates the resources and provides
data on how the configure/calculate them(if not following the guide).
- Also, add the ability to specify the storage engine(WiredTiger) cache
size for MongoDB, this configuration also helps with keeping the resources
constrained for MongoDB containers.
- Minor changes in some other documents as well.
2017-09-27 14:19:31 +02:00
Ahmed Muawia Khan
43d8beed99 Merge pull request #1763 from bigchaindb/template-issue-reporting
Add template for issue reporting for BigchainDB and IPDB
2017-09-27 14:16:16 +02:00
Ahmed Muawia Khan
2e6be2a3b8 Merge pull request #1762 from bigchaindb/nginx-update-config
Update nginx config for well being
2017-09-27 14:13:22 +02:00
Troy McConaghy
99156e6a4c Minor revisions to RELEASE_PROCESS.md following the release of v1.1 2017-09-27 13:50:20 +02:00
muawiakh
94fb27be6c Fix typos 2017-09-26 17:24:18 +02:00
muawiakh
93ab1bc38a Add template for issue reporting for BigchainDB and IPDB 2017-09-26 17:08:15 +02:00
muawiakh
9ab6785920 Some more comments 2017-09-26 16:01:14 +02:00
muawiakh
dbddc7c85c Addressing comments 2017-09-26 15:31:37 +02:00
muawiakh
4371a2ce4b Update nginx config for well being
- turned off server tokens so the server does not leak nginx information
  on errors and header
- Added header to turn off cross site scripting
- use stable release of nginx instead of mainline
- limit available methods
- update response code
2017-09-26 14:27:21 +02:00
Troy McConaghy
86ddbc2750 Merge pull request #1761 from bigchaindb/update-version-py-to-1.2.0.dev
Update version.py version to 1.2.0.dev for docs
2017-09-26 11:53:40 +02:00
Troy McConaghy
6648b3473c Update version.py version to 1.2.0.dev for docs 2017-09-26 11:39:47 +02:00
Troy McConaghy
c255f866c8 Merge pull request #1759 from bigchaindb/update-docker-img-ver-for-k8s-to-1.1.0
Update BDB Docker image version for k8s
2017-09-26 10:40:33 +02:00
Troy McConaghy
d852209c4e Updated BDB image version in the k8s YAML of k8s/dev-setup/ 2017-09-26 10:27:05 +02:00
Troy McConaghy
cdfc0a3058 Update BDB Docker image version for k8s
Part of the BigchainDB release process
2017-09-26 10:09:25 +02:00
Troy McConaghy
13379446a7 Set the date of the v1.1 release in CHANGELOG.md
I should have done this in PR #1744 but I forgot.
2017-09-26 10:02:34 +02:00
Troy McConaghy
dee9be3b8e Merge pull request #1744 from bigchaindb/update-changelog-for-v1.1
Updates to the changelog for the v1.1 release
2017-09-26 09:58:39 +02:00
Ahmed Muawia Khan
09bddb9658 Merge pull request #1728 from bigchaindb/move-nginx-3scale-repo
Move the bigchaindb/nginx_3scale repo under bigchaindb/bigchaindb
2017-09-26 09:25:04 +02:00
muawiakh
598d925dd4 Addressing comments
- Update README.md to remove old deployment model.
- Update version number of nginx_3scale.
2017-09-25 16:20:47 +02:00
Troy McConaghy
a1fe3d27ce Edited two LICENSES.md files 2017-09-25 16:20:47 +02:00
Muawia Khan
2cbf6b6a5c [WIP]: Move the bigchaindb/nginx_3scale repo under bigchaindb/bigchaindb
- All files moved to k8s/nginx-3scale with directory structure consistent
with k8s/nginx-http(s)
- Top level LICENCES.md updated
- Renaming entry point script to nginx_openresty_entrypoint.bash
2017-09-25 16:20:47 +02:00
Troy McConaghy
8160190f3a Added notes about new Java driver & Ruby library in CHANGELOG.md 2017-09-25 15:12:54 +02:00
krish7919 (Krish)
a72f971ed2 Documenting the use of ConfigMap and Secret in deployment 2017-09-22 09:59:30 +02:00
Ahmed Muawia Khan
06d5e32d09 Merge pull request #1749 from bigchaindb/single-node-automation
Automation for single node deployment for quickstart
2017-09-19 16:56:59 +02:00
Troy McConaghy
2f38f81ea9 Merge pull request #1747 from bigchaindb/docs/link-to-new-java-driver
Added link to new Java driver in the docs
2017-09-18 17:57:14 +02:00
muawiakh
4235618522 Addressing comments
- support public_network for vagrant box
- using python3-5 for centos based installations
- Revisiting docs.
  - More changes will be incorporated in another PR.
- Parameterize MongoDB host mount path for docker deployments
2017-09-18 15:59:49 +02:00
Troy McConaghy
3cbdc15e91 Only list the new Java driver in the docs 2017-09-14 17:29:23 +02:00
muawiakh
f2e1b4ac80 Automation for single node deployment for quickstart
- Change consists of two deployment models:
  - Using Vagrant(single node, with/without docker)
  - Using Ansible(single node, with/without docker)
- Updated quickstart documentation.
- Some WIP comments, which will be addressed later. Depending on the
  requirements.
2017-09-14 14:00:13 +02:00
krish7919 (Krish)
42b1233834 Doc fixes as per comments 2017-09-13 15:54:09 +02:00
krish7919 (Krish)
197a18e0bb Use Tectonic for Kubernetes 2017-09-13 15:54:09 +02:00
michielmulders
43ac6d72d5 Typo satisified -> satisfied 2017-09-13 11:00:15 +02:00
michielmulders
3dab5ae472 Typo requesing -> requesting 2017-09-13 10:58:40 +02:00
Troy McConaghy
3b40dcc197 Added link to new Java driver in the docs 2017-09-12 22:12:12 +02:00
krish7919 (Krish)
ac0dcd090e Bugfix in Deployment config 2017-09-11 11:57:58 +02:00
krish7919 (Krish)
1307f43306 Add livenessProbe 2017-09-11 11:57:58 +02:00
krish7919 (Krish)
f07df50041 BigchainDB Web Proxy to add headers to requests
Currently, the requests from public websites (like
`bigchaindb.com/getstarted` and tutorials.bigchaindb.com/crab) cannot have the
app_id and app_key required to access IPDB in the web page.

We pass such requests through a web proxy that adds the required headers
to any POST requests from `*.bigchaindb.com`.
2017-09-11 11:57:58 +02:00
Troy McConaghy
f003187777 Initial update to changelog for the v1.1 release 2017-09-09 21:21:26 +02:00
krish7919 (Krish)
5fbc3f4a6c Steps to restore from backup 2017-09-07 11:00:03 +02:00
krish7919 (Krish)
9445647be5 MongoDB data dir config change 2017-09-07 11:00:03 +02:00
Krish
2e40ad96f2 Minor fixes to k8s setup (#1735)
* Fix typo in docs

* Minor documentation fixes.

* Update mongodb monitoring agent to latest version.

* Update mongodb backup agent to latest version.

* Bugfix in mongodb backup agent.
2017-08-31 16:57:41 +02:00
Troy McConaghy
4175feb8b7 Merge pull request #1737 from bigchaindb/link-to-ruby-gem-from-docs
Added link to Ruby Gem by @nileshtrivedi
2017-08-31 15:23:19 +02:00
Troy McConaghy
e21f5e6551 Merge branch 'link-to-ruby-gem-from-docs' of github.com:bigchaindb/bigchaindb into link-to-ruby-gem-from-docs 2017-08-31 15:10:18 +02:00
Troy McConaghy
3c1c72f078 Added link to Ruby Gem by @nileshtrivedi
I added a link to the *bigchaindb* Ruby Gem by @nileshtrivedi 
on the *Drivers & Tools* page.
2017-08-31 15:06:09 +02:00
Sylvain Bellemare
1f42adeac4 Pin hypothesis so that it works with regex
related to #1738
2017-08-31 13:45:47 +02:00
Troy McConaghy
71ead91fbb Added link to Ruby Gem by @nileshtrivedi
I added a link to the *bigchaindb* Ruby Gem by @nileshtrivedi 
on the *Drivers & Tools* page.
2017-08-31 10:53:02 +02:00
Tom Carchrae
6271e4f674 persist mongo data between system restarts (don't use /tmp) (#1731) 2017-08-30 18:29:54 +02:00
Ahmed Muawia Khan
e41a378df4 Merge pull request #1720 from bigchaindb/remove-reclaim-policy-k8s-pvc
Remove persistentVolumeReclaimPolicy from the pvc request
2017-08-17 15:12:40 +02:00
Ahmed Muawia Khan
a05cdb4413 Merge pull request #1723 from bigchaindb/run-mma-mba-non-root
Run mongodb monitoring and backup agents as non-root user
2017-08-17 15:12:19 +02:00
Ahmed Muawia Khan
a3de849820 Merge pull request #1724 from bigchaindb/imporve-error-message-entrypoint
Improve error message for all bdb docker entrypoint scripts
2017-08-17 11:27:20 +02:00
Ahmed Muawia Khan
559b8ef7cf Merge branch 'master' into run-mma-mba-non-root 2017-08-17 11:26:57 +02:00
Ahmed Muawia Khan
ea32694435 Merge pull request #1721 from bigchaindb/common-secret-for-ca
Common secret for CA in secret.yaml
2017-08-17 11:07:35 +02:00
Muawia Khan
7658097221 Use env variables names for error messages
- Address comments
2017-08-17 10:46:19 +02:00
Muawia Khan
7ba6334bfc Fix volumeMounts for monitoring and backup agents 2017-08-17 10:31:03 +02:00
Ahmed Muawia Khan
2fc114a596 Merge pull request #1713 from bigchaindb/fix-multi-node-dep
Verify and fix BDB multi node deployment guide
2017-08-17 10:21:40 +02:00
Muawia Khan
8df38ff31c Fix typo in nginx-http-svc name 2017-08-16 16:35:46 +02:00
Muawia Khan
e446c31a41 More changes to multi-node deployment guide
- Integrating changes suggested by Krish.
- Addressing comments on initial commit.
2017-08-16 13:22:09 +02:00
Muawia Khan
d11c100ab5 Improve error message for all bdb docker entrypoint scripts
- If a mandatory variable is not specified, it will exit with the relevant
code and error message.
- For more verbosity, we will also echo the values for all the mandatory
variables.
2017-08-16 13:15:24 +02:00
Muawia Khan
0cf46b331f Verify and fix BDB multi node deployment guide
- Documentation support to add a new BDB node to an existing
  replica set, using x.509 certificates and SSL/TSL connections, across
  geographically dispersed clusters.
- Fix some documentation issues and add more references i.e.
  specifically about signing of MongoDB member certificates.
- Minor fixes for nginx-https-dep.yaml(invalid configMap var)
- Reconfigure nginx keep_alive between MongoDB front and backend ports.
- Editor removed whitespaces
2017-08-16 10:27:17 +02:00
Muawia Khan
650177c50e Run mongodb monitoring and backup agents as non-root user
- We need to modify the read permissions on the secrets and allow
the mongodb-mms-agent to read the credentials.
2017-08-15 15:59:08 +02:00
Muawia Khan
fbee5db40f Common secret for CA in secret.yaml
- Creating a common secret for CA, since all the members of the replica set
and the clients need to have a common CA, moving all the relevant configuration
to a common secret.
- Modifying Dockerfiles for some components, once changes are approved
we will publish the new images.
- No documentation changes required.
2017-08-15 14:26:47 +02:00
Muawia Khan
04b84f6ab4 Remove persistentVolumeReclaimPolicy from the pvc request
- Reclaim policy can only be specified when we explicitly create
a persistent Volume. Removing this from a persistent volume claim
request yaml.
2017-08-15 10:07:50 +02:00
vrde
e7640feaec
Merge branch 'block-publisher-plugin-arch' 2017-08-11 11:24:07 +02:00
vrde
2ee85d6c4a
Update URL to plugin example 2017-08-10 12:04:33 +02:00
Troy McConaghy
dfd6449342 Update cryptography.md 2017-08-09 18:48:44 +02:00
vrde
229a476aa0
Fix typos 2017-08-09 17:38:44 +02:00
Krish
26f43c15eb Update MongoDB Backup Agent to v5.7.0.641 (#1718) 2017-08-09 17:03:35 +02:00
vrde
0f139a1999
Fix typo 2017-08-09 16:35:12 +02:00
vrde
c4853f54b9
Add more coverage 2017-08-09 16:23:03 +02:00
vrde
05ff9cd61f
Add docs 2017-08-09 16:14:14 +02:00
vrde
a0cbb63db8
Rename things, add tests 2017-08-09 10:51:30 +02:00
Krish
3ce4a3d0c3 User service token instead of provider key in threescale-credentials kubernetes secret (#1717) 2017-08-09 10:41:51 +02:00
Troy McConaghy
1e06bd3aac Merge pull request #1711 from bigchaindb/docs/root-docs-update
Updates to the root docs
2017-08-09 10:31:15 +02:00
Troy McConaghy
2dc92a2851 Added blurb about economic incentives to help achieve immutability 2017-08-09 10:19:32 +02:00
Krish
c2d726d584 Support proper Websocket host and port settings in root API endpoint (#1715)
* Support proper Websocket host and port settings in root API endpoint

* Documentation change
2017-08-09 09:40:41 +02:00
Krish
3ec4153375 Support for advertised host, port, scheme for Websockets (#1703)
* Support for advertised host, port, scheme for Websockets

* Update docs

* Add a docstring

* Set env vars in Dockerfile-dev too
2017-08-08 12:04:58 +02:00
vrde
21a7da1c9d
Plugins can subscribe to specific events 2017-08-08 11:28:35 +02:00
vrde
8d72421d7c
Add PubSub 2017-08-08 11:28:35 +02:00
Troy McConaghy
e929658f14 Updated the page about BDB & smart contracts 2017-08-05 11:37:40 +02:00
Troy McConaghy
01453bc806 Updated text linking to the page about immutability 2017-08-05 11:33:06 +02:00
Troy McConaghy
e3c923958c Updated our stance on BFT in bft.md 2017-08-05 11:27:37 +02:00
Troy McConaghy
5864415d96 Updated page about how BigchainDB is immutable 2017-08-05 11:21:08 +02:00
Troy McConaghy
29776554cf Emphasize MongoDB over RethinkDB in terminology.md 2017-08-05 11:02:01 +02:00
Troy McConaghy
733f52be6c For Python stuff, we follow Python's version of SemVer 2017-08-05 10:59:21 +02:00
Troy McConaghy
74b4628b75 Update decentralized.md 2017-08-03 14:48:08 +02:00
vrde
f5f964d07a Merge pull request #1644 from ketanbhatt/feat/1546/http-api-logger-logs-path-and-method
HTTP API Logger logs request path and method too
2017-08-03 09:53:18 +02:00
vrde
6a020ef49b Merge pull request #1700 from bigchaindb/semver-policy
Update SemVer policy
2017-08-03 09:24:30 +02:00
vrde
ff6f9cf58f
Go back to Python SemVer 2017-08-03 09:07:05 +02:00
vrde
3efc5725b5
Add websocket interface 2017-08-03 09:07:05 +02:00
vrde
bcc4dd4b70
Add configuration defaults 2017-08-03 09:07:05 +02:00
vrde
7756181974
Add configuration to the Public API definition 2017-08-03 09:07:05 +02:00
vrde
7f42e0a3c3
Update SemVer policy 2017-08-03 09:07:04 +02:00
Sylvain Bellemare
024d3ada8f Update docs for docker-compose.rdb.yml change 2017-08-02 17:38:18 +02:00
Sylvain Bellemare
4e2423c3de Use more explicit names for docker-compose files 2017-08-02 17:38:18 +02:00
Sylvain Bellemare
6f1ad664fd Update image for k8s 2017-08-02 16:15:00 +02:00
Troy McConaghy
31c28c5d01 Merge pull request #1691 from bigchaindb/docs/1653/fix-old-http-response-example
Replaced old response to Root URL with a description of what to expect
2017-08-02 10:38:19 +02:00
Troy McConaghy
f2da3e0daa Update RELEASE_PROCESS.md 2017-08-02 10:00:09 +02:00
Troy McConaghy
f0a683df8a Added step to REL 2017-08-02 09:59:04 +02:00
michielmulders
00bbf479ed Merge pull request #1687 from bigchaindb/michielmulders-fix-verification
Update quickstart.md BDB server with verification and note to not close terminal (mongo)
2017-08-01 13:42:03 +02:00
michielmulders
b7426e52b2 Update Quickstart with requested changes
addition of 'but' 
removal trailing phrase inside parentheses
Url replaced with URL as it's still an acronym so it's written with capital letters
2017-08-01 13:40:38 +02:00
Rodolphe Marques
640c9cc5d6 Merge pull request #1643 from ketanbhatt/chore/679/rename-variable-validity
Rename validity to blocks_validity_status
2017-08-01 09:44:58 +02:00
Troy McConaghy
15ee56c114 Merge pull request #1706 from ivanbakel/err_line
Fixed error line missing from transaction.py
2017-07-31 18:28:50 +02:00
Isaac van Bakel
cb5125ecfa Fixed error line missing from transaction.py
The second instance of the recipients error message is missing a line,
making the message meaningless.
2017-07-28 20:35:06 +01:00
Troy McConaghy
7db977cdb5 Added how block order comes from MongoDB 2017-07-26 10:06:24 +02:00
Ahmed Muawia Khan
6f2c61d778 Merge pull request #1699 from bigchaindb/minor-update-k8s-prod-guide
Remove an invalid message in the k8s production deployment guide
2017-07-25 17:30:29 +02:00
Muawia Khan
64a81b3a2b Fix and invalid command in k8s production deployment guide
- The guide is incorrect and expects and error message in the
nginx with https+3scale integration section:
$ curl -X GET https://<cluster-fqdn>
The above command should not return an error since this workflow is supported.
Updating this to the relevant command that will return the expected response
for sanity checking.
$ curl -X GET http://<cluster-fqdn>:27017
2017-07-25 17:08:55 +02:00
Troy McConaghy
53b15aa723 Merge pull request #1654 from bigchaindb/docs/1615/explain-fulfillment-uri
Wrote more about how to calculate a fulfillment string
2017-07-24 16:53:15 +02:00
Troy McConaghy
0f0900102b Merge pull request #1671 from bigchaindb/docs/log-analytics-setup-via-gui
Added docs about OMS logging setup via web browser
2017-07-21 17:18:29 +02:00
Troy McConaghy
a0560fcd4c Merge pull request #1640 from bigchaindb/more-release-process-refinement
More refinements to the release process
2017-07-21 17:17:40 +02:00
Ahmed Muawia Khan
84ff0ad4a5 Merge pull request #1690 from bigchaindb/update-azure-kubernetes-docs
Update guide to setup bdb+kubernetes+azure setup
2017-07-21 15:38:16 +02:00
Muawia Khan
b56f8a6213 Update guide to setup bdb+kubernetes+azure setup
-- Fixed typos in the guide
-- Fixed some syntax errors in commandline instructions
-- Fixed strucuture of sample jsons
-- Fixed bugs in nginx-https-dep file, it was trying to access
an invalid variable in the configmap.
-- Improved some docs to give more clarity for the user.
Atleast all the issues I faced. :)
2017-07-21 15:01:20 +02:00
Ahmed Muawia Khan
f72a35ff11 Merge pull request #1682 from bigchaindb/fix-deps-server-quickstart
Keep minimal number of os-level deps for server quickstart
2017-07-21 14:57:09 +02:00
Muawia Khan
b4d1554612 Keep minimal number of os-level deps for server quickstart
-- Only libffi-dev and libssl-dev are enough for the bdb server
quickstart installation and they pull any dependant packages
recursively via apt.
2017-07-21 14:27:13 +02:00
Krish
a27cfdd89c Updating dependencies (#1692) 2017-07-21 13:36:29 +02:00
Troy McConaghy
5125997b2b Replaced old response to Root URL with a description of what to expect 2017-07-21 12:34:08 +02:00
Troy McConaghy
d323ad73c2 Merge pull request #1686 from bigchaindb/update-changelog-on-master-for-1.0.1
Updated the changelog on master for v1.0.1
2017-07-21 09:08:08 +02:00
michielmulders
21142f1ea0 Update quickstart.md with minor details
At point D, you start the mongo shell which is listening on port 27017 for incoming connections from BDB.
At point E, you don't mention to open a new terminal because you want to keep the mongo shell alive (or run it in background with addition of '&', however I prefer to see the mongo output). Being stupid me, I shut down the terminal which resulted in not being able to start BDB.

Beside that, I added a verification step to make sure that BDB server is running correctly.
2017-07-20 22:56:36 +02:00
Sylvain Bellemare
2f4d9fa171 Update changelog for v1.0.1
(cherry picked from commit 37d9fd72d05cf6aff4d5e22d8932f8b634838262)
2017-07-20 12:45:28 +02:00
Krish
8e6a94e158 Change imagePullPolicy in k8s configs (#1680) 2017-07-19 20:14:56 +02:00
Krish
dad96fe246 Fix broken travis build (#1684)
- Use RethinkDB and MongoDB docker containers rather than manually
install packages.
2017-07-19 18:16:48 +02:00
Krish
4c8b0fc828 Healthchecks for NGINX in nginx-http-dep.yaml and dev-setup/nginx-http.yaml (#1679) 2017-07-17 18:59:11 +02:00
Krish
e0efc2286a Simpler MongoDB Instance Configuration in K8s (#1678)
* Simpler configuration of MongoDB instance in a node

* Update docs for MDB configuration
2017-07-17 17:57:13 +02:00
Krish
9116836e4c Simpler BigchainDB Instance Configuration in K8s (#1677)
* Simpler configuration of BigchainDB instance in a node

* Update docs for BDB configuration

* Changes as per @ttmc's comments
2017-07-17 17:29:51 +02:00
Troy McConaghy
3946ab2f43 Merge pull request #1668 from bigchaindb/docs/1651/explain-condition-contents
New docs page regarding the contents of a condition
2017-07-17 14:48:03 +02:00
Krish
c640313003 Remove 3scale port number from configs (#1676)
* Remove 'threescale-api-port' from all configs in node setup

* Update docs - remove references to threescale-api-port

* Fix typo
2017-07-17 14:46:06 +02:00
Krish
b7e13fd087 Secure WebSocket Support (#1619)
* Remove support for whitelist

* Rename nginx to nginx-api

* Remove websocket support from nginx-api

* Change nginx to nginx-api service
The nginx-api service will proxy requests to the BigchainDB HTTP API.

* Rename ngx-instance-0 to ngx-api-instance-0 in nginx_3scale

* Update nginx-api service base docker image and README

* Add nginx-ws service to support Websocket

* Add config files for simple dev setup

* WS support with split NGINX

* NGINX module as single entrypoint into the cluster.

* Tested HTTP and WS with latest configs

* Openresty as separate service

* Remove upstream api port as configuration parameter

* Changes while testing

* Adding READMEs for nginx-http and nginx-https modules

* Documentation update

* Change 'Openresty' to 'OpenResty'.
2017-07-17 13:46:05 +02:00
Troy McConaghy
f576894b4c Merge pull request #1652 from bigchaindb/resolve-issue-1649
Removed old Terraform & Ansible templates
2017-07-17 12:08:34 +02:00
Krish
6bd6e7fddb Update MongoDB Backup Agent to v5.6.0.624 (#1674) 2017-07-14 10:02:38 +02:00
Troy McConaghy
3c76cd5f77 added docs re OMS logging setup via web browser 2017-07-13 17:21:18 +02:00
Ahmed Muawia Khan
8085f74075 Merge pull request #1663 from bigchaindb/k8s-mongo-memory-limit-fix
Fix for MongoDB hitting memory limit on k8s
2017-07-13 15:42:34 +02:00
Troy McConaghy
d6221b3d78 New docs page re contents of a condition 2017-07-13 12:03:03 +02:00
muawiakh
494e9a071d Fixing installation of bigchaindb 1.0.0 pyPackage for quickstart
- Quick start setup was broken because of a race condition with
using cryptoconditions in setup_requires and install_requires and
for a fresh Ubuntu 16.04 setup initialization of BigchainDB node
the python package installation fails due to package conflicts.
- Rest of the details are captured in the github issue #1657
2017-07-12 18:05:07 +02:00
muawiakh
b0106c0203 Fix for MongoDB hitting memory limit on k8s
- MongoDB StatefulSet hitting memory limit, so k8s restarts it.
We have had multiple instances of restarts lately.
-  Changing it to 3.5 GB, data and reasoning to back it up
is mentioned in the ticket #1655
2017-07-12 16:17:50 +02:00
Ahmed Muawia Khan
690d64cb8d Merge pull request #1648 from bigchaindb/minor-quickstart-doc-fix
Minor changes in quickstart guide
2017-07-12 13:04:32 +02:00
muawiakh
5526335aab Minor changes in quickstart guide
- Add build-essential and libssl-dev as pre-reqs
for bigchaindb installation
2017-07-12 10:12:11 +02:00
Troy McConaghy
66c0f94f78 Merge pull request #1646 from CsterKuroi/bug/1645/add-missing-table-assets
Bug/1645/add missing table assets
2017-07-11 17:39:23 +02:00
Troy McConaghy
ab2b8aee21 Wrote more about how to calculate a fulfillment string 2017-07-11 13:34:48 +02:00
Troy McConaghy
157e2683de Removed old Terraform & Ansible templates 2017-07-11 11:07:43 +02:00
KURO1
3e6948bca4 Add the missing table asset in backend.schema 2017-07-10 17:54:04 +08:00
Ketan Bhatt
684fffe917 HTTP API Logger logs request path and method too 2017-07-09 16:44:21 +05:30
Ketan Bhatt
4056f315ae Rename validity to blocks_validity_status 2017-07-09 12:22:39 +05:30
libscott
e8ee39463f MongoDB socket timeout to handle master re-election (#1638)
* add a socket timeout so that changefeeds can reconnect if theres a re-election

* fix threshold max depth at 100
2017-07-06 19:50:28 +02:00
Sylvain Bellemare
c80ba6f3b5 Fix mistakenly changed MongoDB version 2017-07-06 14:49:21 +02:00
Troy McConaghy
23d0994579 Merge pull request #1639 from bigchaindb/switch-version-in-version-py-to-1.1.0.dev
Switch version in version.py to 1.1.0.dev
2017-07-06 10:09:38 +02:00
Troy McConaghy
6d9cc17861 Push to GitHub, not 'master' 2017-07-05 17:03:35 +02:00
Troy McConaghy
f7f10130c9 More improvements to RELEASE_PROCESS.md 2017-07-05 17:00:17 +02:00
Troy McConaghy
74c57d3e2b Changed version in version.py to 1.1.0.dev 2017-07-05 15:36:22 +02:00
Troy McConaghy
d5f3f74179 Resolved issue #1632 in RELEASE_PROCESS.md 2017-07-05 14:53:33 +02:00
Troy McConaghy
fc0ec050f1 Updated version.py for the 1.0.0 release 2017-07-05 14:48:17 +02:00
Troy McConaghy
c62f831f22 Merge pull request #1634 from bigchaindb/update-bdb-tag-in-k8s-dep
Updated BDB Docker tag from 1.0.0rc1 to 1.0.0 in k8s deployment
2017-07-05 11:28:06 +02:00
Troy McConaghy
e2d96af46e Merge pull request #1629 from bigchaindb/changelog-for-1.0.0
Change Log Updates for 1.0.0
2017-07-05 11:11:13 +02:00
Troy McConaghy
923df8f64f Updated BDB Docker tag from 1.0.0rc1 to 1.0.0 in k8s deployment 2017-07-05 10:52:31 +02:00
Troy McConaghy
48f295da9b Merge remote-tracking branch 'origin/master' into changelog-for-1.0.0 2017-07-05 10:46:51 +02:00
Troy McConaghy
e7d1ffd58c Merge pull request #1633 from bigchaindb/fix-doc-broken-link
Fixed broken reference
2017-07-05 10:44:00 +02:00
Rodolphe Marques
5e1480abd7 Fixed broken reference 2017-07-05 10:14:40 +02:00
Rodolphe Marques
da574e909d Merge pull request #1547 from bigchaindb/upgrade-guides
[WIP] Upgrade guide BDB v0.10 -> v1.0
2017-07-05 10:08:20 +02:00
Troy McConaghy
34a4fedf39 Set the 1.0.0 release date as 2017-07-05 2017-07-05 09:28:57 +02:00
Troy McConaghy
68b1ed6206 Merge pull request #1621 from bigchaindb/rename-drivers-and-clients-section
Renamed 'Drivers & Clients' section 'Drivers & Tools'
2017-07-04 16:31:49 +02:00
Rodolphe Marques
f9c24d8db7 Renamed output -> output_index in the outputs endpoint example 2017-07-04 16:04:24 +02:00
Troy McConaghy
299e6a6971 updated changelog re pull request #1612 2017-07-04 14:40:19 +02:00
vrde
b06a8b3cc5
Merge branch 'strip-content-type-from-gets' 2017-07-04 14:19:16 +02:00
vrde
8457cb35eb
Add middleware to strip content-type headers from GETs 2017-07-04 14:01:56 +02:00
Troy McConaghy
43c67aed92 First draft of change log for 1.0.0 2017-07-04 11:41:54 +02:00
Troy McConaghy
60ca16f56e Merge pull request #1624 from bigchaindb/cost-not-fulfillment-length
Changed 'fulfillment length' to 'cost' and added link re cost
2017-07-03 17:50:39 +02:00
Krish
e8411fc99e Do not allow duplicate GENESIS block creation - #1556 (#1612)
* Add a check for GENESIS transaction

* Add test and fixture

* Removed database query for GENESIS block

* Undo log level change
2017-07-03 17:21:15 +02:00
Troy McConaghy
9f090f7601 'fulfillment length' --> 'cost' and add link re cost 2017-07-03 17:14:41 +02:00
Krish
ece195ff8d Deployment changes: (#1623)
Update MongoDB container tag to `3.0`.

Doc change to reflect bdb-config.bdb-user parameter usage.

Fix typo in configuration.md.

Add BIGCHAINDB_DATABASE_SSL parameter to bigchaindb-dep.yaml for
Kubernetes deployments.

Refer the the `bdb-user` parameter from ConfigMap in
bigchaindb-dep.yaml.

Consolidate all BigchainDB parameter values under the
`bdb-config` ConfigMap.

Remove `bdb-user` from secrets.yaml.
2017-07-03 15:55:43 +02:00
Rodolphe Marques
e89623c836 Merge pull request #1470 from bigchaindb/fix/outputs-public-keys-validate
check output conditions with single statement (#1450 unrevert)
2017-07-03 15:46:46 +02:00
Troy McConaghy
9c96147b23 Merge pull request #1573 from bigchaindb/update-server-docs-re-cc
Restructured & Revised the "Inputs and Outputs" Page of the Server Docs for v1.0
2017-07-03 15:28:38 +02:00
Sylvain Bellemare
26f14aadec Parametrize websocket api tests for docker 2017-07-03 15:23:50 +02:00
Sylvain Bellemare
4d61c5e8ca Refine the condition uri regex for validation
closes #1516
2017-07-03 15:08:47 +02:00
Troy McConaghy
e615e28cc4 output --> output_index & removed unneeded para. 2017-07-03 14:52:40 +02:00
Rodolphe Marques
9033ba76f8 Remove unnecessary output_has_owner method.
- Refactor the code
2017-07-03 14:30:19 +02:00
Rodolphe Marques
aaf4fcb91e Merge remote-tracking branch 'origin/master' into fix/outputs-public-keys-validate 2017-07-03 14:15:40 +02:00
Troy McConaghy
46bb1d6d12 Merge pull request #1620 from bigchaindb/edit-steps-15-plus-in-k8s-dep-docs
More edits/fixes to k8s deployment docs & bigchaindb-dep.yaml
2017-07-03 14:10:44 +02:00
Troy McConaghy
32bdfa0214 Merge pull request #1586 from bigchaindb/update-tx-model-docs-page
Revised & updated the docs page re the transaction model
2017-07-03 14:09:41 +02:00
Troy McConaghy
989914dcab Merge pull request #1622 from bigchaindb/remove-g-group-link-from-readme
Removed the link to the Google Group from README.md
2017-07-03 13:59:46 +02:00
Sylvain Bellemare
3bec24860e Update change log for v0.10.3 2017-07-03 11:49:49 +02:00
Sylvain Bellemare
dae0bdb1e5 Pin minor+ version of cryptoconditions & logstats 2017-07-03 11:49:49 +02:00
Troy McConaghy
c24138eb0a Merge branch 'master' into update-server-docs-re-cc 2017-07-03 09:32:30 +02:00
Troy McConaghy
fa2d98b3c7 Removed link to the Google Group from README.md 2017-07-02 11:59:05 +02:00
Troy McConaghy
9ccecd2761 Renamed 'Drivers & Clients' section 'Drivers & Tools' 2017-07-02 11:52:08 +02:00
Troy McConaghy
07b5e0e5da Formatted & copy-edited steps 16-17.2 2017-07-02 11:23:40 +02:00
Troy McConaghy
4e45932ac3 Clarified some MDB Cloud Manager instructions 2017-06-30 15:54:48 +02:00
Troy McConaghy
ca394bbb93 Fixed indent of ConfigMap ref to BDB public key 2017-06-30 15:11:48 +02:00
Troy McConaghy
97acc4f216 Updated docs re BDB k8s deployment 2017-06-30 15:00:34 +02:00
Krish
b33f718097 Use ConfigMap values in bigchaindb-dep.yaml (#1618)
* Use ConfigMap values in bigchaindb-dep.yaml

* Removed comments from top of bigchaindb-dep.yaml

Because they didn't add much information and they also contained a dated Docker Hub version tag.
2017-06-30 14:59:14 +02:00
Troy McConaghy
d99c7069e0 Merge remote-tracking branch 'origin/master' into update-tx-model-docs-page 2017-06-30 13:44:04 +02:00
Krish
dea77d32a5 Add documentation on exposed ports in k8s/nginx (#1610)
* Add documentation on exposed ports in k8s/nginx

* Clarity on port and targetPort parameters
2017-06-30 13:37:41 +02:00
Troy McConaghy
8e6a86721c Merge pull request #1616 from bigchaindb/update-tags-of-mdb-agents
Updated Docker image tag in MongoDB agent Deployment YAML files
2017-06-30 11:27:34 +02:00
Troy McConaghy
5c909c99a5 Merge pull request #1571 from bigchaindb/update-root-docs-re-cc
Updated crypto-conditions-related root docs
2017-06-30 11:25:18 +02:00
Troy McConaghy
c7a6544070 Updated Docker image tag in MongoDB agent Deployment YAML files 2017-06-30 11:09:19 +02:00
Troy McConaghy
3dd30365ee Merge pull request #1614 from bigchaindb/editing-node-on-k8s-page
Editing node on k8s page
2017-06-30 10:12:48 +02:00
Troy McConaghy
1fc2c39157 Merge pull request #1567 from bigchaindb/minor-edits-to-config-settings-docs
Minor edits to configuration settings docs
2017-06-30 10:09:37 +02:00
Troy McConaghy
fa1c4843d5 Mention that the signature in 'fulfillment' is encoded 2017-06-30 09:51:35 +02:00
libscott
5e9b7f4ffe Remove condition details signature, rename subfulfillments to subconditions (#1589)
* implement output.condition.details marshalling and remove signature field

* rename outputs[].condition.details.subfulfillments to subconditions

* simpler threshold depth overlow handling

* pass public_key as kwarg

* change ccv1 condition uri in docs

* import base58 at top in test_transaction
2017-06-30 09:44:22 +02:00
Troy McConaghy
7913e8730b 'tranfer-enablers' --> 'transfer-enablers' (× 3) 2017-06-30 09:42:29 +02:00
libscott
b1ad6045b6 Rename "output" to "output_index" in /api/v1/outputs (#1596)
* rename output to output_index in /api/v1/outputs

* rename transaction.input.fulfills.output to output_index

* fix rethinkdb queries for output_index
2017-06-30 09:40:50 +02:00
Troy McConaghy
8ef6385a8c Merge pull request #1584 from bigchaindb/release-process-mods
Minor modifications to the Release Process
2017-06-29 17:11:14 +02:00
Troy McConaghy
69cdfd56cf Added note about what to expect from MongoDB's db.auth() command 2017-06-29 17:02:23 +02:00
Troy McConaghy
6b6bfe1733 Explained how to log in to the MongoDB pod 2017-06-29 16:39:01 +02:00
Troy McConaghy
92ec8f613e Fixed spelling & grammar stuff in docs re MDB StatefulSet 2017-06-29 16:02:34 +02:00
Troy McConaghy
1034db1ce5 Fixed name of https-certs volume mount in nginx-3scale-dep.yaml 2017-06-29 15:32:08 +02:00
Troy McConaghy
a72bf56089 copyedited docs re assigning DNS name to NGINX public IP 2017-06-29 15:09:27 +02:00
Troy McConaghy
d3924213ee edits in nginx-3scale service docs 2017-06-29 14:35:23 +02:00
libscott
70b60562d8 Document graphite configuration parameter (#1594)
* document graphite configuration parameter

* add example

* graphite settings docs follows wsserver

* Removed outer JSON braces @ graphite.host docs
2017-06-29 14:19:08 +02:00
Troy McConaghy
d88f1e2dcd Merge pull request #1598 from bigchaindb/more-prod-depl-template-copyedits
More prod depl template copyedits
2017-06-29 14:03:04 +02:00
Troy McConaghy
5bf1081f0a Merge pull request #1554 from bigchaindb/document-ws-scheme-setting
Added more docs about the wsserver.scheme config setting
2017-06-29 12:06:10 +02:00
libscott
5442cc1f2f output -> output_index 2017-06-29 11:34:45 +02:00
Troy McConaghy
54e0fc4f57 Clarify the required SSL cert order in cert chain 2017-06-29 11:28:51 +02:00
Troy McConaghy
7b80bb5819 If not using 3scale, they can also leave vals blank 2017-06-29 11:09:16 +02:00
Troy McConaghy
5687735b24 removed 2 instances of 'inside double quotes' 2017-06-29 11:00:17 +02:00
Troy McConaghy
0f169a430b Explained how to get 3scale credentials 2017-06-28 17:42:32 +02:00
Troy McConaghy
0feaafef2b entire HTTPS cert chain is needed in secret.yaml 2017-06-28 16:40:52 +02:00
Troy McConaghy
1d6a7624f4 Removed un-needed trailing comma in secret.yaml 2017-06-28 15:44:39 +02:00
Troy McConaghy
c58bd49b91 clarifications in docs re config-map.yaml 2017-06-28 15:44:39 +02:00
Troy McConaghy
52e097ccba Fixed typo in az acs create command 2017-06-28 15:44:39 +02:00
Krish
d92f5f2024 Documentation changes (#1595)
* Add documentation for `bdb-user` parameter

* Remove the bdb-keyfile-passphrase parameter

* Formatting changes in bdb-certs.bdb-user subsection
2017-06-28 15:35:26 +02:00
Scott Sadler
3d99d192c6 add condition details upgrade section 2017-06-28 00:56:16 +02:00
libscott
69a07b282d remove federation test that is failing sometimes in the case of RethinkDB (#1587) 2017-06-27 15:27:49 -07:00
Troy McConaghy
a22c44b2e8 Merge pull request #1591 from bigchaindb/copyedit-mongodb-ssl-cert-docs
Copyedited MongoDB SSL Certificate Setup Docs
2017-06-27 14:01:49 +02:00
Troy McConaghy
1a1984f545 More clarifications to the MongoDB SSL cert instructions 2017-06-27 11:15:40 +02:00
vrde
1b9fd1b08c
Rename upgrade guide 2017-06-26 17:44:38 +02:00
Troy McConaghy
3a24e7d9b4 List what the self-signed CA should return to the node operator 2017-06-26 15:54:09 +02:00
Troy McConaghy
6fd5f21638 Improved instructions for Self-Signed CA setup 2017-06-26 15:34:03 +02:00
Troy McConaghy
e91e3a79c4 Made Easy-RSA config steps clearer. 2017-06-26 15:17:56 +02:00
Troy McConaghy
e0452840bf Note how many inputs CREATE & TRANSFER txs should have 2017-06-23 15:08:02 +02:00
Troy McConaghy
a92ca862fc Revised & updated the docs page re the tx model 2017-06-23 14:57:02 +02:00
Troy McConaghy
998ff34c4b Renamed Release_Process.md to RELEASE_PROCESS.md 2017-06-23 11:51:00 +02:00
Troy McConaghy
39a200e9dd Note re creating PR on GitHub & waiting for tests to pass 2017-06-23 11:49:18 +02:00
Troy McConaghy
164cd47225 Note re Python form of semantic versioning in Release Process doc 2017-06-23 11:47:22 +02:00
Sylvain Bellemare
3aab15d398 Switch version to development mode 2017-06-23 11:39:23 +02:00
Sylvain Bellemare
190a623226 Update kubernetes docker image version 2017-06-23 10:50:49 +02:00
Sylvain Bellemare
e74e32d6ea Bump version to 1.0.0rc1 2017-06-23 10:50:49 +02:00
Rodolphe Marques
17913dca68 remove drivers from non breaking change promise 2017-06-23 10:10:14 +02:00
Troy McConaghy
9188fc017a Merge pull request #1561 from bigchaindb/update-changelog-for-v1.0.0rc1
Change log for v1.0.0rc1
2017-06-23 09:48:20 +02:00
Troy McConaghy
47252eabc0 Set the release date of v1.0.0rc1 to 2017-06-23 in CHANGELOG 2017-06-23 09:28:05 +02:00
Rodolphe Marques
b025dd1fed added a note about the version change in the transaction 2017-06-22 22:55:51 +02:00
Troy McConaghy
3efac22b3c CHANGELOG: Added note how 'version' must be '1.0' in transactions 2017-06-22 16:52:22 +02:00
libscott
074e783088 tx version break step with server version (#1574)
* tx version break step with server version
* fix regular expression for tx version
* restore docstring for Transaction version parameter
* add test for correct transaction version
2017-06-22 07:50:42 -07:00
Troy McConaghy
35c3909c25 Noted PR #1552 in the CHANGELOG 2017-06-22 16:32:57 +02:00
Krish
9ceea89537 Enable Auth over TLS connections (#1552)
* Changes to support auth on the infrastructure
* Auth over TLS/SSL support in BigchainDB, MongoDB, Monitoring Agent, Backup Agent
* Update certificates: Different OUs specified now
* Code formatting
- Make flake happy!
* Raise proper authentication failed error
* Documentation changes for auth
* Support auth in k8s deployment
* Commit certs for monitoring and backup agents
* Configuration to allow Cloud Manager Backup Agent to backup data
* Update docs and remove authentication error
2017-06-22 16:32:04 +02:00
Troy McConaghy
4277c6b857 Added note re switching to crypto-conditions version 02 2017-06-22 15:14:06 +02:00
Troy McConaghy
31e3dd224c Note re PR #1450 in CHANGELOG 2017-06-22 15:10:10 +02:00
Sylvain Bellemare
02fe712c34 Integrate cryptoconditions version 02 2017-06-22 14:56:22 +02:00
Krish
a175f371b0 Bump up nginx-3scale version number (#1575) 2017-06-22 14:05:37 +02:00
vrde
0b4c067129 Merge pull request #1540 from bigchaindb/handle-exception-if-conn-closed
Add exception handling
2017-06-22 14:03:54 +02:00
Troy McConaghy
932a17853b docs: restructured & revised the Inputs and Outputs page for v1.0 2017-06-22 09:51:11 +02:00
Sylvain Bellemare
99a73cfeae Add support for Python 3.6
closes #1565
2017-06-21 17:10:45 +02:00
Troy McConaghy
1efb3e6db4 Updated CC-related root docs 2017-06-21 15:01:35 +02:00
Troy McConaghy
6c4b7e4373 Merge pull request #1570 from bigchaindb/bug/1568/fix-statuses-error-msg
Fixed error message when GET /api/v1/statuses
2017-06-21 10:51:07 +02:00
Troy McConaghy
6436e78788 Merge pull request #1524 from bigchaindb/edit-docs-re-tx-validity
Edited root docs regarding transaction validity
2017-06-21 10:22:23 +02:00
Troy McConaghy
869e3c978f Fixed error message when GET /api/v1/statuses
Fixes #1568
2017-06-21 10:18:57 +02:00
Troy McConaghy
3ca11c1f69 Emphasize MongoDB over RethinkDB in configuration.md 2017-06-20 17:40:08 +02:00
Troy McConaghy
3229e2e262 docs: changed the * symbol to × for multiplication. 2017-06-20 17:32:22 +02:00
Troy McConaghy
3aeb20afd3 Changed some ticks to backticks in configuration.md 2017-06-20 17:27:51 +02:00
Troy McConaghy
9e247f9318 Removed all mentions of BIGCHAINDB_SERVER_THREADS 2017-06-20 17:22:40 +02:00
Troy McConaghy
11dc570872 Added a link to the post 'What is a Valid Transaction in BigchainDB?' 2017-06-20 16:41:26 +02:00
Troy McConaghy
2c53dfcd57 Added note re dropping support for Python 3.4 2017-06-20 16:20:44 +02:00
Troy McConaghy
8f46f51e97 Made CHANGELOG edit suggested by @krish7919 2017-06-20 16:14:51 +02:00
Sylvain Bellemare
3fec83d2e2 Drop support for Python 3.4
closes #1353
2017-06-20 15:26:23 +02:00
Sylvain Bellemare
6d4b9385e4 Upgrade pip in dockerfile 2017-06-20 11:45:39 +02:00
Sylvain Bellemare
5b06af3a02 Split docker-compose for mongo and rethink 2017-06-20 11:45:39 +02:00
Troy McConaghy
0e8d6944a8 First draft of change log for v1.0.0rc1 2017-06-20 10:03:54 +02:00
Krish
01474c002c Update docs with SSL environment variables (#1536)
* Update docs with TLS env variables

* Document ssl, login and password env vars

* Update docs and add default values in example configuration
2017-06-16 15:27:56 +02:00
Krish
c4bcd38fc6 Bug while running travis tests (#1555) 2017-06-16 14:28:56 +02:00
Krish
bca835fed7 Cloud manager GroupID update (#1551)
* Update docker image for mongodb monitoring agent

* Update docker image for mongodb backup agent

* Update secret.yaml and documentation with GroupID requirement

* Delete redundant lines from config file from entrypoint script

* Rename secret and keys
2017-06-16 14:10:21 +02:00
Troy McConaghy
e41ac6c634 Added docs about the wsserver.scheme config setting 2017-06-16 13:22:01 +02:00
Rodolphe Marques
571ee83731 Merge pull request #1545 from bigchaindb/bug/1214/fix-outputs-endpoint
Bug/1214/fix outputs endpoint
2017-06-16 10:59:47 +02:00
Rodolphe Marques
842664cb14 Improved documentation
- fixed test name
2017-06-16 10:31:46 +02:00
Rodolphe Marques
b523ba3fe5 Rename unspent -> spent in outputs endpoint
- If spent=None return all outputs
- If spent=True return only spent outputs
- If spent=False return only unspent outputs
- Updated documentation
- Add the ability to return only spent outputs in core
- Added and update tests
2017-06-16 10:31:46 +02:00
Rodolphe Marques
8d60796765 Merge pull request #1541 from bigchaindb/feat/1525/inconsistency-relative-links
Remove relative links
2017-06-16 10:30:20 +02:00
Tim Daubenschütz
ced4058e68 Merge pull request #1538 from bigchaindb/feat/1441/remove-host-and-port
Feat/1441/remove host and port
2017-06-16 10:22:16 +02:00
Rodolphe Marques
4d1131d90c Remove links from statuses endpoint
- Updated documentation
- Updated tests
2017-06-16 10:01:45 +02:00
Rodolphe Marques
446e454a77 outputs endpoint returns list of objects instead of links
- Updated documentation
- Updated tests
2017-06-16 10:01:45 +02:00
tim
555e823781 Resolve TODO configurable ws endpoint 2017-06-16 09:58:51 +02:00
tim
bd0d79d399 Allow scheme configuration for ws-server 2017-06-16 09:55:46 +02:00
tim
673062f892 Remove host+port from / and /api/v1/ 2017-06-16 09:52:47 +02:00
Rodolphe Marques
dda6517451 Merge pull request #1532 from bigchaindb/feat/1531/consistent-naming
Consistent naming of `transaction_id`
2017-06-16 09:50:43 +02:00
Tim Daubenschütz
41805de0c2 Merge pull request #1543 from bigchaindb/feat/1038/fix-tx-endpoint
Fix /transactions/id endpoint
2017-06-16 09:50:06 +02:00
Troy McConaghy
ae6123cdd9 Merge pull request #1548 from bigchaindb/update-production-ready-page
Updated the root docs page titled "Production-Ready?"
2017-06-15 17:13:29 +02:00
tim
babe5311a4 Link to upgrade guides from /docs 2017-06-15 17:04:51 +02:00
tim
ac6183475b First cut HTTP API and WebSocket API changes 2017-06-15 17:03:51 +02:00
Troy McConaghy
da08f08c6a Updated the root docs page titled Production-Ready? 2017-06-15 16:09:40 +02:00
Rodolphe Marques
c2e44d99d4 Merge pull request #1529 from bigchaindb/feat/1147/consolidate-root-urls
Consolidate root urls
2017-06-15 15:05:31 +02:00
Rodolphe Marques
263c0b04d5 update data models documentation 2017-06-15 15:04:09 +02:00
tim
9cb6904c4e Breaking changes to data model 2017-06-15 14:49:22 +02:00
Troy McConaghy
d1a4aa28a6 Merge pull request #1544 from bigchaindb/update-docs-re-vote-model
Updated the docs page about the vote model
2017-06-15 14:38:31 +02:00
Troy McConaghy
262dd06f68 Updated the docs page about the vote model 2017-06-15 13:44:04 +02:00
Troy McConaghy
0f4998ef16 changed hard-coded URL in docs link to a :ref: 2017-06-15 10:04:49 +02:00
tim
275f29cfe4 Add note for polling and WS API when POST /transactions 2017-06-14 17:40:12 +02:00
Troy McConaghy
9b5d1f323e Merge pull request #1527 from bigchaindb/revise-clusters-section-of-docs
Revised the "Clusters" Section of the Docs
2017-06-14 17:19:24 +02:00
tim
eb791aa2ce Include Location header in POST /transactions 2017-06-14 16:53:22 +02:00
tim
6cedab47a1 /transactions/ID only returns VALID transactions 2017-06-14 15:42:04 +02:00
vrde
55e766ce07
Add exception handling 2017-06-14 11:49:05 +02:00
Sylvain Bellemare
828885265d Update benchmark python script 2017-06-14 11:00:50 +02:00
Sylvain Bellemare
f06e5034a4 Move benchmark to its own compose file 2017-06-14 11:00:50 +02:00
Sylvain Bellemare
4ea0bd7b44 Remove /data volume reference for config 2017-06-14 11:00:50 +02:00
Rodolphe Marques
cc9c8a4d0d fixed broken test 2017-06-14 10:51:57 +02:00
Rodolphe Marques
03ba6391c6 updated tests for the events api 2017-06-14 10:38:23 +02:00
Rodolphe Marques
f1a9650679 Consistent naming on the events api 2017-06-14 10:36:23 +02:00
Rodolphe Marques
fa04899003 Merge remote-tracking branch 'origin/feat/1147/consolidate-root-urls' into feat/1531/consistent-naming 2017-06-14 10:19:01 +02:00
vrde
e5ca42a159 Merge pull request #1483 from bigchaindb/remove-useless-options-from-cors
Remove useless options from CORS
2017-06-13 16:23:07 +02:00
Sylvain Bellemare
10e2ce1796 Add build arg to dockerfile & docker-compose (dev) 2017-06-13 16:08:28 +02:00
Rodolphe Marques
05a6653d5f Fixed web related tests 2017-06-13 12:31:49 +02:00
Rodolphe Marques
7ffea9e8a4 Renamed tx_id to transaction_id
- Documentation
- Api
2017-06-13 12:24:04 +02:00
Krish
f35f01f1cb Add SSL support for MongoDB connections (#1510)
* Add SSL support for MongoDB connections

* Tests for TLS connectivity and other fixes

* Add test for ssl parameters

* Add test for AuthenticationError

* Cleanup branch

* Split env vars as per @r-marques suggestion

* Remove SSL_ENABLED and use BIGCHAINDB_DATABASE_SSL instead

* Changes as per comments from @r-marques

* Remove redundant tests

* Test for ConfigurationError
2017-06-13 12:04:34 +02:00
Rodolphe Marques
3ecb05a62d Renamed txid to transaction_id in data models
- Updated schema validation
- Updated database schema
- Updated database queries
- Fixed tests
2017-06-13 11:36:58 +02:00
Rodolphe Marques
27b1292497 Renamed streams_v1 to streams
- Updated tests
- Updated documentation
2017-06-12 17:39:49 +02:00
Rodolphe Marques
e0e27dc121 Consolidate root urls
- All information added to root url `/`
- Information specific to v1 under `/api/v1`
- Removed `_links`
- Removed `self`
2017-06-12 15:13:42 +02:00
libscott
32fc9244e6 Benchmark for CREATE transactions (#1511)
* benchmark code, throughput stats collection with graphite

* benchmarks readme

* benchmark readme update with results

* Update README.md

* add comment on why 10000 backlog size in benchmark
2017-06-10 10:01:28 +02:00
Troy McConaghy
63477d1819 Fixed typo & changed 'organization' to 'consortium' 2017-06-09 17:20:51 +02:00
Troy McConaghy
09e583a01c Merge pull request #1526 from bigchaindb/copyedit-follow-up-to-pr-1497
Copyedit follow-up to PR #1497
2017-06-09 17:09:50 +02:00
Troy McConaghy
945ed81038 Responses to review comments from @krish7919 on #1526 2017-06-09 14:32:39 +02:00
Troy McConaghy
14bd9e15ba Rewrote the docs page about Clusters 2017-06-09 13:49:02 +02:00
Troy McConaghy
7a5fc2978d Changed 'clusters-feds' section to a single-page 'clusters' section 2017-06-09 10:40:34 +02:00
Troy McConaghy
f807495e92 Moved page re RethinkDB-based AWS testing cluster to Appendices 2017-06-09 10:26:01 +02:00
Troy McConaghy
e1082af385 Added clarifying comments to secret.yaml 2017-06-08 17:42:30 +02:00
Troy McConaghy
03e9020909 Added helper comments to config-map.yaml 2017-06-08 17:41:38 +02:00
Troy McConaghy
3f3b2f91b8 Reorganized docs page re/ config-map.yaml & secret.yaml 2017-06-08 17:40:43 +02:00
Troy McConaghy
a3dfaedfe1 Fixed hyperlink 2017-06-08 17:39:15 +02:00
Troy McConaghy
1dd2a779e7 Docs: Clarified how to get MongoDB Agent API Key 2017-06-08 17:37:30 +02:00
Troy McConaghy
1d4a6e470c Copy-edited some docs 2017-06-08 17:36:41 +02:00
Troy McConaghy
d4a00e19c7 Edit: noun 'back up'-->'backup' 2017-06-08 17:33:42 +02:00
libscott
c9b5637681 Merge pull request #1518 from bigchaindb/require_asset_data
Require asset.data for CREATE and asset.id for TRANSFER in the schemas
2017-06-08 13:22:04 +02:00
Troy McConaghy
0e23cf0cf9 Merge pull request #1521 from bigchaindb/bug/1504/fix-how-to-update-azure-cli-2.0
Improved docs about how to update the Azure CLI 2.0
2017-06-08 12:08:57 +02:00
Troy McConaghy
a20dbffa38 Docs section on tx validity checklist now refers to blog post 2017-06-08 11:22:45 +02:00
Troy McConaghy
cb5e9fefa6 Fixed an old error in Markdown-->RST conversion 2017-06-08 11:14:41 +02:00
Troy McConaghy
0592f3c45b Improved docs for how to update Azure CLI 2.0 2017-06-07 17:15:36 +02:00
Troy McConaghy
0472006024 Merge pull request #1519 from bigchaindb/update-docs-re-digital-asset-model
Updated some docs about the asset model
2017-06-07 16:59:14 +02:00
Troy McConaghy
f58425d57a Merge pull request #1520 from bigchaindb/redo-pr-1493
Redid PR #1493
2017-06-07 16:57:44 +02:00
Troy McConaghy
b6f7e6307a Redid PR #1493 2017-06-07 16:45:42 +02:00
Troy McConaghy
e280b24f54 Updated some docs about the asset model 2017-06-07 16:19:50 +02:00
Scott Sadler
622885aef8 require asset.data for CREATE and asset.id for TRANSFER in the schemas 2017-06-07 13:39:24 +02:00
krish7919 (Krish)
ec40972334 Rearrange steps in documentation 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
b609eb878e Cloud Manager steps changes as per new UI 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
b70cf86192 'Refer to' instead of 'refer' typo fix 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
50813aa162 Fix typos in the example names for backup and monitoring agent 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
b1ff469e2a Rearrange points in StatefulSet creation docs 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
2cde05a204 Remove redundant configs in nginx-dep.yaml 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
9f5bad6498 Changes as per @ttmc's comments
- Renumbered steps in documentation
- Clarification on DNS prefix name
- Removed redundant port mappint in nginx-svc.yaml file
2017-06-06 10:01:53 +02:00
krish7919 (Krish)
ededd2a0fe Fixing typo in docs 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
8c80f72c40 Update documentation about file paths 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
99fb96c9c6 Update description in documentation 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
5eb2a4af16 Remove reference to deprecated ConfigMap mdb-fqdn 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
75c33dbcf1 Remove base 64 encoding requirement from ConfigMap 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
e37a8c37fd Remove step from documentation 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
36b4871ecd Add links in workflow document 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
8fb1c0be8b Update docs to reflect TLS setup 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
54189ba418 Credential management using Secrets in nginx
Support for websocket port in nginx
2017-06-06 10:01:53 +02:00
krish7919 (Krish)
af966f56df Credential management using Secret in nginx_3scale 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
cf10d3199e Support for TLS connections in MongoDB StatefulSet 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
06f0f8d95e Support for TLS connections in MongoDB Monitoring Agent 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
ff12d0aafc Support for TLS connections in MongoDB Backup Agent 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
7208310111 Global ConfigMap and Secret 2017-06-06 10:01:53 +02:00
krish7919 (Krish)
fe0bd625dc Update to easyrsa steps 2017-06-06 10:01:53 +02:00
Troy McConaghy
0c1b30b59d Merge pull request #1498 from bigchaindb/py-script-to-analyze-nginx-logs
More docs re/ OMS logs + a script to analyze NGINX logs
2017-06-02 10:32:06 +02:00
Rodolphe Marques
edf2edac5b Merge remote-tracking branch 'origin/master' into fix/outputs-public-keys-validate 2017-06-01 17:24:12 +02:00
Rodolphe Marques
066ec71333 Remove unnecessary if statement 2017-06-01 17:07:26 +02:00
Troy McConaghy
b7a9129550 Merge pull request #1500 from bigchaindb/js-driver-is-maintained-by-us
Docs: The JS driver is maintained by the BDB team
2017-06-01 17:01:16 +02:00
Rodolphe Marques
c7197cecdf Merge pull request #1512 from bigchaindb/init-timeout-rethinkdb-conn
Init timeout rethinkdb conn
2017-06-01 15:41:11 +02:00
Rodolphe Marques
54ab3b5e37 Update documentation on configuration 2017-06-01 15:20:00 +02:00
Rodolphe Marques
00dc44721f Merge remote-tracking branch 'origin/master' into init-timeout-rethinkdb-conn 2017-06-01 14:53:44 +02:00
Rodolphe Marques
cc2e83f07d Added unit test for rethinkdb connection timeout
- Cosmetic changes
2017-06-01 14:30:20 +02:00
libscott
30bf7c9b4e Merge pull request #1492 from bigchaindb/pipeline-fast-transaction
Transaction schema validation pipeline tweaks
2017-06-01 14:25:34 +02:00
Scott Sadler
9e22e060ea Merge remote-tracking branch 'origin/master' into pipeline-fast-transaction 2017-06-01 14:15:46 +02:00
libscott
479bb78d9b Merge pull request #1389 from bigchaindb/vote-order-bug
Resume voting on blocks in order
2017-06-01 12:48:22 +02:00
Rodolphe Marques
b3d72d84e4 Merge pull request #1357 from lavinasachdev3/bug/1336/handle-authentication-exception
Add a new exception for MongoDB Authentication errors
2017-06-01 10:15:26 +02:00
Scott Sadler
01c6d6e72d remove test, see if codecov is happy 2017-05-31 17:13:57 +02:00
libscott
1d96768db8 Merge pull request #1488 from bigchaindb/nothreads
Disable threads in web workers
2017-05-31 14:36:44 +02:00
libscott
bb02995ae6 Merge pull request #1494 from bigchaindb/rapidjson-schema
Use rapidjson-schema
2017-05-31 14:06:21 +02:00
Scott Sadler
211bdeffb1 dont raise Exception if there's an inconsistency in schema validation failures 2017-05-31 11:33:57 +02:00
Scott Sadler
8348dfb8ce test for vote get_changefeed to make codecov happy (fix) 2017-05-30 17:43:38 +02:00
Scott Sadler
d51632a675 test for vote get_changefeed to make codecov happy 2017-05-30 15:14:23 +02:00
Scott Sadler
4216c17339 test Vote.validate_tx transaction exists 2017-05-30 14:41:24 +02:00
Tim Daubenschütz
8b7f86b63d Feat/1462/text search http api (#1471)
* Add assets text search endpoint

* Filter out assets from invalid transactions.

- Added the limit argument to limit the returned results
- Created and updated tests

* Added documentation for the assets endpoint.

- Added some docstrings

* Removed unnecessary fixtures
2017-05-30 11:21:26 +02:00
Scott Sadler
bc687ca229 Merge remote-tracking branch 'origin/master' into pipeline-fast-transaction 2017-05-30 11:18:46 +02:00
Scott Sadler
51be4be2f7 Merge remote-tracking branch 'origin/master' into vote-order-bug 2017-05-29 17:03:36 +02:00
Scott Sadler
444bf6d197 fix rethinkdb changefeed decoupling 2017-05-29 16:42:29 +02:00
Rodolphe Marques
ac2d65d23d Merge pull request #1469 from bigchaindb/feat/1462/text-search
Text search support for mongodb backend
2017-05-29 13:30:45 +02:00
Rodolphe Marques
ef52c04808 Merge remote-tracking branch 'origin/master' into feat/1462/text-search 2017-05-29 13:07:38 +02:00
Rodolphe Marques
45a10a2577 Merge pull request #1460 from bigchaindb/feat/1275/asset-decoupling
Feat/1275/asset decoupling
2017-05-29 12:57:11 +02:00
Rodolphe Marques
3819ae5d65 Clean up code
- Fixed docstrings
2017-05-26 10:34:58 +02:00
Troy McConaghy
61d56cb2cf docs: The JS driver is maintained by the BDB team 2017-05-26 09:41:50 +02:00
Rodolphe Marques
e9979dda85 fixed typos 2017-05-24 17:05:43 +02:00
Scott Sadler
4fa0e951b1 fix pipeline changefeed node name 2017-05-24 16:16:37 +02:00
Scott Sadler
40eb2b7e52 Merge branch 'master' into vote-order-bug 2017-05-24 15:34:26 +02:00
Troy McConaghy
818d44052e python cleanup of analyze.py 2017-05-24 15:15:12 +02:00
Troy McConaghy
d058066c22 gave more examples of OMS Log Search string + analysis tips 2017-05-24 15:02:58 +02:00
Troy McConaghy
8f6e7fc735 added little py script to do some nginx logs analysis 2017-05-24 15:02:06 +02:00
Leo Arias
ae56497456 set the version of the snap using git tags
closes #1436
2017-05-24 14:53:46 +02:00
Troy McConaghy
6aaa4503dd Merge pull request #1482 from bigchaindb/update-bdb-ver-for-k8s-in-release-process
Add steps to Release_Process.md, to update Docker image version for k8s
2017-05-24 13:50:30 +02:00
Rodolphe Marques
23954ccc8a Merge remote-tracking branch 'origin/master' into feat/1275/asset-decoupling 2017-05-24 12:44:04 +02:00
Rodolphe Marques
cda8259e57 Fixed typos 2017-05-24 12:38:34 +02:00
Rodolphe Marques
56379e9bec fix pep8 issue 2017-05-24 12:11:40 +02:00
Troy McConaghy
c79dc9cf03 Merge pull request #1481 from bigchaindb/update-link-to-js-driver-repo
Docs: Updated the Link to the JavaScript / Node.js Driver
2017-05-24 12:05:08 +02:00
Rodolphe Marques
285fc03ca9 Merge remote-tracking branch 'origin/master' into feat/1462/text-search 2017-05-24 11:59:49 +02:00
Scott Sadler
17cf9178ce restore tx validation in block 2017-05-24 11:38:16 +02:00
Rodolphe Marques
6900e86458 Filter out assets from invalid transactions
- Created docstrings
- Created tests
- Raise an exception when trying to use text search with RethinkDB.
2017-05-24 11:38:15 +02:00
libscott
488074fa09 Merge pull request #1411 from bigchaindb/fast-unspents
Fast unspents
2017-05-23 13:21:33 +02:00
Scott Sadler
e12e95d9d8 use rapidjson-schema 2017-05-23 13:19:10 +02:00
Troy McConaghy
59ec527dd3 Merge pull request #1485 from bigchaindb/minor-docs-fixes
Minor docs fixes
2017-05-23 12:16:40 +02:00
Troy McConaghy
0cddab67ea Merge pull request #1472 from bigchaindb/move-some-docs-around
Docs: Moved Old Cloud Deployment Templates to the Appendices & Edited Introductions
2017-05-22 14:49:03 +02:00
Krish
710fde686d Update bigchaindb default deployment version
Updated to the latest release, version 0.10.2.
2017-05-22 14:22:16 +02:00
Scott Sadler
ccb4bfd244 document get_new_blocks_feed 2017-05-22 14:22:12 +02:00
Scott Sadler
954df20dac documentation fix 2017-05-22 12:50:51 +02:00
Scott Sadler
b6ae91c541 documentation fix 2017-05-22 12:47:07 +02:00
Scott Sadler
2589e16fd6 pipeline fixes; dont validate tx schema during block creation, parallelise tx schema validation in vote pipeline 2017-05-22 12:41:15 +02:00
Sylvain Bellemare
ba40034362 Update changelog for v0.10.2 2017-05-22 10:57:56 +02:00
Troy McConaghy
b0c3241be4 Merge branch 'master' into move-some-docs-around 2017-05-19 14:35:59 +02:00
Scott Sadler
5de15c33ec disable threads in web workers 2017-05-19 14:05:28 +02:00
Krish
b6ec3e5f5c Mongodb TLS (#1456)
* Support for secure TLS communication in MongoDB, MongoDB Monitoring
Agent and MongoDB Backup Agent
- Move from Golang to Bash for entrypoint program
- Update image tag to 2.0 for Backup and Monitoring Agents and to
3.4.4 for MongoDB
- Add documentation

* changed title & rewrote Step 1 of workflow.rst

* copy-edited ca-installation.rst

* copy-edited & modified structure of workflow.rst

* moved repeated Easy-RSA install & config docs to new page

* edited the sentences describing the Easy-RSA dirs

* copy-edited the page about generating server certificate

* copy-edited the page about generating client certificate

* renamed page to 'How to Set Up a Self-Signed Certificate Authority'

* copy-edited page about how to revoke a certificate

* Comments on how to uniquely name all instances in the cluster

* Added comments about the other questions when setting up a CA

* Added note about one Agent Api Key per Cloud Manager backup

* docs: clarified instructions for generating server CSR

* docs: added back 'from your PKI infrastructure'

* docs: fixed step & added step re/ FQDNs & certs in workflow.rst

* docs: added note re/ the Distinguished Name

* Update docs for env vars setup

* docs: added tip: how to get help with the easyrsa command
2017-05-19 11:18:44 +02:00
Troy McConaghy
c6133c827d docs: updated link to JS/nodejs driver 2017-05-18 17:51:43 +02:00
Troy McConaghy
69cafee156 Add steps to Release_Process.md, to update Docker image version for k8s 2017-05-18 17:51:15 +02:00
vrde
e420531fe5 Remove useless options from CORS init
This can be merged only after
https://github.com/bigchaindb/js-bigchaindb-driver/pull/10 is merged
2017-05-18 17:50:37 +02:00
Troy McConaghy
780a9c9bf5 Quickstart docs: tell them to run MongoDB using 'sudo mongod ...' 2017-05-18 17:50:08 +02:00
Troy McConaghy
cab2ea11ab use default mongodb replica set name when run mongod for tests 2017-05-18 17:50:08 +02:00
vrde
3995e22d4a Fail if config file not found 2017-05-18 17:43:44 +02:00
vrde
5ae8c81474 Use "allow_headers" keyword to initialize CORS
Fix #1478
2017-05-18 17:43:44 +02:00
krish7919 (Krish)
b8407d603a Deploy events API on k8s over on HTTP 2017-05-16 10:38:40 +02:00
Troy McConaghy
edbe5deb46 docs: moved old cloud depl. templates to Appendices & edited intros 2017-05-15 15:25:01 +02:00
diminator
7bf1d55f62
return false 2017-05-12 20:48:41 +02:00
diminator
ceaa4be6ec
remove redundant statement that causes bugs on complex cc 2017-05-12 20:45:43 +02:00
vrde
6cb75960b0
Merge branch 'kyber-master-feat-cors' 2017-05-12 15:33:47 +02:00
Rodolphe Marques
ccaae91601 Added full text search support for mongodb.
- Create widlcard text index for the assets collection.
- Created backend query to to text search on assets collection.
- Added and updated tests.
2017-05-12 15:22:11 +02:00
vrde
f08edd5a52
Unpin flask-cors, revert extra changes 2017-05-12 14:35:34 +02:00
vrde
444e6fae85
Merge branch 'master' into kyber-master-feat-cors 2017-05-12 01:42:59 +02:00
Sylvain Bellemare
9d3eb23abf Add workaround for hostname of events api link
addresses #1465
2017-05-11 17:05:17 +02:00
Sylvain Bellemare
f3cd43e5a9 Make GET /blocks status arg case insensitive 2017-05-11 16:29:39 +02:00
Rodolphe Marques
ce414e46f3 Added missing docstrings. Fixed typos. 2017-05-11 12:29:08 +02:00
Rodolphe Marques
eb94181e1b Fixed tests.
Updated fixtures to flush the assets table after each test.
2017-05-11 12:00:01 +02:00
Rodolphe Marques
aacba571f8 Added docstrings and tests to new methods 2017-05-11 11:38:07 +02:00
Rodolphe Marques
8c0dbeb281 Added asset decoupling support for rethinkdb
Updated schema.
Created queries for assets table.
Fixed tests.
2017-05-10 17:55:43 +02:00
Rodolphe Marques
92392b51a7 Initial implementation to decouple assets from transactions.
Most changes done to how we write and read blocks to the database.
Created schema, indexes and queries for mongodb.
Fixed tests.
2017-05-10 16:43:52 +02:00
Troy McConaghy
08b8b712b6 Merge pull request #1453 from bigchaindb/docs-on-creating-oms-alerts
New docs how to 'Create an Email Alert' in OMS Portal
2017-05-10 16:40:18 +02:00
diminator
3e21fd8b49 Merge remote-tracking branch 'origin/master' into kyber-master-feat-cors 2017-05-09 21:28:38 +02:00
Scott Sadler
b4f14b26ce address nomenclature issues 2017-05-08 14:25:39 +02:00
Troy McConaghy
b96cfdecc1 Merge pull request #1452 from bigchaindb/edits-to-websocket-api-docs
Minor edits & fixes to WebSocket API docs
2017-05-05 13:39:23 +02:00
Troy McConaghy
31028ba147 New docs how to 'Create an Email Alert' in OMS Portal 2017-05-05 11:16:00 +02:00
Troy McConaghy
8297ce9260 Minor edits & fixes to WebSocket API docs 2017-05-04 15:04:54 +02:00
Krish
07a9e69933 WebSocket support in NGINX (#1439)
* Open port in Dockerfile
* Added the BIGCHAINDB_WS_FRONTEND_PORT and BIGCHAINDB_WS_BACKEND_PORT as parameters.
2017-05-02 12:20:27 +02:00
Troy McConaghy
3a6828638b Merge pull request #1447 from CsterKuroi/fix-typo-in-docs
Fix typo in docs
2017-05-02 11:02:03 +02:00
diminator
fc6c1c2f68 Merge branch 'fix/outputs-public-keys-validate' into kyber-master-feat-cors 2017-05-01 13:18:41 +02:00
diminator
3564e25d3f
check output conditions with single statement 2017-05-01 13:17:58 +02:00
diminator
7055c21fdd Merge branch 'master' into kyber-master-feat-cors 2017-05-01 13:15:08 +02:00
tdsgit
dbd020f34f minor 2017-04-29 21:55:48 +05:30
tdsgit
d330d8ec56 timeout exception added 2017-04-29 21:50:00 +05:30
tdsgit
756034f634 Merge remote-tracking branch 'upstream/master' into bug/1337/init-timeout-rethinkdb-conn 2017-04-29 21:07:27 +05:30
tdsgit
6a82f9c95b removed multiple tries 2017-04-29 21:07:07 +05:30
Krish
43f9f67867 Publish port 80 publicly in nginx-3scale. (#1446)
Upgrade docker image tag to `1.1` as the corresponding config changes for displaying error message are built in the `1.1` container image.
2017-04-28 10:14:14 +02:00
KURO1
a44523081a Fix typo in docs 2017-04-28 10:39:03 +08:00
Krish
20270cdb9b Config settings for MongoDB Backup Agent (#1442) 2017-04-26 18:34:22 +02:00
Troy McConaghy
1bda3dade1 Merge pull request #1441 from bigchaindb/note-ruby-code-in-driver-docs
Updated Drivers & Clients docs page, including link to Ruby driver
2017-04-26 11:18:10 +02:00
Troy McConaghy
ae9d6f1e6e Updated Drivers & Clients docs page, including Ruby driver 2017-04-26 10:11:45 +02:00
Troy McConaghy
5009c75eb1 Merge pull request #1437 from bigchaindb/alpha-to-beta-in-setup-py
Changed from Alpha to Beta in setup.py
2017-04-25 15:51:46 +02:00
Scott Sadler
01ba01083d update comments 2017-04-25 13:12:32 +02:00
Sylvain Bellemare
8f750456d8 Address remaining details 2017-04-25 11:58:15 +02:00
Sylvain Bellemare
8900276b1d Mount k8s dir for docker-compose 2017-04-25 11:58:15 +02:00
Sylvain Bellemare
7659290518 Add missing backslash (\) 2017-04-25 11:58:15 +02:00
Sylvain Bellemare
22f0e25c9a Correct JSON 2017-04-25 11:58:15 +02:00
Sylvain Bellemare
43ac369e45 Move oms related files under dedicated dir 2017-04-25 11:58:15 +02:00
Sylvain Bellemare
e954668eaa Add docs 2017-04-25 11:58:15 +02:00
Sylvain Bellemare
920d4aa181 Add log analytics oms deployment scripts 2017-04-25 11:58:15 +02:00
libscott
910d6753b1 Merge pull request #1319 from bigchaindb/federation-tests
Federation tests
2017-04-25 11:33:41 +02:00
Troy McConaghy
96feb18604 Changed from Alpha to Beta in setup.py
I changed the classifier `'Development Status :: 3 - Alpha'` to `'Development Status :: 4 - Beta'` as per the list of classifiers here: https://pypi.python.org/pypi?%3Aaction=list_classifiers

This is in preparation for the version 1.0 release but I think it's probably fine to have it in master now.
2017-04-24 15:56:36 +02:00
Leo Arias
3a3f73aeb2 Add the snap README 2017-04-24 15:30:17 +02:00
Leo Arias
6f8f2e2f93 Add the packaging metadata to build the bigchaindb snap 2017-04-24 15:30:17 +02:00
Scott Sadler
6fbefd5230 Merge remote-tracking branch 'origin/master' into federation-tests 2017-04-24 15:16:48 +02:00
libscott
4b057ad948 Merge pull request #1286 from bigchaindb/tx-amount-string
transaction.outputs.amount as string
2017-04-24 14:28:06 +02:00
libscott
bd057f63ca Merge pull request #1225 from bigchaindb/sign-tx-body
Sign whole transaction body instead of partial transaction
2017-04-24 14:27:31 +02:00
Scott Sadler
1e866a1207 signature payload is serialized transaction 2017-04-24 13:37:50 +02:00
Scott Sadler
2c6370f42e Merge branch 'master' into sign-tx-body 2017-04-24 13:28:02 +02:00
Scott Sadler
483425e803 Merge branch 'master' into tx-amount-string 2017-04-24 12:22:36 +02:00
Scott Sadler
2200a7bda4 cleanup 2017-04-24 12:21:00 +02:00
Krish
4a9342ec57 Updating docs (#1433)
* Include the key generation step
* Fix typos in CLIs
2017-04-24 10:25:15 +02:00
tdsgit
442746397d fix mock side effect iteration 2017-04-22 19:38:15 +05:30
tdsgit
0cb327819d flake8 fix 2017-04-22 12:46:23 +05:30
tdsgit
5550e0986e note 1337 2017-04-21 23:05:28 +05:30
tdsgit
5edac3f4ee wait till timeout added to rethinkdb connection 2017-04-21 22:55:03 +05:30
Krish
cc66d5aaa5 Single node setup (#1418)
* Add more tools to the toolbox container

* Add mongodb monitoring agent
* Add a bigchaindb/mongodb-monitoring-agent container that includes the
monitoring agent.
* It makes use of an api key provided by MongoDB Cloud Manager. This is
included in the configuration/config-map.yaml file.

* Changes to mongodb StatefulSet configuration
Changes to bump up mongodb version to v3.4.3.
Add configuration settings for mongodb instance name in ConfigMap.
Split the mongodb service to a new configuration file.

* Modify bigchaindb deployment config
* Bugfix to remove keyring field for the first node.
* Split the mongodb service to a new configuration file.

* Add mongodb backup agent
* Add a bigchaindb/mongodb-backup-agent container that includes the
backup agent.
* It makes use of an api key provided by MongoDB Cloud Manager. This is
included in the configuration/config-map.yaml file.

* Changes to nginx deployment config
* Allow 'all' by default for now. This is included in the
configuration/config-map.yaml file.
* Dynamically resolve DNS addresses of our backend services; cache DNS
resolution for 20s.
* Configure DNS based on user provided resolver. This helps in user
deciding to provide 8.8.8.8 or a custom DNS for name resolution. For k8s
deployments, we use the hardcoded k8s DNS IP of 10.0.0.10.

* Changes to nginx-3scale deployment config
* Use the common ConfigMap in configuration/config-map.yaml file.

* Removing prefix `v` from the docker tag for mongodb-monitoring-agent and mongodb containers

* Bumping up version for nginx-3scale container

* Add small helper scripts for docker build and push of mongodb monitoring
and backup agents

* Documentation for setting up the first node with monitoring and backup
agents
2017-04-21 14:41:12 +02:00
Scott Sadler
5d767c1162 light refactoring to remove some redundancies and fix test coverage 2017-04-21 12:23:53 +02:00
Scott Sadler
29247a9994 test clarification 2017-04-20 16:58:40 +02:00
Scott Sadler
5b6fa13d79 fast unspent queries for RethinkDB 2017-04-20 16:58:29 +02:00
Krish
f2e14fb73c Remove editable flag in Dockerfile (#1416)
From `pip install --help`:
```
-e, --editable <path/url>   Install a project in editable mode (i.e.
setuptools "develop mode") from a local project path or a VCS url.
```
2017-04-20 10:38:06 +02:00
Troy McConaghy
16a36c1f6f Merge pull request #1414 from bigchaindb/expand-on-release-process
minor addition to Release_Process.md
2017-04-19 17:57:23 +02:00
Troy McConaghy
e305de7ffb Merge pull request #1413 from bigchaindb/update-changelog-with-0.10.1-stuff
Updated CHANGELOG.md for v0.10.1
2017-04-19 17:06:29 +02:00
Troy McConaghy
4f5ec32d2a minor addition to Release_Process.md 2017-04-19 16:52:03 +02:00
Troy McConaghy
e97ce76836 Updated CHANGELOG.md for v0.10.1 2017-04-19 16:39:12 +02:00
Krish
ecbcf68de7 Refactor Dockerfile post locale errors (#1410)
* Basing BigchainDB docker image from `python:3.6` in `Dockerfile` and `Dockerfile-dev`.
* Added ENV var for websocket interface
* Optimization to Dockerfile-dev to save build time during dev/test.
  Pre-installing the `pynacl` dependeny in separate command so that devs
  do not need to wait while testing. The trade-off is that devs will
  need to clear (`rmi`) the image to start from scratch.
2017-04-19 16:07:44 +02:00
Scott Sadler
4f99122758 fast unspents 2017-04-19 15:47:58 +02:00
Troy McConaghy
5cf49dcccf Merge pull request #1408 from bigchaindb/document-two-wsserver-settings
Added docs for wsserver.host and wsserver.port
2017-04-19 11:35:20 +02:00
Troy McConaghy
411e682a6c added docs for wssserver.host and .port 2017-04-19 11:21:59 +02:00
Troy McConaghy
7ece4fff2f Merge pull request #1405 from bigchaindb/Fix-Makefile
Updated Makefile so 'release' depends on 'dist'
2017-04-19 10:49:50 +02:00
Troy McConaghy
01ecf6bcf1 Merge pull request #1406 from bigchaindb/update-version-to-0.11.dev
Updated version in version.py to 0.11.0.dev
2017-04-18 18:02:56 +02:00
Troy McConaghy
9e52537cd3 updated version in version.py to 0.11.0.dev 2017-04-18 17:45:18 +02:00
Troy McConaghy
3c97532219 Update Makefile so 'release' depends on 'dist' 2017-04-18 17:35:12 +02:00
Troy McConaghy
9393687716 Merge pull request #1404 from bigchaindb/0.10
Updated version.py for the 0.10.0 release
2017-04-18 17:20:28 +02:00
Troy McConaghy
44aa52b71a updated version.py for the 0.10.0 release 2017-04-18 16:55:57 +02:00
Troy McConaghy
8730187e0b Merge pull request #1393 from bigchaindb/update-changelog-for-0.10.0
Update CHANGELOG.md for the v0.10.0 release
2017-04-18 16:53:36 +02:00
vrde
659d25444e
Merge branch 'remove-useless-capped-queue' 2017-04-18 16:38:26 +02:00
Troy McConaghy
e5eb499529 more updates to changelog for 0.10.0 2017-04-18 16:22:17 +02:00
Sylvain Bellemare
8206a4a18c Update docs 2017-04-18 16:21:02 +02:00
Sylvain Bellemare
965334e9b6 Use lower case for default log level 2017-04-18 16:21:02 +02:00
Sylvain Bellemare
4d8f9dd777 Explicitly set default log config
Closes #1318
2017-04-18 16:21:02 +02:00
Sylvain Bellemare
b3290f12d2 Apply log level cmd line option to log file 2017-04-18 16:21:02 +02:00
Sylvain Bellemare
4c0fc52e9e Document error log file setting and log rotation 2017-04-18 16:21:02 +02:00
Sylvain Bellemare
6d4245dfd9 Set error log file according to user given setting 2017-04-18 16:21:02 +02:00
Sylvain Bellemare
675d011a76 Set error logs file handler to a rotating one 2017-04-18 16:21:02 +02:00
Troy McConaghy
b691d7da45 Merge remote-tracking branch 'origin/master' into update-changelog-for-0.10.0 2017-04-18 16:15:43 +02:00
Sylvain Bellemare
82a170402e Upgrade MongoDB in docker-compose file 2017-04-18 16:14:21 +02:00
Sylvain Bellemare
b4eb75ede5 Use MongoDB as default db in docker-compose file 2017-04-18 16:14:21 +02:00
vrde
f94a1e020c
Dispatcher is a consumer, no capped queue needed 2017-04-18 16:13:03 +02:00
Troy McConaghy
ebe89c3ebd Merge pull request #1401 from bigchaindb/notes-re-firewall-and-port-9985-for-websocket
Updated firewall setup docs re/ port 9985 for WebSocket API
2017-04-18 14:59:35 +02:00
Troy McConaghy
e58102b5db Merge pull request #1383 from bigchaindb/docs/1170/move-http-api-docs-to-top-level-section
Moved HTTP API docs to top-level page & fixed all links to that page
2017-04-18 14:48:54 +02:00
Troy McConaghy
c04a62a1e8 updated firewall setup docs re/ port 9985 for WebSocket API 2017-04-18 14:43:32 +02:00
Troy McConaghy
d7ccc7c00f Merge branch 'master' into docs/1170/move-http-api-docs-to-top-level-section 2017-04-18 14:34:53 +02:00
vrde
83af84742b
Merge branch 'events-api-first-cut' 2017-04-18 13:08:47 +02:00
Troy McConaghy
5831a6233c Expanded notes about logging improvements in changelog 2017-04-18 12:07:23 +02:00
Troy McConaghy
02db6d9827 reorder extern contributors in changelog in alpha order 2017-04-18 12:03:05 +02:00
Troy McConaghy
85f7244153 Merge pull request #1338 from bigchaindb/docs-re-2-new-database-config-settings
Added Docs about `database.connection_timeout` and `database.max_tries`
2017-04-18 11:48:27 +02:00
Troy McConaghy
dea6ac56ba Merge remote-tracking branch 'origin/master' into docs-re-2-new-database-config-settings 2017-04-18 11:34:05 +02:00
Troy McConaghy
eb9a9c96f9 Merge pull request #1399 from bigchaindb/add-docs-re-max-tx-size
Added docs about how to use a reverse proxy e.g. to enforce max tx size
2017-04-18 11:21:34 +02:00
Troy McConaghy
6921b1386c docs: noted that rethinkdb doesn't use database.connection_timeout setting yet 2017-04-18 10:53:27 +02:00
Sylvain Bellemare
a65c8799dd Document gunicorn loglevel setting 2017-04-18 10:46:21 +02:00
Troy McConaghy
59be30187f Merge branch 'master' into docs/1170/move-http-api-docs-to-top-level-section 2017-04-18 10:43:02 +02:00
Troy McConaghy
0ec29abd24 docs: added note re only real way to limit CC complexity today 2017-04-16 21:57:05 +02:00
Troy McConaghy
aa4d532e47 added docs re enforcing max tx size with a reverse proxy 2017-04-16 21:22:12 +02:00
Sylvain Bellemare
cae017eb22 Fix logging file handler 2017-04-13 17:57:05 +02:00
Krish
28042a7e83 Add NGINX integration with 3scale on Kubernetes (#1392)
* Add NGINX integration with 3scale on Kubernetes
2017-04-13 17:34:25 +02:00
Sylvain Bellemare
7701963f5e Use rotating file handler for logging
closes #1204
2017-04-13 16:20:26 +02:00
Krish
df02a77788 Documentation for running BigchainDB in docker containers on mac (#1265)
* Documentation for running bigchaindb docker image on mac
2017-04-13 16:17:18 +02:00
Troy McConaghy
183edb1081 Revised Notes in CHANGELOG.md 2017-04-13 15:23:33 +02:00
Troy McConaghy
28441a9edd Merge pull request #1391 from bigchaindb/repair-docs-hyperlinks
Repaired broken hyperlinks in the server docs
2017-04-13 14:19:32 +02:00
Troy McConaghy
333dc9bb93 Updated link to Haskell transaction builder in drivers-clients/index.rst 2017-04-13 12:43:35 +02:00
Troy McConaghy
9f474f5161 fixed problematic hyperlink in http-client-server-api.rst 2017-04-13 12:40:48 +02:00
Troy McConaghy
efa20aea66 fixed problematic hyperlinks in setup-run-node.md 2017-04-13 12:35:30 +02:00
Troy McConaghy
7f8ab60d3b repaired problematic kubernetes hyperlinks 2017-04-13 12:29:53 +02:00
Troy McConaghy
24f7e2662b fixed 2 problematic hyperlinks in run-with-docker.md 2017-04-13 12:10:36 +02:00
Troy McConaghy
6a7eeec23a Updated link to AWS docs re access keys 2017-04-13 12:04:49 +02:00
libscott
31ac941ad1 Merge pull request #1309 from bigchaindb/critical-duplicate-vote
Voting module raises CriticalDuplicateVote if there's a duplicate vote
2017-04-13 12:01:38 +02:00
Troy McConaghy
d937933627 updated link to python-rapidjson repo on github 2017-04-13 11:46:01 +02:00
Troy McConaghy
2d9ce8a963 first draft of v0.10.0 CHANGELOG.md 2017-04-13 11:41:44 +02:00
Scott Sadler
861bfa2aab use patch instead of subclassing 2017-04-13 11:38:17 +02:00
Scott Sadler
99b4777766 use MongoDBConnection.run() and fix changefeed reconnect 2017-04-13 11:12:04 +02:00
Scott Sadler
8f55febefb rethinkdb changefeed update 2017-04-13 10:53:13 +02:00
Troy McConaghy
5afc63ac67 Merge pull request #1390 from bigchaindb/remove-consensus-plugin-docs
Made the consensus plugin an undocumented feature
2017-04-13 10:43:31 +02:00
Troy McConaghy
7625779e78 Merge pull request #1388 from bigchaindb/update-docs-on-clusters
Updated the Docs about Clusters
2017-04-13 10:43:05 +02:00
Troy McConaghy
53b4325d01 Merge branch 'master' into update-docs-on-clusters 2017-04-13 10:27:52 +02:00
Troy McConaghy
a57d492ac1 Merge pull request #1386 from bigchaindb/update-docs-re-production-node
Updated the Docs re: Production Nodes
2017-04-13 10:25:05 +02:00
Troy McConaghy
816f79220b Merge pull request #1382 from bigchaindb/tip-re-upgrading-dependencies
Add tip on upgrading to CONTRIBUTING.md
2017-04-13 10:17:51 +02:00
Troy McConaghy
93baa922c8 Made the consensus plugin an undocumented feature 2017-04-13 09:56:03 +02:00
vrde
414d915033
Snakecaseify keys 2017-04-13 08:54:34 +02:00
Scott Sadler
3bb5973f60 fix block order bug 2017-04-12 17:29:17 +02:00
Sylvain Bellemare
303e12ee28 Test command run_init when db already exists 2017-04-12 16:38:18 +02:00
Sylvain Bellemare
a7ed28e539 Test command helper _run_init 2017-04-12 16:12:41 +02:00
vrde
4c9adededd
Remove TODO 2017-04-12 15:54:11 +02:00
Troy McConaghy
659ff0a813 docs: clarify that the keyring update process 2017-04-12 15:18:08 +02:00
Troy McConaghy
b741c51dbc docs: added step where other nodes update their keyring 2017-04-12 15:14:44 +02:00
Troy McConaghy
da634c3892 more edits to cluster setup docs 2017-04-12 15:10:36 +02:00
Troy McConaghy
8fa6b1685e Clarify that AWS depl. scripts deploy w/ RethinkDB 2017-04-12 14:57:36 +02:00
Troy McConaghy
ee3c7f607c updated set-up-a-cluster.md in server docs 2017-04-12 14:55:56 +02:00
vrde
2bedc9b059
Fix typos 2017-04-12 14:39:15 +02:00
Troy McConaghy
ad37441115 docs: moved rethinkdb backup notes to appendices 2017-04-12 14:24:11 +02:00
Troy McConaghy
7c3f912fe0 Addressed remaining comments on PR #1386 2017-04-12 13:56:09 +02:00
Troy McConaghy
40e3c78c9a modified the Bigchaindb node diagram & notes on it 2017-04-12 13:55:07 +02:00
Sylvain Bellemare
0347fbccf4 Add a few more checks to the test 2017-04-12 13:50:09 +02:00
Sylvain Bellemare
e614834a03 Import Transaction class within fixture 2017-04-12 13:49:10 +02:00
Sylvain Bellemare
75dd645ec9 Import stdlib pkgs at the top of the test module 2017-04-12 13:47:58 +02:00
Scott Sadler
3bf1f9fa17 add additional test of negative amount to fix codecov 2017-04-12 12:16:42 +02:00
Scott Sadler
de445bb977 simplifications and clarifications for review of federation tests 2017-04-12 11:58:43 +02:00
Troy McConaghy
a6ce7b40aa docs fix: the bigchaindb package on PyPI no longer includes the Python driver 2017-04-12 11:23:34 +02:00
Troy McConaghy
8b861131d8 docs: added that we require MongoDB 3.4+ 2017-04-12 11:18:20 +02:00
Troy McConaghy
8361fae815 clarified notes on RethinkDB storage based on @r-marques comments 2017-04-12 11:16:49 +02:00
Sylvain Bellemare
98e52e047e Make utility test function into a fixture 2017-04-11 18:34:31 +02:00
Sylvain Bellemare
e0e997755e Re-order imports (pep8) 2017-04-11 18:34:20 +02:00
Sylvain Bellemare
79997848cd Refine test for the election pipeline process
test that the process is started with the events_queue kwargs
2017-04-11 17:24:21 +02:00
Troy McConaghy
beace99fc0 some edits to setup-run-node.md 2017-04-11 16:47:30 +02:00
vrde
a673d9c6ef
Add more code coverage 2017-04-11 16:34:50 +02:00
Troy McConaghy
ffc08eaef9 updated docs page 'Set Up and Run a Cluster Node' 2017-04-11 16:29:08 +02:00
Troy McConaghy
22cc47b0c5 Updated docs re: prod node reqs. Moved RethinkDB reqs to Appendices 2017-04-11 14:27:17 +02:00
Troy McConaghy
c3f173528f updated docs page: Production Node Components 2017-04-11 13:23:10 +02:00
Scott Sadler
a6ba13dc3e Merge remote-tracking branch 'origin/master' into federation-tests 2017-04-11 11:21:02 +02:00
Troy McConaghy
6cc1e75595 root docs: updated Terminology page 2017-04-11 11:15:55 +02:00
Troy McConaghy
392be98289 docs: updated Production Node Assumptions page 2017-04-11 11:15:21 +02:00
Troy McConaghy
fb2d4b19a9 bugfix: fixed ref to production-nodes/index in server index.rst 2017-04-11 10:59:56 +02:00
Troy McConaghy
ed6c90b863 renamed docs/server/source/nodes -> production-nodes 2017-04-11 10:45:09 +02:00
vrde
3758d458ce
Merge branch 'master' into events-api-first-cut 2017-04-11 10:17:39 +02:00
Troy McConaghy
8964ba33b4 updated links to the HTTP API docs in this repo 2017-04-10 15:14:18 +02:00
Troy McConaghy
b4988b29e3 Moved HTTP API docs to a top-level section 2017-04-10 13:58:58 +02:00
Troy McConaghy
85d5d08506 Add tip on upgrading to CONTRIBUTING.md 2017-04-07 15:40:17 +02:00
vrde
709eced0d3
Merge remote-tracking branch 'origin/event-handler-tests' into events-api-first-cut 2017-04-07 15:17:29 +02:00
Rodolphe Marques
da29bbc605 added tests for the events 2017-04-07 15:02:49 +02:00
vrde
be3f62dd10
Update endpoints and docs 2017-04-07 14:57:11 +02:00
vrde
aeb8827e30
Use try..except..else 2017-04-07 14:07:24 +02:00
vrde
be763022ad
Update documentation (tnx @ttmc) 2017-04-07 14:07:05 +02:00
vrde
d260e16f11
Add configuration for websocket server 2017-04-07 10:51:00 +02:00
Sylvain Bellemare
c64a35c362 Use new super syntax as per PEP 3135 2017-04-07 10:46:20 +02:00
Sylvain Bellemare
cf006e34a5 Make the keyword argument a keyword-only argument
As per PEP 3102. This helps making the code clearer.
2017-04-07 10:46:20 +02:00
vrde
f23faaa65f
Add WebSocket server 2017-04-07 09:16:22 +02:00
vrde
64a033b17a
Code cleanup, rename some vars 2017-04-07 08:42:22 +02:00
Rodolphe Marques
a92c091eeb
fix pep8 issue 2017-04-07 08:42:22 +02:00
Rodolphe Marques
bcc2e1f781
fixed pep8 issue 2017-04-07 08:42:22 +02:00
Rodolphe Marques
730b7482f6
cleanup code 2017-04-07 08:42:22 +02:00
Rodolphe Marques
83a7cffc3f
fix tests 2017-04-07 08:42:22 +02:00
Rodolphe Marques
96daa98699
Adverstise Event stream api in api info endpoint.
Updated tests.
2017-04-07 08:42:22 +02:00
vrde
83397de397
Add more tests and utils 2017-04-07 08:42:22 +02:00
vrde
5d39b42b7a
Add dependencies and first test 2017-04-07 08:42:22 +02:00
Rodolphe Marques
0cbf144ddf
Initial implementation of an event_handler 2017-04-07 08:42:22 +02:00
Rodolphe Marques
b90766f2c5 Merge pull request #1377 from bigchaindb/bug/1343/double-spent-critical-on-voting
Bug/1343/double spent critical on voting
2017-04-06 16:36:17 +02:00
Rodolphe Marques
de04dcda0c Fixed docstring.
Removed redundant `else` branch.
2017-04-06 16:07:35 +02:00
vrde
bc5217b9f3
Merge branch 'add-missing-config-options' 2017-04-05 17:56:41 +02:00
Rodolphe Marques
09a440ee91 Fix get_spent incorrectly raising CriticalDoubleSpent 2017-04-05 16:52:56 +02:00
vrde
5d2f66524c
Cleanup configuration keys for db 2017-04-04 18:58:34 +02:00
Rodolphe Marques
cb87221bdf Voting pipeline now checks for duplicated transactions in blocks during
validation.
2017-04-04 17:57:44 +02:00
vrde
1e07a5b111
Add ssl, login, and passwd to configure command 2017-04-04 17:43:37 +02:00
Rodolphe Marques
cd0a2dcdb7 Merge pull request #1366 from anujism/bug/437/pretty-msg-drop-nonexistent-db
Bug-437 Pretty message when drop nonexistent db
2017-04-04 11:29:33 +02:00
Rodolphe Marques
6f916d5781 Fixed documentation about transactions endpoint. (#1360)
* Fixed documentation about transactions endpoint.

* clarify how bigchaindb handles invalid transactions

* rephrase
2017-04-04 11:25:26 +02:00
Troy McConaghy
9f5e6d5450 Merge pull request #1365 from jackric/feat/1316/case-insens-log-level
Treat --log-level argument as case-insensitive
2017-04-04 10:42:37 +02:00
Anuj
bb68a44b96 Renamed bigchain import to bigchaindb 2017-04-04 13:55:24 +05:30
Anuj
8aac5c7e64 Merge remote-tracking branch 'upstream/master' into bug/437/pretty-msg-drop-nonexistent-db 2017-04-04 13:49:56 +05:30
Rodolphe Marques
6ac564728e Merge pull request #1359 from bigchaindb/feat/1245/clean-outdated-code
Delete outdated speed-tests folder
2017-04-04 09:51:56 +02:00
Jack Riches
d5c8d3067e Use two spaces before inline comment (PEP8) (fix flake8 error) 2017-04-03 23:06:36 +01:00
Jack Riches
2560f02c36 Fix syntax error (missing comma) 2017-04-03 17:19:03 +01:00
Troy McConaghy
0f41a649f6 Merge pull request #1364 from bigchaindb/how-to-handle-cla-with-no-pr
Added to HOW_TO_HANDLE_PULL_REQUESTS.md
2017-04-03 13:42:04 +02:00
Rodolphe Marques
cee2f94f89 Remove benchmarking-tests folder.
Remove references to removed folders.
2017-04-03 11:57:56 +02:00
Sylvain Bellemare
57d3770564 Add missing underline title characters 2017-04-03 11:21:32 +02:00
Lavina
e7b0b227f1 Rename bigchain.py command module to bigchaindb.py 2017-04-03 11:21:32 +02:00
Anuj
c3f89fd447 Taking DB name from config in test for non-existent db drop 2017-04-03 13:13:22 +05:30
Jack Riches
eff1406c09 Refactor awawy unnecessary lambda to str.upper 2017-04-02 23:46:44 +01:00
Troy McConaghy
f3f1ecdaec Added to HOW_TO_HANDLE_PULL_REQUESTS.md
Added new subsection: How to Handle CLA Agreement Emails with No Associated Pull Request
2017-04-02 16:46:41 +02:00
Anuj
ffad192ca8 Merge remote-tracking branch 'upstream/master' into bug/437/pretty-msg-drop-nonexistent-db 2017-04-02 17:54:01 +05:30
Anuj
09866920af Pretty message when dropping a non-existent database 2017-04-02 17:53:39 +05:30
Jack Riches
ca200b1da7 Treat --log-level argument as case-insensitive 2017-04-02 12:22:56 +01:00
Sylvain Bellemare
87eb070ed6 Refactor core.BigchainDB.get_outputs 2017-03-31 16:29:16 +02:00
diminator
f589b28d3c Merge remote-tracking branch 'origin/master' into kyber-master-feat-cors 2017-03-31 11:27:18 +02:00
Sylvain Bellemare
6fb793e52f Update changelog for 0.9.5 2017-03-31 11:23:01 +02:00
Sylvain Bellemare
36edbc5f35 Set base version for Python to 3.6 in tox.ini 2017-03-31 11:21:51 +02:00
Sylvain Bellemare
64ef0dd9a1 Test docs building and flake8 only for Python 3.6 2017-03-31 11:21:51 +02:00
diminator
2c53db04d3 Merge remote-tracking branch 'remotes/origin/master' into kyber-master-feat-cors 2017-03-31 11:19:35 +02:00
diminator
03172c870a
flake8 import 2017-03-31 11:18:44 +02:00
Rodolphe Marques
4bcd7dd1e2 Delete outdated speed-tests folder 2017-03-30 14:56:33 +02:00
morrme
5c2bab078f Update tox.ini 2017-03-30 10:23:08 +02:00
morrme
ead832a130 added Python 3.6 per issue #1331 2017-03-30 10:23:08 +02:00
Lavina
9c4b284db9 Add a new exception for MongoDB Authentication errors 2017-03-29 17:10:55 +05:30
Sylvain Bellemare
c6de90fa79 Upgrade rapidjson to latest 0.0.11 2017-03-29 10:13:33 +02:00
Troy McConaghy
64441fcaba Merge pull request #1332 from bigchaindb/docs-re-sw-upgrades-when-on-k8s
New docs page about updating all the software on a BigchainDB node on Kubernetes
2017-03-28 20:31:48 +02:00
vrde
69190fed67
Merge branch 'tomconte-feat/1281/mongodb-ssl-auth' 2017-03-28 15:16:27 +02:00
vrde
31e95f086c
Merge branch 'feat/1281/mongodb-ssl-auth' of https://github.com/tomconte/bigchaindb into tomconte-feat/1281/mongodb-ssl-auth 2017-03-28 15:16:16 +02:00
vrde
047108046a
Revert "Add ssl, login, and passwd to configure command"
This reverts commit 699e615d47bb6b24f4d373c8edfd3a84d4b6e0c1.
2017-03-28 15:01:10 +02:00
vrde
699e615d47
Add ssl, login, and passwd to configure command 2017-03-28 14:51:02 +02:00
Sylvain Bellemare
1083e04dd5 Fix Makefile (test) coverage target 2017-03-28 12:25:42 +02:00
Sylvain Bellemare
9679561d89 Update pytest command in Makefile
Use new command "pytest", add verbosity, and distribute tests across
available CPU cores
2017-03-28 12:25:42 +02:00
vrde
441ad914cf
Improve test coverage 2017-03-28 11:24:16 +02:00
Thomas Conte
58d80e9731 Fix ssl param default value 2017-03-27 10:59:58 +02:00
Troy McConaghy
9fd40682f2 docs re: database.connection_timeout and database.max_tries 2017-03-24 15:38:27 +01:00
Sylvain Bellemare
0edb1c18f2 Keep gunicorn logger_class internal
closes #1334
2017-03-24 14:22:48 +01:00
Troy McConaghy
3a80204039 Merge pull request #1333 from bigchaindb/fix_readthedocs_in_release_process
Improved readthedocs.org instructions in Release_Process.md
2017-03-24 11:06:36 +01:00
Troy McConaghy
c61e3333d0 improved readthedocs.org instructions in Release_Process.md 2017-03-24 10:57:56 +01:00
Troy McConaghy
f5a32e35c5 docs: 1st draft of page about updating all s/w on a BDB node on k8s 2017-03-23 18:21:55 +01:00
Sylvain Bellemare
cea78b3ae2 Integrate gunicorn logs with bigchaindb logs
Closes #1329
2017-03-23 17:22:43 +01:00
Sylvain Bellemare
6e3f25a143 Set log level for gunicorn 2017-03-23 13:54:16 +01:00
Sylvain Bellemare
054fb48ca8 Set cmd line log level option default 2017-03-22 16:47:39 +01:00
Sylvain Bellemare
b42264e27e Add commands subpackage documentation 2017-03-22 16:35:24 +01:00
Sylvain Bellemare
0ae9d19a54 Separate log configuration from logging process
Closes #1317
2017-03-22 16:35:24 +01:00
Rodolphe Marques
510e03ea80 Merge pull request #1322 from bigchaindb/feat/356/limit-cc-complexity
Clarify allowed maximum complexity of conditions
2017-03-22 15:50:55 +01:00
Rodolphe Marques
f98a634d65 clarify allowed maximum complexity of conditions 2017-03-22 14:37:37 +01:00
Krish
425397f644 NGINX frontend for MongoDB and BigchainDB (#1304)
- Added NGINX deployment to frontend both BDB and MDB.
- Nginx is configured with a whitelist (which is read from a ConfigMap)
to allow only other MDB nodes in the closter to communicate with it.
- Azure LB apparently does not support proxy protocol and hence
whitelisting fails as nginx always observer the LB IP instead of the
real IP in the TCP stream.
- Whitelisting source IPs for MongoDB
- Removing deprecated folder
- Better log format
- Intuitive port number usage
- README and examples
- Addressed a typo in PYTHON_STYLE_GUIDE.md
- Azure LB apparently does not support proxy protocol and hence
whitelisting fails as nginx always observer the LB IP instead of the
real IP in the TCP stream.
- Whitelisting source IPs for MongoDB
- Removing deprecated folder
- Multiple changes:
- Better log format
- Intuitive port number usage
- README and examples
- Addressed a typo in PYTHON_STYLE_GUIDE.md
- Documentation
- add the k8s directory to the ignore list in codecov.yml
2017-03-22 14:25:25 +01:00
Rodolphe Marques
10d83c2ab9 No duplicate vote inserts with mongodb (#1258)
* prevent duplicate vote inserts
2017-03-22 14:25:16 +01:00
diminator
94b5318e52
remove localhost 2017-03-22 13:07:30 +01:00
Scott Sadler
d8b84891b6 federation tests 2017-03-21 16:23:56 +01:00
Sylvain Bellemare
9987041ac0 Add note about case insensitivity of log levels 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
45ae58448f Correct wording 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
3a81270101 Add link to configuration file settings 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
4338637983 Add docs for allowed log levels for cmd line 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
d867983a89 Document cmd line option for the log level 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
05db44a636 Add documentation for log configuration 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
e4ed122a1c Correct default log datefmt for console 2017-03-21 16:17:32 +01:00
Sylvain Bellemare
f740ebc7ce Use logging module constants for levels 2017-03-21 11:12:46 +01:00
Sylvain Bellemare
87758b8a64 Re-organize imports 2017-03-21 11:12:46 +01:00
Sylvain Bellemare
eff8e3adf3 Update logging related code and tests after rebase 2017-03-21 11:12:46 +01:00
Sylvain Bellemare
53d5232be8 Remove leftover line from rebase 2017-03-21 11:12:46 +01:00
Brett Sun
f549b00813 Add tests for setting log-level from CLI 2017-03-21 11:12:46 +01:00
Brett Sun
d688e695e6 Configure logging in bigchaindb_configure decorator 2017-03-21 11:12:46 +01:00
Brett Sun
c0498abed3 Add log-level option for all CLI commands 2017-03-21 11:12:46 +01:00
diminator
a3b01147e5
added CORS for localhost 2017-03-20 21:35:47 +01:00
Scott Sadler
ddbdf64e33 voting module raises CriticalDuplicateVote if there's a duplicate vote 2017-03-20 17:30:02 +01:00
Sylvain Bellemare
43f779a18b Add logging infrastructure 2017-03-20 13:54:14 +01:00
Troy McConaghy
9aa243c9f8 Merge pull request #1300 from bigchaindb/update-copyright-year-in-docs
Updated copyright year in docs footers
2017-03-20 09:38:24 +01:00
Troy McConaghy
3e0b4e7b90 Merge pull request #1301 from bigchaindb/rm-docs-load-testing-with-docker
Removed docs re: load testing with Docker
2017-03-18 22:24:04 +01:00
Scott Sadler
03ca4b1fd3 make stepping pipeline queue items mutable 2017-03-17 15:34:17 +01:00
Troy McConaghy
516492d7d4 Merge pull request #1262 from bigchaindb/change-federation-to-consortium
Changed 'federation' to 'cluster' or 'consortium' in docs and some code
2017-03-17 14:27:35 +01:00
Troy McConaghy
da92d1e1c2 Merge branch 'master' into change-federation-to-consortium 2017-03-17 13:51:28 +01:00
Troy McConaghy
10365bae52 docs: removed docs re load testing w/ Docker 2017-03-17 13:40:06 +01:00
Thomas Conte
550b9cb804 Fix unit test 2017-03-17 13:07:15 +01:00
Andrej Svenke
3b99daa080 Docker image optimization. (#1277) 2017-03-17 12:18:20 +01:00
Troy McConaghy
d213eacd57 Merge pull request #1295 from bigchaindb/copyedit-docs-1st-node-on-k8s
Copyedited two docs pages re/ BigchainDB on Kubernetes
2017-03-17 12:06:51 +01:00
Rodolphe Marques
e97cee8c84 Merge pull request #1294 from bigchaindb/bug/1291/threshold-conditions-duplicated-pks
_sign_threshold now signs all subconditions for a public key
2017-03-17 10:32:21 +01:00
Thomas Conte
3b1e6adb43 Formatting 2017-03-17 10:05:11 +01:00
Thomas Conte
8526246f78 Fix unit test 2017-03-17 10:01:58 +01:00
Sylvain Bellemare
94877cb9c1 Update change log 2017-03-17 09:54:14 +01:00
Troy McConaghy
ff132a9464 Updated copyright year in docs footers 2017-03-17 09:28:16 +01:00
Thomas Conte
08f040d218 Authentication support 2017-03-17 09:09:06 +01:00
Sylvain Bellemare
b94a9ec7e9 Fix get_spent mongodb-based query
fixes #1271
2017-03-16 17:04:50 +01:00
Sylvain Bellemare
c5bad99f4e Add test for get_spent for tx with two inputs 2017-03-16 17:04:50 +01:00
Sylvain Bellemare
c12f08a92c Add test to reproduce false double spend
see issue #1271
2017-03-16 17:04:50 +01:00
Sylvain Bellemare
102406dd35 Add fixtures for alice, bob, and carol 2017-03-16 17:04:50 +01:00
Sylvain Bellemare
b849656d3b Use namedtuple for key pair 2017-03-16 14:58:32 +01:00
Troy McConaghy
7aa94447cd docs: copyedited 2 pages re/ node on k8s 2017-03-16 14:42:32 +01:00
Rodolphe Marques
4aa6ed1067 fixed pep8 error 2017-03-16 14:18:57 +01:00
Rodolphe Marques
f00f68e03f _sign_threshold now signs all subconditions for a public key.
Created test.
2017-03-16 14:10:04 +01:00
Scott Sadler
bbf5c49f9a test that transfer tx cannot have no inputs 2017-03-15 17:19:46 +01:00
Krish
ea6ce5c1a1 Single node/cluster bootstrap and node addition workflow in k8s (#1278)
* Combining configs
*  Combining the persistent volume claims into a single file.
*  Combining the storage classes into a single file.

* Updating documentation

* Multiple changes
*  Support for ConfigMap
*  Custom MongoDB container for BigchainDB
*  Update documentation to run a single node on k8s

* Additional documentation

* Documentation to add a node to an existing BigchainDB cluster

* Commit on rolling upgrades

* Fixing minor documentation mistakes

* Documentation updates as per @ttmc's comments

* Block formatting error

* Change in ConfigMap yaml config
2017-03-15 16:22:49 +01:00
Troy McConaghy
a9f0f9de54 Merge pull request #1261 from bigchaindb/rm-bigchaindb-load-stuff-from-aws-scripts
Removed all stuff related to 'bigchaindb load' in AWS scripts
2017-03-15 16:19:13 +01:00
Scott Sadler
860e7cda02 test that transaction with no hash raises schema validation error 2017-03-15 14:32:54 +01:00
Scott Sadler
d08d932627 make max output amount a constant 2017-03-15 13:37:56 +01:00
Troy McConaghy
b0f40894c1 Merge pull request #1283 from bigchaindb/az-acs-tip
Tip for `az acs kubernetes get-credentials...`
2017-03-15 13:15:26 +01:00
Scott Sadler
25650597b1 test invalid string amount case 2017-03-15 11:27:35 +01:00
Scott Sadler
a869f6d1dd fix wrong exception after schema change 2017-03-15 11:08:19 +01:00
Scott Sadler
48a766400d try to bump codecov into correct calculation 2017-03-15 11:03:00 +01:00
Scott Sadler
69bafc80c0 put limits on amount size 2017-03-15 10:17:41 +01:00
Scott Sadler
f23bfa52d1 Output.from_dict accepts string 2017-03-15 10:00:00 +01:00
Scott Sadler
56b81f9d8d change amount type to string in schema file 2017-03-14 21:45:36 +01:00
Troy McConaghy
4daeff28f8 Tip for az acs kubernetes get-credentials...
Added a tip for when `$ az acs kubernetes get-credentials...` command gives an error after you enter the correct password.
2017-03-14 20:23:46 +01:00
Scott Sadler
1e2080bf47 Merge remote-tracking branch 'origin/master' into tx-validation-cleanup 2017-03-14 18:45:36 +01:00
Scott Sadler
c3d9717b07 fix breakage from other branch 2017-03-14 18:42:05 +01:00
Scott Sadler
28e06399ae fix breakage from other branch 2017-03-14 18:40:04 +01:00
Scott Sadler
47c6a722ad move tests to validate transaction ID 2017-03-14 18:35:53 +01:00
Scott Sadler
4b060e6488 move tests related to assets 2017-03-14 18:07:25 +01:00
Troy McConaghy
270fed04c7 Merge pull request #1273 from bigchaindb/rm-bigchaindb-load-command
Remove 'bigchaindb load' command, tests & docs
2017-03-14 17:35:15 +01:00
Scott Sadler
48a3ba96ae move tx tests from test_models.py 2017-03-14 17:12:10 +01:00
Scott Sadler
66830fc1d9 move version validation to transaction structure test module 2017-03-14 17:12:10 +01:00
Scott Sadler
8a5814bb08 clarify schema testing module 2017-03-14 17:12:10 +01:00
Scott Sadler
ae8153bd10 new home of structural validation in tests 2017-03-14 17:12:10 +01:00
libscott
277251b50b Merge pull request #1257 from bigchaindb/tx-structure
Schemas for CREATE and TRANSFER transactions
2017-03-14 17:11:13 +01:00
Scott Sadler
f51b40b6dc some documentation and nomenclature fixes in common.schema 2017-03-14 17:07:18 +01:00
Scott Sadler
1f5a8582b6 Merge branch 'master' into tx-structure 2017-03-14 16:22:14 +01:00
Thomas Conte
696dbe7844 SSL connection support 2017-03-14 14:23:30 +01:00
Scott Sadler
7c461e47d7 remove structural and schematic validations from Transaction.validate which is validating the spend 2017-03-14 12:39:57 +01:00
libscott
d57e504cd8 Merge pull request #1215 from bigchaindb/voting-class-integration
Voting class integration
2017-03-14 11:47:05 +01:00
Troy McConaghy
b0f379dba9 Merge pull request #1276 from bigchaindb/fix-bigchaindb-toolbox-dockerfile
Fix comments in bigchaindb/toolbox Dockerfile
2017-03-13 18:39:20 +01:00
Troy McConaghy
e0366468ec Fix comments in bigchaindb/toolbox Dockerfile
The comments were referring to another Docker image (`krish7919/toolbox`).
2017-03-13 18:14:18 +01:00
Scott Sadler
58a1a25d43 test for invalid vote in election pipeline 2017-03-13 16:26:41 +01:00
Scott Sadler
0fb4ea424b remove stray validation 2017-03-13 14:55:03 +01:00
Scott Sadler
b997057962 fix tests 2017-03-13 14:25:36 +01:00
Troy McConaghy
1de7ae1104 Merge pull request #1260 from bigchaindb/remove-old-topic-guides-section-from-server-docs
Removed the old 'Topic Guides' section from the BigchainDB Server docs
2017-03-13 14:18:07 +01:00
Scott Sadler
4050389df7 move test_create_tx_no_asset_id 2017-03-13 14:01:29 +01:00
Scott Sadler
e8ee2ec0a6 fix tests 2017-03-13 13:47:37 +01:00
Scott Sadler
dbf24a6065 schema validates that create txes only have 1 input and that it has no fulfills 2017-03-13 13:47:37 +01:00
Scott Sadler
5b2d22efd4 test asset schema 2017-03-13 13:47:37 +01:00
Scott Sadler
8077956b95 test serialization hash function 2017-03-13 13:47:37 +01:00
Scott Sadler
31b3ad8f96 fix bad quotes in test_outputs 2017-03-13 13:47:37 +01:00
Scott Sadler
cb6bd34744 test create tx does not have an asset id 2017-03-13 13:47:37 +01:00
Scott Sadler
294afa123f rename validate_structure to validate_id 2017-03-13 13:46:45 +01:00
Scott Sadler
45f0840885 Merge remote-tracking branch 'origin/master' into voting-class-integration 2017-03-13 13:37:36 +01:00
Scott Sadler
dc58466de3 Merge branch 'master' into voting-class-integration 2017-03-13 13:35:03 +01:00
Troy McConaghy
042133faf8 removed docs about 'bigchaindb load' command 2017-03-11 14:00:01 +01:00
Troy McConaghy
962a88b1d9 removed 'bigchaindb load' command & tests 2017-03-11 13:59:23 +01:00
Troy McConaghy
a09af2455d Merge pull request #1270 from bigchaindb/edit-docs-re-ssh-to-k8s-nodes
Revised docs re/ SSHing to nodes in a k8s cluster
2017-03-11 09:34:10 +01:00
Sylvain Bellemare
72ba9761d4 Use parametrized host & port in test
to support docker-based tests or different test envs
2017-03-10 19:21:25 +01:00
Troy McConaghy
646859f1d6 revised docs re/ SSHing to nodes in a k8s cluster 2017-03-10 11:47:58 +01:00
Krish
7dbd374838 Running a single node on k8s (#1269)
* Single node as a StatefulSet in k8s
- uses bigchaindb/bigchaindb:0.9.1

* Updating README

* rdb, mdb as stateful services

* [WIP] bdb as a statefulset

* [WIP] bdb w/ rdb and bdb w/ mdb backends
- does not work as of now

* Split mdb & bdb into separate pods + enhancements
*  discovery of the mongodb service by the bdb pod by using dns name.
*  using separate storage classes to map 2 different volumes exposed by the
mongo docker container; one for /data/db (dbPath) and the other for
 /data/configdb (configDB).
*  using the `persistentVolumeReclaimPolicy: Retain` in k8s pvc. However,
this seems to be unsupported in Azure and the disks still show a reclaim
policy of `delete`.
*  mongodb container runs the `mongod` process as user `mongodb` and group
`mongodb. The corresponding `uid` and `gid` for the `mongod` process is 999
and 999 respectively. When the constinaer runs on a host with a mounted disk,
the writes fail, when there is no user with uid 999. To avoid this, I use the
docker provided feature of --cap-add=FOWNER in k8s. This bypasses the uid and
gid permission checks during writes and allows writes.
Ref: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

* Delete redundant k8s files, add cluster deletion steps.

* Single node as a StatefulSet in k8s
- uses bigchaindb/bigchaindb:0.9.1

* Updating README

* rdb, mdb as stateful services

* [WIP] bdb as a statefulset

* [WIP] bdb w/ rdb and bdb w/ mdb backends
- does not work as of now

* Split mdb & bdb into separate pods + enhancements
*  discovery of the mongodb service by the bdb pod by using dns name.
*  using separate storage classes to map 2 different volumes exposed by the
mongo docker container; one for /data/db (dbPath) and the other for
 /data/configdb (configDB).
*  using the `persistentVolumeReclaimPolicy: Retain` in k8s pvc. However,
this seems to be unsupported in Azure and the disks still show a reclaim
policy of `delete`.
*  mongodb container runs the `mongod` process as user `mongodb` and group
`mongodb. The corresponding `uid` and `gid` for the `mongod` process is 999
and 999 respectively. When the constinaer runs on a host with a mounted disk,
the writes fail, when there is no user with uid 999. To avoid this, I use the
docker provided feature of --cap-add=FOWNER in k8s. This bypasses the uid and
gid permission checks during writes and allows writes.
Ref: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

* Delete redundant k8s files, add cluster deletion steps.

* Documentation: running a single node with distinct mongodb and bigchaindb
pods on k8s

* Updates as per @ttmc's comments
2017-03-09 16:53:00 +01:00
Scott Sadler
e011f50bc7 remove stray test 2017-03-08 17:33:35 +01:00
libscott
f2c951847c Merge pull request #1243 from bigchaindb/validationerror-refactor
Make ValidationError a superclass of all validation errors and use it
2017-03-08 17:04:12 +01:00
Scott Sadler
53dff83ed4 Merge remote-tracking branch 'origin/master' into validationerror-refactor 2017-03-08 13:07:51 +01:00
Scott Sadler
a3fccbc599 change TransactionDoesNotExist to InputDoesNotExist in tests 2017-03-08 13:01:52 +01:00
Scott Sadler
d10772e4bf Merge remote-tracking branch 'origin/master' into voting-class-integration 2017-03-08 12:56:58 +01:00
libscott
a110d54dad Merge pull request #1237 from bigchaindb/tx-appears-once-in-block
Avoid dupe txs in block
2017-03-08 12:55:33 +01:00
Scott Sadler
ffccf86c91 Merge remote-tracking branch 'origin/master' into voting-class-integration 2017-03-08 12:54:33 +01:00
Troy McConaghy
421b5b03b3 Changed 'federation' to 'cluster' or 'consortium' in docs and some code 2017-03-07 17:41:25 +01:00
Troy McConaghy
ca21c7b321 Remove all stuff related to 'bigchaindb load' in AWS scripts 2017-03-07 16:14:39 +01:00
libscott
9ec9f638fc Merge pull request #1213 from bigchaindb/identify-voters
Identify voters + Voting class
2017-03-07 14:06:22 +01:00
Troy McConaghy
780cf62d10 Merge pull request #1259 from bigchaindb/update-release-process-re-docker-hub
Must update meaning of 'latest' image on Docker Hub when do a minor release
2017-03-07 13:26:49 +01:00
Scott Sadler
1db8d59a88 use comma for arguments in logging calls instead of format operator 2017-03-07 13:24:20 +01:00
Scott Sadler
e5dd5c665b address vrde's comments, reshuffle some exceptions around 2017-03-07 13:15:31 +01:00
Sylvain Bellemare
75d0a917d7 Remove stderr check 2017-03-07 12:29:54 +01:00
Brett Sun
ffe0eb60b9 Move tests related to commands/tests.py to separate test file 2017-03-07 12:29:54 +01:00
Brett Sun
54ea18dd2b Use decorator to automatically configure before starting any command (that requires configuration) 2017-03-07 12:29:54 +01:00
Brett Sun
df9fd6dc23 Move arguments related only to start command to be under start 2017-03-07 12:29:54 +01:00
Brett Sun
fce6b6af52 Standardize output streams for outputs of commands 2017-03-07 12:29:54 +01:00
Brett Sun
0ad0d89fcd Move input_on_stderr() to commands.utils module 2017-03-07 12:29:54 +01:00
Troy McConaghy
d3bd9d0300 Server docs: Removed the old 'Topic Guides' section 2017-03-07 11:43:49 +01:00
libscott
33bef7d993 I can't spell neccesarily 2017-03-07 11:29:16 +01:00
Troy McConaghy
083d1678ce Must update meaning of 'latest' image on Docker Hub when do a minor release 2017-03-07 11:24:26 +01:00
Scott Sadler
9bb2ec276a clarify interface of Voting.count_votes 2017-03-07 11:24:21 +01:00
Sylvain Bellemare
7e0e46e820 Pass host and port to rethinkdb connection
This is needed when running the tests in containers for instance
2017-03-06 16:23:47 +01:00
Sylvain Bellemare
2e398f606f Make some improvements to command line messages and error handling 2017-03-06 14:45:10 +01:00
Sylvain Bellemare
edc5887b42 Use hardcoded (constant) messages
This provides a bit of re-usability and helps testing.
2017-03-06 14:45:10 +01:00
Sylvain Bellemare
24eb18fb59 Add tests for errors on startup 2017-03-06 14:45:10 +01:00
Sylvain Bellemare
d1d994f0e7 Add fixture for run_start cmdline args
Note: has the possibility to be parametrized.
2017-03-06 14:45:10 +01:00
Sylvain Bellemare
4e82615845 Add module to hold messages used in commands 2017-03-06 14:45:10 +01:00
Sylvain Bellemare
894784b9e4 Add pytest-mock - a thin wrapper around mock 2017-03-06 14:45:10 +01:00
Sylvain Bellemare
1002668082 Fix broken tests 2017-03-06 14:45:10 +01:00
Sylvain Bellemare
c1cf79d0e0 Pass a message to the exception
otherwise nothing gets printed when printing the exception
2017-03-06 14:45:10 +01:00
Sylvain Bellemare
6ce8ba9ae3 Replace logging statements with print
that is more or less the recommended approach for command line
interfaces

see https://docs.python.org/3.6/howto/logging.html#when-to-use-logging
2017-03-06 14:45:10 +01:00
libscott
5e91d65348 Merge pull request #1250 from bigchaindb/stray_print_in_connection
remove stray print call
2017-03-06 14:25:00 +01:00
Troy McConaghy
c3ef252438 Merge pull request #1240 from bigchaindb/k8s-node
Run bigchaindb container + RDB/MDB container in a k8s StatefulSet
2017-03-06 14:22:31 +01:00
Scott Sadler
1374f133f9 remove stray print call 2017-03-06 14:18:48 +01:00
Sylvain Bellemare
8bad32dc13 Fix typo [skip ci] 2017-03-06 14:10:07 +01:00
Sylvain Bellemare
1c03ab754c Update change log for 0.9.3 2017-03-06 14:10:07 +01:00
Scott Sadler
352627b83a add test that asset id is a string 2017-03-06 12:12:04 +01:00
Troy McConaghy
33deff8760 docs: add instructions to deploy MongoDB & BigchainDB on k8s cluster 2017-03-05 17:49:00 +01:00
Troy McConaghy
0ffa93cd44 docs: fixed typo; changed 2Gi to 20Gi in kubectl cmd output 2017-03-05 17:23:42 +01:00
Troy McConaghy
6cda75b44b Merge remote-tracking branch 'origin/master' into k8s-node 2017-03-05 17:20:33 +01:00
Troy McConaghy
880729cac2 minor changes to 2 yml files + added RDB intracluster port 2017-03-05 16:47:12 +01:00
krish7919 (Krish)
93d06b4e2a PVC for MDB in single BDB+MDB StatefulSet 2017-03-04 20:05:30 +01:00
Sylvain Bellemare
f64401eed3 Only append tx if it meets the conditions
fixes #1231
2017-03-03 18:02:57 +01:00
Sylvain Bellemare
56243a57ab Fix indent 2017-03-03 18:02:57 +01:00
diminator
81dee294ea unitest for bug 2017-03-03 18:02:57 +01:00
krish7919 (Krish)
b9e5bc84d9 Merge branch 'k8s-node' of github.com:bigchaindb/bigchaindb into local-k8s-node 2017-03-03 17:35:16 +01:00
krish7919 (Krish)
43284798fe Run bdb:latest with mongodb:3.4.1 as separate containers in the same pod 2017-03-03 17:34:50 +01:00
Troy McConaghy
e1d7f95a8c Switch to PVC for RDB in single BDB+RDB StatefulSet 2017-03-03 15:57:35 +01:00
vrde
042e7d936f
Merge branch 'unify-mongodb-and-rethinkdb-connection' 2017-03-03 15:53:21 +01:00
Troy McConaghy
30db8a4e30 Renamed 'bdb091-server' to 'bdb-server' 2017-03-03 14:20:43 +01:00
vrde
c5b496b006
Merge branch 'master' into unify-mongodb-and-rethinkdb-connection 2017-03-03 13:52:56 +01:00
Scott Sadler
3346fcb47b break BigchainDBCritical into CriticalDoubleSpend and CriticalDoubleInclusion and add test 2017-03-03 13:48:52 +01:00
Scott Sadler
bbe9d4fc88 add some clarifications to test_voting.py 2017-03-03 13:24:30 +01:00
krish7919 (Krish)
9228e69355 Run bdb:latest with rdb:2.3 as separate containers in the same pod 2017-03-03 12:07:49 +01:00
Scott Sadler
59e21bfa4d fix test, log tx validation errors and document ValidationError 2017-03-03 11:52:12 +01:00
Scott Sadler
5584de59b0 Make ValidationError a superclass of all validation errors and use it 2017-03-03 11:36:50 +01:00
Troy McConaghy
77fc3fbc4e Merge pull request #1226 from bigchaindb/docs-re-k8s-persistent-storage
Docs on BDB Node Storage Setup in an Existing Kubernetes Cluster
2017-03-03 10:29:49 +01:00
Krish
dc9f93dfbc Enhancements to run with docker locally (#1239) 2017-03-03 10:29:30 +01:00
krish7919 (Krish)
64f4afb7ad Run bdb v0.9.1 as a pod in k8s 2017-03-03 10:19:09 +01:00
Scott Sadler
a71dc66e97 extra test for tx_collector and docs fix 2017-03-02 18:48:03 +01:00
Scott Sadler
1d935b9ae6 dedupe tx in block, reject duplicate tx in block 2017-03-02 14:35:20 +01:00
Sylvain Bellemare
6702ad192b Update change log for 0.9.2 2017-03-02 13:40:26 +01:00
Sylvain Bellemare
b20278430d Pin down rapidjson 2017-03-02 12:51:27 +01:00
libscott
d48c72682b Merge pull request #1222 from bigchaindb/consensus-cleanup
Don't load consensus in vote pipeline (unneeded)
2017-03-01 17:50:58 +01:00
Troy McConaghy
4e32a492b1 docs: changed PersistentVolumeClaim from 2Gi to 20Gi 2017-03-01 16:26:57 +01:00
Troy McConaghy
77c6b138a8 expanded docs re/ Azure storage accounts & ACS 2017-03-01 15:49:20 +01:00
Trent McConaghy
8be2e20559 Update CONTRIBUTING.md 2017-03-01 15:29:09 +01:00
Troy McConaghy
35ee6e5539 docs: add instructions to update az command 2017-03-01 13:35:31 +01:00
Troy McConaghy
cc8916d782 Merge remote-tracking branch 'origin/master' into docs-re-k8s-persistent-storage 2017-03-01 11:32:44 +01:00
Troy McConaghy
f2f1ee8ef1 docs: create k8s StorageClass & PVC 2017-02-28 19:08:13 +01:00
Troy McConaghy
6821170fcd docs: rm paren. sentence re/ deploying an ACS 2017-02-28 13:58:44 +01:00
Troy McConaghy
0759b6827a Merge pull request #1223 from bigchaindb/docs-to-create-ssh-key-for-k8s-vms
Docs on using special SSH keypair with ACS/Kubernetes
2017-02-28 12:25:07 +01:00
Scott Sadler
bae05e80a0 sign whole transaction body instead of partial transaction 2017-02-28 11:27:55 +01:00
Troy McConaghy
b3e697f05b docs: can SSH to k8s agent via master using private hostname 2017-02-28 11:25:57 +01:00
Scott Sadler
c993f954e0 wip 2017-02-27 20:56:01 +01:00
Scott Sadler
ebeb94f35a cleanup has_previous_vote 2017-02-27 16:25:29 +01:00
Scott Sadler
9bdc8ca341 fix in election pipeline 2017-02-27 16:23:46 +01:00
Scott Sadler
1eefcff736 Merge branch 'identify-voters' into voting-class-integration 2017-02-27 16:12:20 +01:00
Troy McConaghy
ffb1d7a624 Docs on using special SSH keypair with ACS/Kubernetes 2017-02-27 15:29:49 +01:00
Scott Sadler
3523036617 don't load consensus in vote pipeline (unneeded) 2017-02-27 15:23:53 +01:00
vrde
f21811323f
Remove unused import 2017-02-27 11:51:06 +01:00
vrde
f9748042c2
Fix exception handling in changefeed 2017-02-27 11:14:11 +01:00
vrde
213139d4c6
Improve tests and connection class 2017-02-27 02:54:02 +01:00
Scott Sadler
2116d199d5 simplify vote counting 2017-02-26 12:28:13 +01:00
Scott Sadler
6ab1089bda voting cleanup 2017-02-25 14:18:06 +01:00
Scott Sadler
6a10127268 Merge branch 'identify-voters' into voting-class-integration 2017-02-25 10:28:38 +01:00
Scott Sadler
f858fc8f8d fix voting bug with prev_block 2017-02-25 10:21:40 +01:00
Scott Sadler
ae8367c6c7 log election results in election pipeline 2017-02-24 13:27:48 +01:00
Scott Sadler
8ecd89c18c Merge branch 'identify-voters' into voting-class-integration 2017-02-24 10:44:53 +01:00
Scott Sadler
f860753192 test for block_election 2017-02-24 10:43:30 +01:00
libscott
4a5a5566e7 Merge pull request #1208 from bigchaindb/is_new_transaction
Bigchaindb.is_new_transaction, fix double inclusion in Vote pipeline
2017-02-24 10:17:06 +01:00
Scott Sadler
6295749997 pull in tests and fixes from integration branch 2017-02-24 10:12:26 +01:00
Scott Sadler
d4af68a05d voting schema validate 2017-02-24 10:10:23 +01:00
Scott Sadler
d73134e6c3 Static Classify Voting 2017-02-24 10:10:23 +01:00
Scott Sadler
f8a7123f0a check count_votes invalid input 2017-02-24 10:10:23 +01:00
Scott Sadler
4f997f60c0 flesh out voting module 2017-02-24 10:10:23 +01:00
Scott Sadler
b5a1c90d63 voting.py 2017-02-24 10:10:23 +01:00
Scott Sadler
e1312b88a3 Voting uses BigchainDBCritical 2017-02-24 10:04:24 +01:00
Scott Sadler
c44c9d0282 tests for vote schema and signature validation 2017-02-23 21:53:12 +01:00
Scott Sadler
e88c98a695 test_count_votes 2017-02-23 21:53:12 +01:00
Scott Sadler
1ff84bd670 test_partition_eligible_votes 2017-02-23 21:53:12 +01:00
Scott Sadler
89e76ffec2 fix tests, temporarily disabling some tests that need to be re-written 2017-02-23 21:53:12 +01:00
Scott Sadler
ff7e4d11d1 remove test from test_core.py which is just wrong 2017-02-23 21:53:12 +01:00
Scott Sadler
7fd1de696c move voting logic out of block_election_status 2017-02-23 21:53:12 +01:00
Scott Sadler
c68856bc43 voting schema validate 2017-02-23 21:53:12 +01:00
Scott Sadler
fdad8cd796 Static Classify Voting 2017-02-23 21:53:12 +01:00
Scott Sadler
20f6539e10 check count_votes invalid input 2017-02-23 21:53:12 +01:00
Scott Sadler
d71e560ba4 flesh out voting module 2017-02-23 21:53:12 +01:00
Scott Sadler
dbfcce34e7 voting.py 2017-02-23 21:53:12 +01:00
libscott
289080358d Merge pull request #1209 from bigchaindb/tymlez-consensus
Tymlez consensus plugin
2017-02-23 18:37:04 +01:00
vrde
c11808ecc5
Move common stuff to generic Connection class 2017-02-23 17:20:21 +01:00
libscott
d9dfe5fb7d Merge pull request #1210 from bigchaindb/wrong-exception
introduce BigchainDBCritical exception
2017-02-23 15:28:05 +01:00
Krish
1bcf84262c Adding a VOLUME statement in Dockerfile (#1212)
- MacOS does not allow users to mount folders from the host unless it is
specified during build time.
- This is needed as the container on Mac needs to access the .bigchaindb
conf file residing on the host.
2017-02-22 18:48:31 +01:00
Scott Sadler
b94eab715d introduce BigchainDBCritical exception 2017-02-22 14:37:34 +01:00
Scott Sadler
0d9881fc23 style fix 2017-02-22 14:09:12 +01:00
Scott Sadler
0f5844d4ae Merge remote-tracking branch 'origin/master' into tymlez-consensus 2017-02-22 14:07:36 +01:00
Scott Sadler
6e7534d3c2 cleanup; remove transaction_exists and has_transaction 2017-02-22 13:55:29 +01:00
Scott Sadler
fc2b684f32 use is_new_transaction in pipelines 2017-02-22 13:55:29 +01:00
Scott Sadler
843d65d233 bigchain.is_new_transaction method 2017-02-22 13:55:29 +01:00
libscott
dfb9f5a496 Merge pull request #1207 from bigchaindb/flake8-cleanup
Fix some outstanding flake8 issues
2017-02-22 13:53:55 +01:00
Scott Sadler
57d7a3d850 fix some outstanding flake8 issues 2017-02-22 12:33:10 +01:00
libscott
c9ba7e6243 Merge branch 'master' into master 2017-02-22 12:20:35 +01:00
libscott
631a435a63 Merge pull request #1193 from bigchaindb/stepping-pipeline
Add stepping pipeline (test tool) and fix issue #1191
2017-02-22 12:10:52 +01:00
Krish
306053af91 Adding a line to modify the configuration file (#1205)
* Adding a line to modify the configuration file

* Changing the access URL for rethinkdb

* Typo fix and with clarification

* Changes as per @ttmc's comments
2017-02-22 10:56:29 +01:00
Troy McConaghy
7a63771c2b Merge pull request #1201 from bigchaindb/fix-quickstart-link
Docs: Improvements to the Quickstart page
2017-02-21 18:19:31 +01:00
Troy McConaghy
39f66650ed Merge pull request #1195 from bigchaindb/expand-docs-re-block-signature
Docs: clarified how block id & signature are calculated
2017-02-21 18:18:16 +01:00
Troy McConaghy
87f677d76e docs: correction to explanation of block signature calc. 2017-02-21 14:20:14 +01:00
Scott Sadler
37f5298962 pull stepper changes from no-double-inclusion 2017-02-21 13:51:09 +01:00
Scott Sadler
a23a741253 document MultipipesStepper 2017-02-21 13:13:40 +01:00
Scott Sadler
6110693ae8 provide more documentation for MultipipesStepper 2017-02-21 13:04:43 +01:00
Troy McConaghy
34286467b7 docs: removed all RethinkDB stuff from Quickstart page 2017-02-20 18:04:47 +01:00
Troy McConaghy
5e8cec65cd docs: Simplified Quickstart page even more 2017-02-20 17:52:48 +01:00
Troy McConaghy
ae029c7bcf Merge pull request #1198 from bigchaindb/docs-fix-settings-defaults
Docs: fixed errors in some documented config settings defaults
2017-02-20 15:59:58 +01:00
Troy McConaghy
96e760046f docs: better links at end of Quickstart page 2017-02-20 14:15:18 +01:00
Troy McConaghy
be72875330 docs: added some clarification to the replica set setting 2017-02-19 15:27:21 +01:00
Troy McConaghy
8ec2c6bc34 Docs: fixed errors in some documented config settings defaults 2017-02-17 12:15:50 +01:00
Tim Daubenschütz
72bef668f1 Merge pull request #1086 from bigchaindb/docs/830/design-events-api
Event Stream API Spec
2017-02-16 16:50:40 +01:00
Brett Sun
9307c21baa Remove connect keep alive protocol from Event Stream API 2017-02-16 15:26:17 +01:00
Brett Sun
00785e5f02 Add WebSocket Event Stream API spec 2017-02-16 15:25:58 +01:00
Troy McConaghy
f6ebba8389 docs: clarified how block id & signature are calculated 2017-02-16 09:52:00 +01:00
Troy McConaghy
8106fcfbeb Merge pull request #1190 from bigchaindb/docs-re-advanced-azure-node
[WIP] Docs re/ Node on Kubernetes on Azure
2017-02-16 09:12:18 +01:00
Scott Sadler
fc04cd7bcd update changefeed test for update 2017-02-15 17:31:36 +01:00
Scott Sadler
7469f60d17 more assertions in test 2017-02-15 15:15:20 +01:00
Scott Sadler
955b018be8 add stepping pipeline and fix issue #1191 2017-02-15 14:59:01 +01:00
Troy McConaghy
2b235b21aa add docs on kubectl install & setup 2017-02-15 14:57:42 +01:00
Krish
e71ee0dbc1 Merge pull request #1174 from bigchaindb/issue-1153
Decouple backend DB and BigchainDB Docker containers
2017-02-15 11:40:40 +01:00
Troy McConaghy
9dba09144a Started new page: Run a BigchainDB Node in a Kubernetes Cluster 2017-02-15 11:34:40 +01:00
krish7919 (Krish)
2a9042f39c Typo: Removing redundant line from docs 2017-02-15 11:20:41 +01:00
Troy McConaghy
52344787de docs: initial steps to deploy advanced node on Azure 2017-02-14 18:56:43 +01:00
Troy McConaghy
2780b9406a docs: renamed Starter Templates --> Templates 2017-02-14 18:55:46 +01:00
Troy McConaghy
3a3f82b650 Merge pull request #1184 from bigchaindb/update-firewall-setup-notes
Added some MongoDB ports to docs Notes for Firewall Setup
2017-02-13 15:24:26 +01:00
Troy McConaghy
8128caa86d Removed notes about port 28017 2017-02-13 15:09:48 +01:00
Sylvain Bellemare
832a0e9e41 Add Java driver link to docs 2017-02-11 17:59:59 +01:00
Troy McConaghy
6993046d65 Merge pull request #1185 from bigchaindb/add-tfstate-files-to-.gitignore
Added terraform.tfstate* files to .gitignore
2017-02-11 10:43:43 +01:00
Troy McConaghy
e8b8b595b7 Added terraform.tfstate* files to .gitignore 2017-02-11 10:29:56 +01:00
Troy McConaghy
edb773695e Added some MongoDB ports to docs Notes for Firewall Setup 2017-02-11 10:11:52 +01:00
Sylvain Bellemare
8da47243ac Fix link 2017-02-10 19:43:50 +01:00
Troy McConaghy
fe539ee19f Merge pull request #1178 from bigchaindb/bug/1173/fix-docs-url-in-http-api-responses
Fixed the docs URL in HTTP API responses
2017-02-09 14:48:57 +01:00
Troy McConaghy
f2a05c9e3b Fixed the docs URL in HTTP API responses 2017-02-09 11:10:58 +01:00
krish7919 (Krish)
1be05d3ffc Changes as requested by @ttmc 2017-02-09 09:55:53 +01:00
Troy McConaghy
6aac745225 Merge pull request #1163 from bigchaindb/update-changelog-with-0.9.1-changes
Updated CHANGELOG.md for v0.9.1
2017-02-08 22:05:56 +01:00
Tim Daubenschütz
98b61fa7c1 Merge pull request #1172 from bigchaindb/fix-production-ready-note
Fix production-ready-note
2017-02-08 19:51:34 +01:00
Sylvain Bellemare
5ffa6568c4 Add a section on community-driven libs 2017-02-08 18:16:28 +01:00
krish7919 (Krish)
f66c44689a Decouple backend DB and BigchainDB 2017-02-08 17:10:45 +01:00
tim
aae8c57902 Fix production-ready-note 2017-02-08 13:56:55 +01:00
Sylvain Bellemare
5e479d831b Remove superfluous comment 2017-02-08 09:54:56 +01:00
Troy McConaghy
15e9951b0b Merge pull request #1164 from bigchaindb/modify-release-process
Various modifications to the Release_Process.md
2017-02-07 17:49:46 +01:00
Sylvain Bellemare
1d0396212b Modify Makefile for releases 2017-02-07 17:20:47 +01:00
Troy McConaghy
0d0c93cab0 Made changes suggested by @sbellem in #1164 + some clarifications 2017-02-07 15:18:45 +01:00
Troy McConaghy
a55ae0e44d Various modifications to Release_Process.md 2017-02-07 11:46:25 +01:00
Troy McConaghy
55670effe3 Updated CHANGELOG.md for v0.9.1 2017-02-06 22:22:13 +01:00
Sylvain Bellemare
acc5b2fd42 Merge pull request #1160 from bigchaindb/hotfix-versioning
Fix versioning
2017-02-06 20:52:06 +01:00
tim
a049081b07 Fix tx model versioning 2017-02-06 20:21:17 +01:00
Troy McConaghy
f7b6fdc6e8 In master, bump version.py to 0.10.0.dev again 2017-02-06 20:03:54 +01:00
Troy McConaghy
ec08db8c01 Merge pull request #1159 from bigchaindb/0.9.0
Merge the 0.9.0 branch into master
2017-02-06 20:02:37 +01:00
Troy McConaghy
1477ed4820 Merge branch 'master' into 0.9.0 2017-02-06 20:01:20 +01:00
Troy McConaghy
232ddc00a0 Two changes to Release_Process.md
1. Merge the new version's branch into the master branch
2. Added a helper line about how to use twine to upload to PyPI
2017-02-06 19:54:53 +01:00
Troy McConaghy
88d08a551c Changed version.py in master to 0.10.0.dev 2017-02-06 19:05:11 +01:00
Troy McConaghy
5dead8d3d2 version.py update for 0.9.0 release 2017-02-06 18:46:00 +01:00
Troy McConaghy
1e7adabc35 Branch names should have the form X.Y.Z 2017-02-06 18:43:34 +01:00
Troy McConaghy
e6d99d74c0 Merge pull request #1100 from bigchaindb/implement-connection-run-for-mongodb
[WIP] Add run interface to MongoDB connection (aka: lazy queries)
2017-02-06 18:41:33 +01:00
Troy McConaghy
06589f1a21 Merge pull request #1156 from bigchaindb/fix-bigchaindb-configure-commands
Fix bigchaindb configure commands
2017-02-06 18:24:39 +01:00
vrde
2962b4a27d
Skip test 2017-02-06 18:06:19 +01:00
Brett Sun
c533359424 Default Dockerfile-dev to configure BigchainDB for RethinkDB 2017-02-06 18:05:52 +01:00
Troy McConaghy
85128a0634 append 'rethinkdb' to 'bigchaindb -y configure' in some docs 2017-02-06 18:01:38 +01:00
Brett Sun
758b65ba0a Upgrade pysha3 to 1.0.2 to fix usage on Python 3.6 on macOS 2017-02-06 17:57:15 +01:00
Troy McConaghy
eded8e50a4 append 'rethinkdb' to 'bigchaindb -y configure' in Ansible role 2017-02-06 17:54:03 +01:00
Troy McConaghy
4463c10b3a Merge pull request #1135 from bigchaindb/docs/1111/update-CHANGELOG.md-for-v0.9
Updated CHANGELOG.md for v0.9.0
2017-02-06 17:41:10 +01:00
Rodolphe Marques
5cec31e5a3 Merge pull request #1136 from bigchaindb/bug/1132/vote-pipeline-validates-transactions-twice
Bug/1132/vote pipeline validates transactions twice
2017-02-06 17:39:01 +01:00
vrde
0c8927dbbe
Add comment to hackish solution 2017-02-06 16:21:22 +01:00
Troy McConaghy
553db6e342 Update version.py step in Release_Process.md 2017-02-06 16:21:16 +01:00
vrde
5604e32d57
Try once if AutoReconnect is raised 2017-02-06 16:14:14 +01:00
Troy McConaghy
8723cd7424 Merge remote-tracking branch 'origin/master' into docs/1111/update-CHANGELOG.md-for-v0.9 2017-02-06 16:09:57 +01:00
vrde
5aecd8aab2
Merge branch 'master' into implement-connection-run-for-mongodb 2017-02-06 14:44:52 +01:00
vrde
3c45de70d0
Wrap queries with connection object 2017-02-06 14:43:40 +01:00
Rodolphe Marques
7f4be291fd Merge pull request #1148 from bigchaindb/bug/989/block-pipeline-handle-exceptions
Make sure BlockPipeline.validate_tx handles all exceptions
2017-02-06 10:51:19 +01:00
vrde
01da32d351
Merge branch 'master' into implement-connection-run-for-mongodb 2017-02-03 15:25:24 +01:00
Troy McConaghy
f9556f4c3f Changelog: Noted removal of all StatsD monitoring stuff 2017-02-03 14:41:17 +01:00
Troy McConaghy
818dfc8587 Add @amirelemam to list of external contributors 2017-02-03 14:33:22 +01:00
Troy McConaghy
3529be914c Merge pull request #1144 from bigchaindb/fixes-to-cli-docs
Minor fixes to the bigchaindb CLI docs
2017-02-03 14:01:04 +01:00
Rodolphe Marques
c174271ae6 Make sure BlockPipeline.validate_tx handles all exceptions 2017-02-03 13:05:04 +01:00
Troy McConaghy
46aa90326f Merge pull request #1074 from bigchaindb/replace-pr-762
Replace PR #762
2017-02-03 12:21:34 +01:00
Troy McConaghy
b01898aced Merge branch 'master' into replace-pr-762 2017-02-03 12:05:13 +01:00
libscott
c728a9cddf Merge pull request #910 from bigchaindb/broken-integration-test
Broken integration test
2017-02-03 12:01:40 +01:00
vrde
7f50d76d9e
Fix test on changefeed reconnection 2017-02-03 11:58:18 +01:00
Troy McConaghy
105d0172da Minor fixes to the bigchaindb CLI docs 2017-02-03 11:31:24 +01:00
Troy McConaghy
2ccc7d2798 Merge pull request #1142 from bigchaindb/minor-fixes-to-aws-deploy-scripts
Minor fixes to the AWS deployment scripts
2017-02-03 11:09:27 +01:00
libscott
47d6b8038b Merge pull request #1131 from bigchaindb/fix-asset_id-index
Fix asset id index
2017-02-03 11:08:01 +01:00
Rodolphe Marques
e7d729a40d Improved docstrings 2017-02-03 10:56:51 +01:00
Troy McConaghy
b6f3fb4307 Merge remote-tracking branch 'origin/master' into minor-fixes-to-aws-deploy-scripts 2017-02-03 10:46:12 +01:00
Scott Sadler
d3e394e7ed refactor get_txids_filtered query to be more efficient and add test to check that appropriate indexes are used 2017-02-03 10:44:06 +01:00
Rodolphe Marques
2fe9c47b63 Feat/990/cleanup monitoring code (#1138)
* remove statsd dependencie

* remove monitoring related code

* removed statsd configuration

* fixed tests

* Removed monitoring docker compose file.

Remove statsd settings from test fixture.
Removed statsd related code from benchmarking tests

* removed monitoring related documentation

* remove unused import
2017-02-03 10:28:28 +01:00
Troy McConaghy
b9db0de657 Minor changes in .gitattributes 2017-02-03 10:12:42 +01:00
Troy McConaghy
5750027cd4 Include db backend (rethinkdb) when call bigchaindb configure 2017-02-03 10:01:36 +01:00
Troy McConaghy
e98a161805 set -euo pipefail in make_confiles.sh 2017-02-03 09:57:10 +01:00
vrde
98135c7df9
Add hack to handle reconnection to changefeed 2017-02-02 20:59:17 +01:00
vrde
6d3c04169c
Remove except for connection error in commands
It's out of scoper for this PR
2017-02-02 20:11:31 +01:00
vrde
e3a6d3d343
Add tests for connection.run 2017-02-02 19:58:00 +01:00
vrde
702d74a584
Merge branch 'master' into implement-connection-run-for-mongodb 2017-02-02 19:37:14 +01:00
vrde
16571b539f
Normalize exceptions 2017-02-02 19:26:52 +01:00
Krish
d14f06c9d0 Merge pull request #1139 from bigchaindb/docs-error
Add param 'rethinkdb' in docs for configure cmd.
With support for both mongo and rethink now, the original command for configuration of bigchaindb:
```
docker run --rm -v "$HOME/bigchaindb_docker:/data" -ti   bigchaindb/bigchaindb -y configure
```
needs to be updated to
```
docker run --rm -v "$HOME/bigchaindb_docker:/data" -ti   bigchaindb/bigchaindb -y configure rethinkdb
```
for docker to work without breaking.
2017-02-02 16:18:26 +01:00
Krish
516c753910 Add param 'rethinkdb' in docs for configure cmd. 2017-02-02 16:06:50 +01:00
Troy McConaghy
a50943fc25 Merge remote-tracking branch 'origin/master' into docs/1111/update-CHANGELOG.md-for-v0.9 2017-02-02 15:37:17 +01:00
Troy McConaghy
0e6422f6cc Added line re: PR #1130 to CHANGELOG.md 2017-02-02 15:24:04 +01:00
Rodolphe Marques
90eb38e7f1 Merge pull request #1088 from bigchaindb/feat/1055/commands-add-remove-replicas
BigchainDB commands to add and remove nodes from the replica set
2017-02-02 14:00:49 +01:00
Rodolphe Marques
153b3dd8d4 Merge remote-tracking branch 'origin' into bug/1132/vote-pipeline-validates-transactions-twice 2017-02-02 13:38:34 +01:00
Rodolphe Marques
6b073f0898 Removed duplicated transaction validation in votes pipeline.
Separated block validation from transaction validation.
Refactored block signature validation.
2017-02-02 13:35:20 +01:00
Rodolphe Marques
2262914868 Merge pull request #1130 from bigchaindb/feat/519/fix-logic-validate-block
fix wrong logic in validate_block
2017-02-02 13:34:47 +01:00
Rodolphe Marques
6fd8c7a20b Feat/105/secondary indexes inputs outputs (#1125)
* Added inputs/outputs secondary indexes for rethinkdb

Added tests.

* Added inputs/outputs secondary indexes for mongodb

Fixed tests.

* fixed comment
2017-02-02 09:45:13 +01:00
Troy McConaghy
7206eb35c4 Updated CHANGELOG.md for v0.9.0 2017-02-01 17:44:11 +01:00
Brett Sun
d49b06933a Fix docstring of recipient argument to be a list of tuples (#1091) 2017-02-01 16:24:34 +01:00
Rodolphe Marques
b7f70befe6 fix wrong logic in validate_block 2017-02-01 15:10:17 +01:00
Scott Sadler
c572464be6 fix asset_id index in mongodb 2017-02-01 14:47:19 +01:00
Scott Sadler
7f5318cba4 check validate_transaction raises DoubleSpend in integration test 2017-02-01 14:33:53 +01:00
Scott Sadler
d1b3a206ca get integration test working issue 633 2017-02-01 14:25:11 +01:00
ryan
2de652ad5c add replicating test 2017-02-01 14:25:11 +01:00
libscott
6783478126 Merge pull request #1117 from bigchaindb/unicode-529
test transaction supports unicode
2017-02-01 12:14:11 +01:00
krish7919 (Krish)
b318d62f7e Update Dockerfile with comments on force refresh 2017-01-31 13:07:06 -05:00
krish7919 (Krish)
aae60ea467 Solves #1105.
The `apt-get update` command executed with the install instructions
should not use a locally cached storage layer.
2017-01-31 13:07:06 -05:00
Troy McConaghy
0600483a90 Merge pull request #1119 from bigchaindb/docs/1077/recommend-ubuntu-16.04-for-now
Recommend Ubuntu 16.04 for now
2017-01-31 17:16:19 +01:00
vrde
1588681c5b
Fix pep8 error 2017-01-31 17:13:26 +01:00
vrde
857cdb9b34
Checking for replica set is now within try..except 2017-01-31 17:01:22 +01:00
vrde
157db3e01f
Fix exception in test 2017-01-31 16:59:43 +01:00
Troy McConaghy
2782ed0b32 Merge remote-tracking branch 'origin/master' into docs/1077/recommend-ubuntu-16.04-for-now 2017-01-31 16:49:04 +01:00
Troy McConaghy
815449def4 Merge pull request #1118 from bigchaindb/docs/1112/remove-example-apps-page
Removed 'Example Apps' page from the docs
2017-01-31 16:37:23 +01:00
Rodolphe Marques
c9af57943b Merge remote-tracking branch 'origin/master' into feat/1055/commands-add-remove-replicas 2017-01-31 16:29:18 +01:00
Rodolphe Marques
84626b6e32 Improved tests
Fixed typo
Add extra validation to hostnames to make sure host is not empty
2017-01-31 16:23:09 +01:00
Rodolphe Marques
426b02a3f1 Merge pull request #1082 from bigchaindb/feat/1057/mongodb-configure
Update configure command to support multiple backends
2017-01-31 16:21:35 +01:00
Troy McConaghy
88ea6c6564 In setup-run-node.md, link to page in Appendices re/ installing OS-level deps 2017-01-31 16:18:20 +01:00
Rodolphe Marques
9913929b9d simplify run_configure 2017-01-31 16:14:18 +01:00
Troy McConaghy
70e9a7a33c Updated many docs pages from Ubuntu 14.04 to 16.04 2017-01-31 16:03:57 +01:00
Scott Sadler
2af8fcb918 test unicode write block to disk 2017-01-31 15:48:34 +01:00
Scott Sadler
248e89a666 unicode tests uses serialize() and includes info about unicode symbol 2017-01-31 15:43:46 +01:00
Troy McConaghy
b68557507f Updated Ansible playbooks & docs for Ubuntu 16.04 deployment 2017-01-31 15:40:39 +01:00
Rodolphe Marques
f0e298bcd7 Added docstrings. Removed unnecessary returns.
Created fixture to simplify the tests.
Better comments.
2017-01-31 14:54:36 +01:00
Rodolphe Marques
69068fc919 Document how to run BigchainDB with MongoDB (#1116)
* Document changes in the configure command.

Document new add/remove replicas commands.

* updated quickstart with mongodb instructions

* Docs on how to setup mongodb dev node with and without docker.

Update replSet option in docker-compose

* Fixed typo.

More explicit on how to run the tests.

* Fixed typo in mongodb docker instructions.

More explicit about requiring mongodb 3.4+
2017-01-31 13:53:36 +01:00
Rodolphe Marques
2c26468cea Added some constants to simplify test 2017-01-31 13:51:49 +01:00
Troy McConaghy
375873b6ed Updated docs page about Terraform: Ubuntu 14.04 --> 16.04 2017-01-31 11:24:46 +01:00
Troy McConaghy
002c567bdf Updated the AMIs to Ubuntu 16.04 images in amis.tf 2017-01-31 11:13:45 +01:00
Rodolphe Marques
4740150f6d Updated config fixture
Simplified tests.
2017-01-31 10:57:58 +01:00
Rodolphe Marques
fafdac2523 Retrieve default backend from env if set.
Fixed tests.
2017-01-31 10:34:45 +01:00
Rodolphe Marques
555745abbf fixed pep8 issue 2017-01-31 10:04:45 +01:00
Rodolphe Marques
86542fd745 remove unnecessary test 2017-01-31 09:58:20 +01:00
vrde
1557645e94
Better exception handling 2017-01-31 02:07:36 +01:00
vrde
a8bbc87c1c
Major improvs for MongoDBConnection class 2017-01-31 01:29:12 +01:00
vrde
d8ba1f8f67
Merge branch 'master' into implement-connection-run-for-mongodb 2017-01-30 23:45:44 +01:00
Troy McConaghy
17a07a80f1 Removed 'Example Apps' page from the docs 2017-01-30 18:11:29 +01:00
Brett Sun
a1aa64aa61 Fix Makefile for new docs structure 2017-01-30 11:45:17 -05:00
libscott
340c79fbdd Merge pull request #1110 from bigchaindb/release-process-updates
[RFC] - Release process changes for Minor / Patch release
2017-01-30 16:20:28 +01:00
libscott
e9222e6aac Merge pull request #1115 from bigchaindb/bug-docs-1114
Set public_key manually in bigchaindb root url docs example
2017-01-30 16:12:28 +01:00
Scott Sadler
2a07362bad test transaction supports unicode 2017-01-30 16:11:44 +01:00
Scott Sadler
49464484d7 set public_key manually in bigchaindb root url docs example 2017-01-30 14:04:32 +01:00
libscott
736ecb0bc8 Update Release_Process.md 2017-01-30 12:04:07 +01:00
vrde
18533db10a
Merge branch 'fix/1068/break-out-loop-connection' 2017-01-30 11:57:49 +01:00
vrde
5b084edaf4
Break out of the loop once a connection is established
closes #1068
2017-01-30 10:56:46 +01:00
libscott
f6a6b72a9c Update Release_Process.md 2017-01-27 17:48:11 +01:00
Scott Sadler
aa3a525dc1 Release process changes for Minor and Patch version 2017-01-27 15:27:44 +01:00
vrde
2c87f1c28a
Update docs 2017-01-27 14:35:37 +01:00
Scott Sadler
509b590b32 pull changelog from 0.8.2 2017-01-27 11:40:41 +01:00
tymlez
12c16dbc12 Merge pull request #3 from tymlez/consensus_plugin_prod
Consensus Plugin
2017-01-26 21:39:26 +03:00
tymlez
750304b575 resolve travis errors 2017-01-26 18:36:38 +00:00
vrde
54544f66a0
Simplify run function 2017-01-26 17:12:35 +01:00
libscott
d55ed7adf4 Merge pull request #1103 from bigchaindb/http-case-insensitive-parameters
Case insensitive "unspent" and "operation" parameters"
2017-01-26 17:02:37 +01:00
libscott
05eeb6bc8a Merge pull request #1101 from bigchaindb/revert-duplicate-asset-id
Revert "duplicate asset ID" and apply "get_txids_filtered" interface.
2017-01-26 17:02:19 +01:00
libscott
2af938830f Merge pull request #1102 from bigchaindb/double-input-bug
Fix spend input twice bug
2017-01-26 17:01:48 +01:00
Sylvain Bellemare
3c55115636 Add changes for 0.8.1 release to changelog 2017-01-26 10:29:29 -05:00
Rodolphe Marques
9d03aeb72a fixed tests 2017-01-26 15:02:48 +01:00
tymlez
f9d398c03a Merge pull request #1 from tymlez/consensus_plugin
consensus plugin
2017-01-26 16:02:14 +03:00
Scott Sadler
1243322aad Case insensitive "unspent" and "operation" parameters" 2017-01-26 13:59:52 +01:00
Scott Sadler
adb579ac0a Revert "duplicate asset ID" and apply "get_txids_filtered" interface. 2017-01-26 13:52:09 +01:00
Scott Sadler
9762b4b968 fix spend input twice bug (https://github.com/bigchaindb/bigchaindb/issues/1099) 2017-01-26 13:39:06 +01:00
vrde
ca49718d7e
s/table/collection/g 2017-01-26 11:23:50 +01:00
Sylvain Bellemare
05fdcef670 Document default value for GET /outputs?unspent= 2017-01-26 05:05:54 -05:00
vrde
83afab4958
Fix indentation problem 2017-01-26 10:22:43 +01:00
vrde
baeae19951
Add experimental run interface 2017-01-26 09:56:13 +01:00
Rodolphe Marques
8e8a60a539 Get the correct configuration if backend is set by envs 2017-01-25 13:58:35 +01:00
libscott
cd7d65b63e Merge pull request #1066 from bigchaindb/1021/http_outputs_endpoint
1021/http outputs endpoint
2017-01-25 13:24:10 +01:00
libscott
80ff52e05c Merge pull request #1087 from bigchaindb/tx-post-202
Return 202 on successful transaction POST
2017-01-25 13:23:45 +01:00
Rodolphe Marques
391da2cf60 Added tests 2017-01-25 12:36:08 +01:00
Scott Sadler
7af9975081 return 202 on successful transaction POST 2017-01-25 12:23:36 +01:00
libscott
34d1a329ca Merge pull request #830 from bigchaindb/docs/601/design-http-api
es[WIP/Feedback] Design BigchainDB HTTP API v0.9
2017-01-25 12:15:31 +01:00
tim
5b7dd672b8 Remove controversial endpoints for now 2017-01-25 11:30:40 +01:00
tim
7a71e386f3 Fix whitespace 2017-01-25 11:06:54 +01:00
Scott Sadler
88b99d7bdc document optional operation parameter in transaction 2017-01-25 11:06:54 +01:00
Scott Sadler
d932184b88 update http docs to reflect changes implemented for 0.9 2017-01-25 11:06:54 +01:00
Brett Sun
2d1699e790 Split block and transaction status endpoint descriptions 2017-01-25 10:44:06 +01:00
Brett Sun
787512014a Fix small typos in API docs 2017-01-25 10:44:06 +01:00
diminator
d68d70ebc3 improved documentation on statuses links and values 2017-01-25 10:44:06 +01:00
diminator
7d5d79a50c remove location header from status 2017-01-25 10:44:06 +01:00
diminator
ec5000bd47 add curly brackets around url 2017-01-25 10:44:06 +01:00
diminator
4dea64f3be /transactions root endpoint returns 400 2017-01-25 10:44:06 +01:00
diminator
deba454eb0 400 OK -> bad request 2017-01-25 10:44:06 +01:00
diminator
a6facc8ada reformat blocks + blocks endpoint as list 2017-01-25 10:44:06 +01:00
diminator
86be0e5983 move blocks and votes to advanced with intro 2017-01-25 10:44:06 +01:00
diminator
4631c93dbf statuses remove 303 and location, links in payload 2017-01-25 10:44:06 +01:00
Dimitri De Jonghe
60b21fd24c add comma 2017-01-25 10:44:06 +01:00
Scott Sadler
9e163ed2e5 update api root informational endpoint docs 2017-01-25 10:44:06 +01:00
Dimitri De Jonghe
7d7a05c706 remove href from links 2017-01-25 10:44:06 +01:00
diminator
cb4207fb32 version 0.9 to api version 1 2017-01-25 10:44:06 +01:00
diminator
8bbaa0e40e status endpoint query params and remove links 2017-01-25 10:44:06 +01:00
diminator
6cf39542ea improve wording on post transactions status codes 2017-01-25 10:44:06 +01:00
diminator
fde3d21ba7 POST /transactions returns statuses payload 2017-01-25 10:43:17 +01:00
diminator
005a164e6b additional info on INVALID block 2017-01-25 10:43:17 +01:00
diminator
1ef2da7c32 mention history and provenance 2017-01-25 10:43:17 +01:00
diminator
9d6ca861a7 Note on retrieving the list of assets 2017-01-25 10:43:17 +01:00
diminator
7576210c82 remove GENESIS from operations 2017-01-25 10:43:17 +01:00
diminator
df94427cca fulfilled conditions -> unspent outputs 2017-01-25 10:43:17 +01:00
diminator
6ea7b8a411 remove is_assets sample 2017-01-25 10:43:17 +01:00
diminator
f17a722634 remove is_asset 2017-01-25 10:43:17 +01:00
diminator
9e5623f881 Removed X-bigchaindb-timestamp 2017-01-25 10:43:17 +01:00
diminator
5fa3cddbb7 transactions and blocks root endpoints 2017-01-25 10:43:17 +01:00
diminator
305adba3a4 include metadata in samples 2017-01-25 10:42:32 +01:00
diminator
940a0cd4df (fix): add private_key of node to bigchain instance 2017-01-25 10:42:32 +01:00
diminator
8c46cc3fb4 (fix): travis error on keypair 2017-01-25 10:42:32 +01:00
diminator
0ce9cc4f55 Return transaction if it's in backlog also 2017-01-25 10:42:32 +01:00
diminator
6aca7e2605 list assets recipe and sample 2017-01-25 10:42:32 +01:00
diminator
14f22cb8af status with block and transaction context 2017-01-25 10:42:32 +01:00
diminator
b252c40793 GET /votes examples -> samples 2017-01-25 10:42:32 +01:00
diminator
be5bc9fafd GET blocks?txid examples -> samples 2017-01-25 10:42:32 +01:00
diminator
e79a76512f remove rudimentary note and typo's 2017-01-25 10:42:32 +01:00
diminator
e54d50a58f Add docs links to root endpoints 2017-01-25 10:41:51 +01:00
diminator
21ffe22516 API root URL vs BigchainDB root URL 2017-01-25 10:39:21 +01:00
diminator
204c8cce9c GET blocks/id examples -> samples 2017-01-25 10:38:33 +01:00
diminator
5c10602754 examples -> samples POST /transaction and /statuses 2017-01-25 10:38:33 +01:00
diminator
35a7d11fb3 remove metadata query from endpoint -> see #856 2017-01-25 10:36:20 +01:00
diminator
b947cf7c72 GET transactions?operation&asset_id examples --> samples
Updated example to include more than one TRANSFER
2017-01-25 10:36:20 +01:00
diminator
a37b505c87 (fix): forgot one owners_after -> public_keys 2017-01-25 10:36:20 +01:00
diminator
d09a93f1a7 update GET transactions?unfulfilled
- owners_after -> public_keys
- examples -> samples
2017-01-25 10:36:20 +01:00
diminator
a8f8c7f4a9 GET transactions/id examples --> samples 2017-01-25 10:36:20 +01:00
diminator
56b4da02c9 (fix) : minor fixes to server docs for building 2017-01-25 10:36:20 +01:00
tim
6e25ef4598 Add retrieve votes by block 2017-01-25 10:36:20 +01:00
tim
df3ded315c Remove retrieve vote by vote_id
After talking to @r-marques and @libscott:

    - A vote's id is currently generated by RethinkDB
    - To verify a vote, the signature and the pubkey should be used
    - Vote's id will be removed from the "external" vote model in the
    future
    - Nobody would want to retrieve a vote, but rather a vote by block

In case of the HTTP API, this means that a /votes/vote_id endpoint is
not feasible to implement.
2017-01-25 10:36:20 +01:00
tim
0c651f6b11 Timestamp of block as header: /transactions/tx_id
For reasoning, see:
https://github.com/bigchaindb/bigchaindb/pull/830#issuecomment-262774345
2017-01-25 10:36:20 +01:00
tim
8e91e14e86 Add /blocks/{block_id} safety querystring
It didn't feel good letting users retrieve also invalid or undecided
blocks in the /blocks/{block_id} endpoint.

Hence, now a block can be evaluated by it's status.
If block_id and status do not match, a 404 Not Found HTTP status code is
returned.
Per default, status is set to valid only.
2017-01-25 10:36:20 +01:00
tim
8f7816d325 Bigchaindb --> BigchainDB 2017-01-25 10:36:20 +01:00
tim
91a1151255 Add endpoint to get blocks by transaction 2017-01-25 10:33:37 +01:00
tim
5048846b0f Minor corrections on /statuses 2017-01-25 10:33:37 +01:00
tim
5ac7eb9b5a Add notes about endpoint specialities
For details, see the following comment:
https://github.com/bigchaindb/bigchaindb/pull/830#issuecomment-262468005
2017-01-25 10:33:37 +01:00
tim
9cd4c18fb4 Remove uuid based endpoints 2017-01-25 10:33:37 +01:00
tim
ea16a8731e Remove ?fields query string 2017-01-25 10:33:37 +01:00
tim
26cb00ab9c Document /block/block_id endpoint 2017-01-25 10:33:37 +01:00
tim
af6b799c4f Adjustments according to feedback
- owner_afters --> owners_after
- List choices for operation query string
- List choices for fields query string
- Use proper sphinx-way to define type of query string
2017-01-25 10:33:37 +01:00
tim
2997a5e994 Minor corrections to endpoints 2017-01-25 10:33:37 +01:00
tim
d748a1dc18 Minor corrections of redundant infos 2017-01-25 10:33:37 +01:00
tim
9a1b1364ea Add response headers 2017-01-25 10:33:37 +01:00
tim
152f151f23 :param _: --> :query _: 2017-01-25 10:33:07 +01:00
tim
eda8cdbba1 Add docs about /transactions endpoint 2017-01-25 10:33:07 +01:00
tim
f18f3cb8d2 Add sections to be done 2017-01-25 10:33:07 +01:00
tim
0a06547c1b Add transactions by metadata id endpoint 2017-01-25 10:33:07 +01:00
tim
ee904d78f4 Add transactions by asset id endpoint 2017-01-25 10:32:17 +01:00
tim
748e155378 Get block status using /statuses 2017-01-25 10:32:17 +01:00
tim
58d0b771cb id --> resource_id
Inevitably, some resources will not allow to filter by the exact
    keyword that is included in a resources body.

    Take for example asset and metadata.
    They both have a property called 'id', hence requests of a form:

        /transactions&fields=x,y&property_name=z

    might now be allowed to be resolved as the keyword 'id' in this
    case could reference both 'metadata.id' and 'asset.id'.

    This problem cannot be structurally resolved with URL paths.
    Hence it was decided to emphasize on a few resources that
    implement 'id' as a sort-of primary key.
2017-01-25 10:32:17 +01:00
tim
90aff0e202 Give up /conditions endpoint
A transaction contains:

        - conditions
        - fulfillments
        - assets
        - meta data

    While:

        - assets; and
        - meta data

    could be viewed as their own "tables" or resources, conditions
    and fulfillments cannot. Why?

    Because in comparison they do not contain a primary key, allowing
    them to be queried by it.
2017-01-25 10:32:17 +01:00
tim
156bf4fb21 txid --> id
KISS: A transaction is a resource as every other. Let's not give it
a special id (like 'txid'), but simply a regular id.
2017-01-25 10:32:17 +01:00
tim
9766332b8b Restructure doc: Endpoints as roots 2017-01-25 10:32:17 +01:00
tim
85d9553a1e owner_after --> owners_after
Querystring keywords should be in line with data model.
2017-01-25 10:31:25 +01:00
tim
e243a1be9b Use sphinx note for note in document 2017-01-25 10:31:25 +01:00
tim
0dc9b46ea7 Structural changes to the document
- Remove /unspents/ and replace with endpoint under /transactions
- Remove /transactions/txid/conditions/cid endpoint
2017-01-25 10:30:58 +01:00
tim
b488997353 tx_id --> txid 2017-01-25 10:29:12 +01:00
tim
5789a37664 Allow /statuses to return a 303 See Other response.
According to: https://www.ietf.org/rfc/rfc2616.txt a 303 See Other can
be returned to indicate that the resource the user is looking for can be
found under a new path.
In the case of a transaction including the `status == 'valid'`, we
return 303 See Other, as well as a Location header to the /transactions
endpoint.

"The response to the request can be found under a different URI and SHOULD be
retrieved using a GET method on that resource."
2017-01-25 10:29:12 +01:00
tim
71d3c70fda Status --> Statuses
Usage of singular resource names is discouraged in REST:
http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

The plural of status is statuses:
http://english.stackexchange.com/questions/877/what-is-the-plural-form-of-status
2017-01-25 10:28:28 +01:00
tim
1086c3a5c4 POST /transactions status code to 202
According to https://www.ietf.org/rfc/rfc2616.txt a 201 Created status
code MUST only be returned when:

"The origin server MUST create the resource before returning the 201 status
code."

hence, a 202 Accepted's definition is more appropriate:

"The request has been accepted for processing, but the processing has not been
completed.

The entity returned with this response SHOULD include an indication of the
request's current status and either a pointer to a status monitor or some
estimate of when the user can expect the request to be fulfilled."
2017-01-25 10:27:52 +01:00
tim
f15a7f7e8b Document conditions endpoint 2017-01-25 10:23:14 +01:00
Rodolphe Marques
69505a366b Added bigchaindb commands to add and remove nodes from replicaset 2017-01-24 17:55:06 +01:00
Rodolphe Marques
5683ed5163 Added mongodb admin commands to add and remove members from the
replicaset
2017-01-24 15:59:02 +01:00
libscott
4802f0fabe Merge pull request #1080 from bigchaindb/no-dev-in-tx-version
short form 0.9, 0.10 etc tx version with no '.dev' suffix
2017-01-24 14:34:37 +01:00
Scott Sadler
e3317b370b don't rename TransactionLink to TL 2017-01-24 12:11:21 +01:00
Scott Sadler
af23ff5b65 clean up use of double quotes, rename UNSPENTS_ENDPOINT, clarify test 2017-01-24 12:08:55 +01:00
libscott
a7a163fd3c Merge pull request #1083 from bigchaindb/single-quotes
Add flake8-quotes checker and cleanup double quotes
2017-01-24 12:07:29 +01:00
Sylvain Bellemare
7207f57879 Change to single quotes 2017-01-24 10:24:16 +01:00
Sylvain Bellemare
fe5d966dca Put back some strings with wrapped single quotes
just to double check that flake8-quotes does indeed tolerate it
2017-01-24 10:22:32 +01:00
tymlez
78bd1ecd96 consensus plugin 2017-01-24 09:12:16 +00:00
Scott Sadler
bd048a3115 add flake8-quotes checker and cleanup double quotes 2017-01-23 17:30:37 +01:00
Rodolphe Marques
927e57beba Changed backend.connect to handle backend specific kwargs.
Fixed tests
2017-01-23 17:29:42 +01:00
Rodolphe Marques
f12264773c bigchaindb configure now requires a positional backend argument.
Created and fixed tests.
Updated `b` fixture
2017-01-23 16:49:59 +01:00
Scott Sadler
897ffe81bc outputs endpoint with unspent filter parameter 2017-01-23 16:10:21 +01:00
Scott Sadler
4bb64fa0b8 generalise get_owned_ids to get_outputs and get_owned_ids 2017-01-23 16:10:21 +01:00
libscott
ad2abcf723 Merge pull request #1065 from bigchaindb/1021/http_transactions_list
1021/http transactions list
2017-01-23 16:06:07 +01:00
Troy McConaghy
616e6ce263 Merge pull request #1078 from bigchaindb/better-error-handling-in-awsdeploy.sh
Better error handling in awsdeploy.sh
2017-01-23 15:25:18 +01:00
Scott Sadler
ccdbb91c1c short form 0.9, 0.10 etc tx version with no '.dev' suffix 2017-01-23 15:16:15 +01:00
Troy McConaghy
2c78870d3a Merge pull request #1076 from bigchaindb/docs/1048/how-to-install-os-deps-for-fabric
Docs: Added instructions to install fabric's OS-level dependencies
2017-01-23 15:14:37 +01:00
Troy McConaghy
315695a486 Merge pull request #1075 from bigchaindb/docs/1023/update-os-reqs-in-quickstart-docs
Docs: Quickstart page now assumes you're using Ubuntu 16.04 or similar
2017-01-23 15:13:40 +01:00
libscott
23ba642d2c s/txes/txs/g 2017-01-23 14:38:30 +01:00
Scott Sadler
a5acd0c7b9 document patching technique in get_transactions_filtered web view test 2017-01-23 14:07:22 +01:00
Troy McConaghy
36eccb3f83 Better error handling in awsdeploy.sh 2017-01-22 16:20:13 +01:00
Troy McConaghy
98fb15c124 Added instructions to install fabric's OS-level dependencies 2017-01-22 15:07:14 +01:00
Troy McConaghy
15d28e3f91 Quickstart now assumes you're using Ubuntu 16.04 or similar 2017-01-22 14:47:45 +01:00
Troy McConaghy
b10b03e3ca Changed 'len(validated_transactions) == 0' to 'not validated_transactions' as suggested by @amirelemam in #762 2017-01-22 13:48:34 +01:00
Troy McConaghy
e253ca015f Line-length changes, many suggested by @amirelemam in #762 2017-01-22 13:45:17 +01:00
Rodolphe Marques
e7ffcf5705 Added replicaset name to bigchaindb config (#1063)
* Added replicaset name to bigchaindb config

* changed travis replSet to match bigchaindb default

* Updated initialize_replica_set

It now initializes the replica set with the name provided by the
bigchaindb config file.


* initialize_replica_set is now called when creating a mongodb connection.

This way we are sure that a replica set exists when we return a
connection.

* Moved the initialize replica set logic to the connection.

* update the config documentation
2017-01-20 14:05:28 +01:00
Scott Sadler
c5253825b3 remove unused backend query stub get_txids_by_asset_id 2017-01-20 10:31:28 +01:00
Scott Sadler
f2034cddde make asset_id not optional in get_transactions_filtered 2017-01-20 10:08:30 +01:00
Sylvain Bellemare
7606bdb59f Merge pull request #1070 from utarl/fix-wrong-link-in-readme
change the link to consensus.py to right one
2017-01-20 03:44:25 -05:00
utarl
ef4bc69f5b change the link to consensus.py to right one 2017-01-20 16:27:57 +08:00
Scott Sadler
2ec23be05d fix flake8 2017-01-18 17:13:38 +01:00
Troy McConaghy
3344fdfe50 Merge pull request #1053 from bigchaindb/docs/1047/long-description-in-setup-py
In setup.py: longer long_description & updated the docs URL
2017-01-18 16:00:03 +01:00
Scott Sadler
ae14d0e5c4 api method to get transactions by asset_id 2017-01-18 15:43:53 +01:00
Scott Sadler
1c918caf4c txlist / get_transactions_filtered 2017-01-18 15:42:47 +01:00
Scott Sadler
dbb3414fd0 generalise get_txids_by_asset_id into get_txids_filtered and remove get_transactions_by_asset_id 2017-01-18 15:42:47 +01:00
Scott Sadler
d899d4c8b6 query string parameters test 2017-01-18 15:42:17 +01:00
Troy McConaghy
e54854c082 In setup.py: enterprise --> enterprises 2017-01-18 15:41:29 +01:00
libscott
8e497347d5 Merge pull request #1043 from bigchaindb/duplicate-asset-id
duplicate tx.id into tx.asset.id in CREATE transactions
2017-01-17 15:00:33 +01:00
libscott
a706d88b30 Merge pull request #1051 from bigchaindb/fix/norandom-test_get_spent_multiple_owners
Remove use of random in test_bigchain_api
2017-01-17 14:54:07 +01:00
Brett Sun
b59ea00118 Merge pull request #1031 from bigchaindb/feat/api/blocks
Implement blocks endpoint
2017-01-17 14:42:24 +01:00
Brett Sun
0751b2bf0b Merge pull request #1029 from bigchaindb/feat/api/votes
Implement votes endpoint
2017-01-17 14:42:02 +01:00
Troy McConaghy
8307c09b92 Updated docs URL in setup.py 2017-01-17 14:21:54 +01:00
Troy McConaghy
d5143f99d8 Longer long_description in setup.py 2017-01-17 14:21:08 +01:00
Sylvain Bellemare
1dbc998b36 Only fetch needed element (public key) 2017-01-17 07:50:00 -05:00
Sylvain Bellemare
5759de6ae3 Remove unused fixture 2017-01-17 07:50:00 -05:00
Sylvain Bellemare
9766aa90a1 Addresses #663 partially 2017-01-17 07:50:00 -05:00
Sylvain Bellemare
c1b6f60f70 Add an exception message 2017-01-17 07:50:00 -05:00
Scott Sadler
7c4c7e9be3 remove use of random in test_bigchain_api 2017-01-17 11:48:58 +01:00
libscott
da69aa11f1 Update test_digital_assets.py
On mobile!
2017-01-16 17:47:51 +01:00
Scott Sadler
d9cf4df5e6 duplicate asset id / fix test_get_transactions_by_asset_id 2017-01-16 16:08:15 +01:00
Scott Sadler
71e52ed36b duplicate asset id / fix get-by-asset-id in rethinkdb 2017-01-16 15:48:10 +01:00
Scott Sadler
d7126169f4 duplicate asset id / fix flake8 errors 2017-01-16 15:41:26 +01:00
Scott Sadler
392ae3dc58 update description in transaction.yaml for asset id 2017-01-16 15:29:10 +01:00
Scott Sadler
47f09c0e67 documentation changes for duplicate asset id 2017-01-16 15:24:51 +01:00
Scott Sadler
003519b0a8 duplicate tx.id into tx.asset.id in CREATE transactions 2017-01-16 15:03:54 +01:00
Sylvain Bellemare
6c31ab0a7c Correct path to server html docs 2017-01-16 08:29:17 -05:00
Sylvain Bellemare
04789aad96 Add docs for TABLES constant 2017-01-16 07:12:25 -05:00
Sylvain Bellemare
d71fdcbe78 Add backend admin sections to docs 2017-01-16 07:12:25 -05:00
Sylvain Bellemare
4d6df06236 Resolves #948 2017-01-16 07:12:25 -05:00
Brett Sun
9094ddac20 Fix flake8 error with votes API 2017-01-13 18:27:54 +01:00
Brett Sun
ded7f3e28f PR comments 2017-01-13 18:25:35 +01:00
Brett Sun
08d9e462c7 Use list comprehension to calculate block API result 2017-01-13 18:24:05 +01:00
diminator
8b286819f5 revert docker compose 2017-01-13 18:08:28 +01:00
diminator
3919cc3d5d return empty list if no blocks found 2017-01-13 18:08:28 +01:00
diminator
f018a4f6e7 replace status strings by Bigchain attributes 2017-01-13 18:08:28 +01:00
diminator
1cc46fb86e return list of block_id
implement status query param
test
2017-01-13 18:08:27 +01:00
diminator
1b57ace714 implement GET /blocks endpoint 2017-01-13 18:08:25 +01:00
Brett Sun
7071d471a5 Add test for empty block_id parameter for votes API 2017-01-13 18:07:12 +01:00
Brett Sun
b1d6d356cb Refactor votes API view to use required parser argument rather than custom logic 2017-01-13 18:07:00 +01:00
Sylvain Bellemare
b12ea854f7 Remove unused import 2017-01-13 09:17:13 -05:00
libscott
e08bf52fa7 Merge pull request #1018 from bigchaindb/change-tx-version
Change version in tx model to 0.9
2017-01-13 12:07:23 +01:00
Rodolphe Marques
f45e36a38d enable codecov for mongodb 2017-01-13 04:56:06 -05:00
Rodolphe Marques
e52cb40edb Some more tests for mongodb code (#1036)
* Some more tests for mongodb code

Cleanup connection code

* pep8 fixes
2017-01-13 10:25:45 +01:00
Rodolphe Marques
5abe6dd7ea Added tests to the mongodb changefeed (#1035)
* Added tests to the mongodb changefeed

* pep8 and typo fixes
2017-01-13 10:18:58 +01:00
libscott
8510f47ed4 Merge pull request #1024 from bigchaindb/1021/http_api_root
1021/http api root
2017-01-12 16:13:30 +01:00
libscott
ece5581eb3 Merge branch 'master' into 1021/http_api_root 2017-01-12 15:26:10 +01:00
diminator
5e3bd1d54c
rename test functions 2017-01-12 10:43:11 +01:00
Rodolphe Marques
fa8608b242 small fix write_vote 2017-01-12 10:41:55 +01:00
Sylvain Bellemare
29c10e30a9 Resolves #1004 2017-01-12 04:05:59 -05:00
diminator
af2e8e14a5
Merge remote-tracking branch 'remotes/origin/master' into feat/api/votes 2017-01-12 09:59:39 +01:00
Dimitri De Jonghe
03d46b40f9 Merge pull request #1026 from bigchaindb/feat/api/statuses
implement statuses endpoint
2017-01-12 09:55:34 +01:00
diminator
8aa37277c2
remove blank line for travis 2017-01-11 17:17:20 +01:00
Sylvain Bellemare
c036b1490b Inherit from BigchainDBError for common exceptions 2017-01-11 07:48:28 -05:00
Sylvain Bellemare
fdf2a85c97 Add a BigchaindDB base exception class 2017-01-11 07:48:28 -05:00
Sylvain Bellemare
ec14389080 Merge pull request #1032 from bigchaindb/fix-tests-readme
Update tests readme
2017-01-11 07:46:12 -05:00
diminator
ceeba0e89a
logical xor & status flag 2017-01-11 13:45:47 +01:00
Sylvain Bellemare
4c8d1c6e8c Document how to run tests for mongodb with docker 2017-01-11 13:21:27 +01:00
Sylvain Bellemare
4994e30f0c Run mongod with --replSet=rs0 option 2017-01-11 13:21:27 +01:00
Sylvain Bellemare
e696883f66 Pin rethinkdb version to 2.3.5 in docker-compose 2017-01-11 13:21:27 +01:00
Sylvain Bellemare
f57990c9ea Pin mongodb version to 3.4.1 in docker-compose.yml 2017-01-11 13:21:27 +01:00
Rodolphe Marques
376172ec18 Update the README with instructions to run the tests against mongodb 2017-01-11 13:21:27 +01:00
Sylvain Bellemare
8b2ae1daf2 Merge pull request #1011 from josephwinston/jbw/fix-locale
Fix use of locales for python et al
2017-01-11 05:53:06 -05:00
Sylvain Bellemare
1cfd3de60e Fix flake8 errors in tests 2017-01-11 05:13:27 -05:00
Sylvain Bellemare
c02478e0b2 Add flake8 option to setup.cfg 2017-01-11 05:13:27 -05:00
Sylvain Bellemare
0233a38f0b Closes #996 2017-01-11 05:13:27 -05:00
Rodolphe Marques
c91eff70e5 Feat/960/test mongodb queries (#1030)
* Created tests to mongodb queries

Small fix to queries

* cleanup pytest markers
2017-01-10 16:49:30 +01:00
Rodolphe Marques
b4602b6283 Merge pull request #1027 from bigchaindb/feat/1020/fix-tests-mongodb
Feat/1020/fix tests mongodb
2017-01-10 15:38:53 +01:00
Rodolphe Marques
aa6d4fdcc8 small fix to test 2017-01-10 15:31:16 +01:00
diminator
322d6bde12
(fix): each import on its own line 2017-01-10 14:45:29 +01:00
diminator
3d643787d2
update docstring 2017-01-10 11:41:04 +01:00
diminator
5608a36616
implement /votes endpoint 2017-01-10 11:34:10 +01:00
libscott
b592786882 Merge pull request #1019 from bigchaindb/add_multiple_current_owners_for_doc
Add multiple current owners for doc
2017-01-10 11:11:18 +01:00
libscott
0b0dadd6fa Update test_transaction.py 2017-01-09 17:44:02 +01:00
diminator
15b91fea99
clean up links wrapper 2017-01-09 17:37:01 +01:00
diminator
8fa231c040
include _links in transaction status payload 2017-01-09 17:14:22 +01:00
Rodolphe Marques
f4bbf27815 fix indentation error 2017-01-09 16:28:20 +01:00
Rodolphe Marques
24c1f8d804 mongodb at the end of travis matrix 2017-01-09 14:15:01 +01:00
Rodolphe Marques
abf77c04ee Omit mongod log messages.
MongoDB failures no longer allowed
2017-01-09 14:10:49 +01:00
Rodolphe Marques
9bc658b833 fix travis mongodb integration 2017-01-09 14:03:57 +01:00
Rodolphe Marques
c6ea345d86 Updated mongodb queries to work with new transaction model. 2017-01-09 13:49:55 +01:00
Rodolphe Marques
8926178e52 initialize replica set for tests 2017-01-09 13:32:17 +01:00
Rodolphe Marques
7f05974f0f Added a secondary index with uniqueness constraint in backlog.
Several test fixes
2017-01-09 13:25:42 +01:00
Rodolphe Marques
595f7dc701 several fixes to mongodb queries 2017-01-09 13:25:27 +01:00
Trent McConaghy
af39e204c9 "ascribe" -> "BigchainDB" 2017-01-07 11:31:51 +01:00
diminator
7124adcd34
implement statuses endpoint 2017-01-06 15:55:07 +01:00
Scott Sadler
990d863dc7 tests for informational endpoints 2017-01-06 14:46:40 +01:00
Scott Sadler
80f3bb3809 /api/v1/ informational endpoint 2017-01-06 14:46:40 +01:00
libscott
f9ed5690a7 Merge pull request #1022 from bigchaindb/flask_routes
Collect http routes into single module
2017-01-06 13:50:56 +01:00
libscott
32930ab4d3 Remove blank line at end of file 2017-01-06 13:43:12 +01:00
Scott Sadler
1d234d3811 collect http routes into single module 2017-01-05 13:31:05 +01:00
libscott
3d74bfbb89 Merge pull request #1014 from bigchaindb/884/sha3-2015
update pysha3 to 1.0b1, sha3 NIST 2015 standard
2017-01-05 11:58:49 +01:00
Scott Sadler
6d3fa10e20 use pysha3 1.0.0 2017-01-05 10:19:20 +01:00
Scott Sadler
d714b133aa documentation fixes to inputs-outputs.rst 2017-01-05 10:15:35 +01:00
Rodolphe Marques
8e99d18fd6 Merge pull request #994 from bigchaindb/feat/927/implement-mongodb-changefeed
[WIP] Implement mongodb changefeed
2017-01-04 17:10:46 +01:00
Troy McConaghy
70390dd748 Merge pull request #1015 from bigchaindb/feat/843/option-to-disable-web-admin-on-aws
Added ENABLE_WEB_ADMIN config setting to AWS depl. configs
2017-01-04 16:29:34 +01:00
Rodolphe Marques
1b3c909d51 Fixed mongodb queries
Fixed some tests
2017-01-04 15:43:17 +01:00
Scott Sadler
cadc9add39 fixups for 'multiple current owners' section in inputs/outputs docs 2017-01-04 15:39:10 +01:00
Scott Sadler
48b90407bd change version in tx model to 0.9. The idea is that we will go with the server version until we hit 1.0 where we should be stable, then re-evaluate. 2017-01-04 15:10:15 +01:00
Rodolphe Marques
ea4d01dec0 Simplify code.
Pop the `_id` when receiving the document on the changefeed
2017-01-04 13:27:08 +01:00
utarl
ab8579148c add multiple current owners 2017-01-04 10:49:07 +08:00
utarl
4266499263 change messy code 2017-01-04 10:44:30 +08:00
utarl
0c53a49405 change messy code 2017-01-04 10:36:10 +08:00
utarl
b8ae2132aa change messy code 2017-01-04 10:21:43 +08:00
utarl
c0d812f0d2 change messy code 2017-01-04 10:18:06 +08:00
utarl
4de0bb4c8c change messy code 2017-01-04 10:11:00 +08:00
utarl
96432ce0be add multiple current owners 2017-01-04 10:01:45 +08:00
troymc
ca14321a3e Added ENABLE_WEB_ADMIN config setting to AWS depl. configs 2017-01-03 17:05:24 +01:00
Scott Sadler
eeef08a43a mention version of pysha3 and link to pypi page instead 2017-01-03 17:04:43 +01:00
Scott Sadler
c31feaf83d update pysha3 to 1.0b1, sha3 NIST 2015 standard 2017-01-03 16:55:28 +01:00
Rodolphe Marques
0d11c3a7a8 simplify update transaction 2017-01-03 15:54:06 +01:00
Rodolphe Marques
3529bf9114 Fixed mongodb queries to work with pipelines.
Added some logging to the pipeline processes
2017-01-03 15:09:23 +01:00
Jody Winston
704d55988b Fix use of locales for python et al 2016-12-30 12:53:53 -06:00
Brett Sun
8fa3245309 Rename any *util.py to *utils.py (#991) 2016-12-22 17:39:39 +01:00
Brett Sun
438958fdea Rename builtin-in input override in commands (#988)
* Rename commands.bigchain.input to input_on_stderr to avoid confusion

* Allow input_on_stderr to not take a prompt

* Fix tests broken by renaming of commands.bigchaindb.input
2016-12-22 17:03:53 +01:00
Rodolphe Marques
0fdcff90f9 Remove uniqueness constraint of mongodb secondary indexes. 2016-12-22 15:49:20 +01:00
Rodolphe Marques
0f88776537 small fixes to the mongodb changefeed 2016-12-22 15:43:22 +01:00
Rodolphe Marques
a0952df9fb fixed mongodb queries to return genesis block and last voted block 2016-12-22 14:30:19 +01:00
Rodolphe Marques
9f738cd58d re-enable changefeed for mongodb 2016-12-22 14:18:31 +01:00
libscott
5190e0a682 Merge pull request #925 from bigchaindb/inputs-outputs
Inputs & Outputs
2016-12-22 13:52:19 +01:00
Scott Sadler
04a78aacec Merge remote-tracking branch 'origin/master' into inputs-outputs 2016-12-22 13:45:02 +01:00
Rodolphe Marques
00458cfa68 Initial implementation of the mongodb changefedd 2016-12-22 12:07:36 +01:00
Brett Sun
2882bee48e Small flake8 fixes for tests (#987) 2016-12-22 11:57:13 +01:00
Brett Sun
9319583ab4 Remove Asset and AssetLink (#982)
* Remove asset.validate_asset and move its validation checks to other areas

* Move Asset.get_asset_id to Transaction

* Remove Asset and AssetLink models

* Add test against creating TRANSFER transactions with bad asset
2016-12-22 10:19:21 +01:00
Sylvain Bellemare
44391da94a Add genesis block fixture and marker 2016-12-21 17:45:14 +01:00
Rodolphe Marques
5017ece84c Merge pull request #983 from bigchaindb/feat/980/initialise-replica-set-mongo
Initialize mongodb replica set
2016-12-21 17:26:22 +01:00
Rodolphe Marques
9c0d696b7e Better unittests
Simplify code
2016-12-21 16:52:57 +01:00
Rodolphe Marques
5fedabe586 fix test 2016-12-21 15:55:29 +01:00
Rodolphe Marques
1dd6c748b9 Merge remote-tracking branch 'origin/master' into feat/980/initialise-replica-set-mongo 2016-12-21 15:54:02 +01:00
Rodolphe Marques
4a14c7c8f1 Initialize replica set for mongodb when running bigchaindb init 2016-12-21 15:53:25 +01:00
Sylvain Bellemare
3a7fe30a31 Add description for bdb marker 2016-12-20 20:37:28 +01:00
Sylvain Bellemare
57b14c3062 Rename db_name to dbname 2016-12-20 20:37:28 +01:00
Sylvain Bellemare
7db02fa024 Get config from bigchaindb not from fixture
the fixture no longer returns the config, and is meant only to set the
config
2016-12-20 20:37:28 +01:00
Sylvain Bellemare
a269375278 Use pytest custom marker "bdb"
note that the marker, although invoked for the entire module, will be
applied for each function
2016-12-20 20:37:28 +01:00
Sylvain Bellemare
f6a55c78af Implement test utils function to flush mongo db 2016-12-20 20:37:28 +01:00
Sylvain Bellemare
18d5a49097 Take env var value if set for db port 2016-12-20 20:37:28 +01:00
Sylvain Bellemare
11271738f3 Remove unnecessary fixture
it was needed when the root fixture was using autouse
2016-12-20 20:37:28 +01:00
Sylvain Bellemare
fa79fe6783 Add session scope test setup for config and db
resolves #966
2016-12-20 20:37:28 +01:00
Rodolphe Marques
83d37d699f Merge pull request #979 from bigchaindb/bug-mongodb-write-block
fix mongodb write_block
2016-12-20 19:07:15 +01:00
Brett Sun
151d1c5a0c Suggest starting multi-line imports on the next line to pass flake8 (#923) 2016-12-20 18:30:42 +01:00
Rodolphe Marques
71bb63376f fix mongodb write_block without thouching mongodb code 2016-12-20 18:04:38 +01:00
libscott
7e33f2bd52 Tx ID as Asset ID (#926)
* Allow AssetLinks to be used in place of Assets in the Transaction Model and enforce `Transaction.transfer()` to only take an AssetLink

* Remove AssetLink's inheritance from Asset

* Remove id from the Asset model

* Fix get_txids_by_asset_id query for rethinkdb after removing asset's uuid

Because `CREATE` transactions don't have an asset that contains an id
anymore, one way to find all the transactions related to an asset is to
query the database twice: once for the `CREATE` transaction and another
for the `TRANSFER` transactions.

* Add TODO notice for vote test utils to be fixtures

* Update asset model documentation to reflect usage of transaction id

* Fix outdated asset description in transaction schema
2016-12-20 17:28:15 +01:00
Rodolphe Marques
1d7a8e3369 Merge pull request #977 from bigchaindb/feat/958/test-mongo-connection
Test mongodb connection
2016-12-20 14:48:30 +01:00
Rodolphe Marques
47ca91355f Moved tests from rethinkdb test_run_query_util to test_connection 2016-12-20 14:32:53 +01:00
Rodolphe Marques
39c25b951f added tests for mongodb connection 2016-12-20 14:25:24 +01:00
Scott Sadler
d80de928a5 wording change in Transaction.create documentation 2016-12-20 14:15:05 +01:00
Troy McConaghy
8fa6789745 Merge pull request #965 from bigchaindb/move-all-runtests-docs-to-one-place
Consolidated all tests-related docs in one place
2016-12-20 14:02:52 +01:00
Rodolphe Marques
61cfe1b370 Merge pull request #971 from bigchaindb/feat/959/test-mongodb-schema
Created tests for mongodb schema
2016-12-20 13:56:32 +01:00
Brett Sun
ad6f267055 Add instructions for rebuilding docker images after upgrading 2016-12-20 13:52:46 +01:00
Troy McConaghy
8989731ae0 Merge pull request #976 from bigchaindb/update-azure-quickstart-template-docs-again
Updated the docs for the Azure Quickstart Template
2016-12-20 11:46:07 +01:00
troymc
854d2974f5 Removed instructions for the case when PR #2884 wasn't merged 2016-12-20 11:33:47 +01:00
libscott
b2cb426097 Merge pull request #962 from bigchaindb/remove-asset-keywords
Remove asset keywords
2016-12-20 10:02:42 +01:00
Troy McConaghy
ed3b0b8b9c Merge pull request #961 from bigchaindb/fix-http-api-docs-intro
Fixed HTTP API docs re/ API Endpoint
2016-12-19 17:48:51 +01:00
Brett Sun
8470854769 Add extra set of backticks for code-blocks in inputs and outputs docs 2016-12-19 16:14:58 +01:00
Brett Sun
b64026441b Add changes from @ttmc's suggestions 2016-12-19 16:12:09 +01:00
Brett Sun
d412c934b1 Add extra sentence to inputs and outputs docs describing divisible assets 2016-12-19 16:04:31 +01:00
Brett Sun
727e9822b5 Move asides in inputs and outputs docs to be sphinx notes 2016-12-19 16:04:31 +01:00
Brett Sun
a0487493ae Small wording and typo fixes for inputs and outputs docs 2016-12-19 16:04:31 +01:00
Rodolphe Marques
050990aac1 Created tests for mongodb schema
Removed some unused secondary indexes
2016-12-19 15:45:02 +01:00
Scott Sadler
3f2966072e change creators to tx_signers in Transaction.create 2016-12-19 15:42:11 +01:00
Brett Sun
7070c39aca Fix small typo in AmountError's docstring 2016-12-19 15:38:30 +01:00
troymc
8d0ff25a39 Don't include the top-level bigchaindb/ folder in path names 2016-12-19 15:34:58 +01:00
Scott Sadler
92fee24395 fix forgotten test inputs-outputs 2016-12-19 13:44:20 +01:00
Scott Sadler
9002066d4a fix documentation link error re inputs-outputs 2016-12-19 12:42:54 +01:00
Scott Sadler
6fb48dd172 fix TransactionLink.to_uri to use Output 2016-12-19 12:29:29 +01:00
Scott Sadler
33f05f7f6b re-frame documentation on crypto conditions around inputs and outputs 2016-12-19 12:29:29 +01:00
Brett Sun
02002bd5f8 Reword some transaction schema descriptions based on feedback 2016-12-19 12:29:29 +01:00
Scott Sadler
f4257030fc dont override input builtin in models.py 2016-12-19 12:29:29 +01:00
Scott Sadler
4e17fe5c3d change fulfills.idx to fulfills.output 2016-12-19 12:29:29 +01:00
Scott Sadler
d479a186a4 address wording problems re inputs/outputs in transaction-model.rst docs 2016-12-19 12:29:29 +01:00
Scott Sadler
b20a770b02 restore accidentally deleted tests 2016-12-19 12:29:29 +01:00
Brett Sun
2f4da6a32f Extra renames and small fixes for inputs-outputs (#952)
* Fix typos pointed out in review by @ttmc

* Reword description of an input in the transaction schema

* Re-add removed comment in transaction model

* Fix small typos in some comments in the transaction model

* Add trailling commas to a multiline dict in the transaction model tests

* Fix small things with server docs changes

* Add description of public keys' association with conditions in transaction concept docs

* Reword description of Transaction.create's  and  args

* Rename output_uri to output_condition_uri

* Fix hardcoded class name vs. self.__class__

* Rename instances of 'out' with 'output'

* Rename instances of  and  with  to avoid name clash with built-in

* Remove unnecessary renaming of cryptoconditions.Fulfillment import in transaction model

* Remove instances of  in transaction model

* Remove usages of fulfillment in cases where input makes more sense

* Reword docstrings for init methods in transaction models

* Rename usages of condition where output is now a better fit

* Add descriptions to TransactionLink's txid and idx in schema

* Minor correction to output idx description in transaction yaml
2016-12-19 12:29:29 +01:00
Scott Sadler
3d495a8987 update description of TRANSFER @ttmc 2016-12-19 12:29:29 +01:00
Scott Sadler
4b235f1f72 rename condition and fulfillment to output in test names where neccesary 2016-12-19 12:29:29 +01:00
Scott Sadler
05e8d6e28e fix documentation issue in transaction schema file 2016-12-19 12:29:29 +01:00
Scott Sadler
27ad7b5092 s/fulfillments/inputs/g && s/conditions/outputs/g (docs changes) 2016-12-19 12:29:29 +01:00
Scott Sadler
ed55b3984e s/fulfillments/inputs/g && s/conditions/outputs/g (code changes) 2016-12-19 12:29:29 +01:00
Scott Sadler
e2e3ecb9f4 put back owners_before and a bugfix in tx model 2016-12-19 12:29:29 +01:00
libscott
9bb8b33d72 Change 'spends' to 'fulfills' in tx model 2016-12-19 12:29:29 +01:00
Scott Sadler
26fe27e6cb spec change for inputs/outputs 2016-12-19 12:29:29 +01:00
Sylvain Bellemare
2b9a351912 Rename owner_after to public_key 2016-12-19 04:31:05 +01:00
troymc
ae236d9f23 Moved dev-and-test/running-all-tests.md content to tests/README.md 2016-12-18 11:41:04 +01:00
troymc
8fe0ece001 Renamed docs page 'Running Unit Tests' > 'Running All Tests' 2016-12-18 11:13:54 +01:00
troymc
dbe3c15d51 CONTRIBUTING.md now points to tests/README.md re: tests 2016-12-18 11:08:32 +01:00
troymc
dd01dd099f Moved tests docs from PYTHON_STYLE_GUIDE.md to tests/README.md 2016-12-18 11:01:15 +01:00
troymc
a005cca3b9 Initial edits to tests/README.md 2016-12-18 10:44:57 +01:00
Sylvain Bellemare
6b319cf3d6 Use yield statement instead of finalizer
to specify teardown code
2016-12-17 21:16:47 +01:00
Brett Sun
b4063dd9ad More test abstractions for multiple databases (#950)
* Remove unnecessary import of rethinkdb in a test

* Move test_run_query_util as a rethinkdb-specific test

* Move rethinkdb-specific command tests to own file

* Add __init__.py to new test folders

* Move command tests to their own test module

* Move fixtures out of command tests into separate conftest for commands

* Fix some small flake8 issues with rethinkdb's test_run_query_util

* Add pytest ignore hook to filter out test dirs that are not for the requested backend

* Move backend-specific tests in tests/db/ to tests/backend/
2016-12-16 22:17:13 +01:00
Sylvain Bellemare
c81e7a7479 Merge pull request #954 from sbellem/re-work-test-fixtures-iter-one
Re work test fixtures iter one
2016-12-16 20:59:27 +01:00
Sylvain Bellemare
dc5cfb43f8 Cleanup integration test 2016-12-16 18:43:21 +01:00
Sylvain Bellemare
e10ada0ad4 Cleanup conftest 2016-12-16 18:38:25 +01:00
Brett Sun
27ce18d6ba Remove unused request fixtures in root conftest 2016-12-16 17:58:48 +01:00
Brett Sun
d4ba1ff1c8 Update setup_database fixture to changes in #953 2016-12-16 17:58:48 +01:00
Rodolphe Marques
e704b19454 Merge pull request #942 from bigchaindb/docker-mongo
mongodb integration
2016-12-16 13:54:32 +01:00
Scott Sadler
d2827dfae8 remove asset keywords 2016-12-16 13:50:23 +01:00
Rodolphe Marques
ab56d87bcb codecov ignores mongodb folder for now 2016-12-16 13:36:59 +01:00
troymc
71e52ccf3e Fixed HTTP API docs re/ API Endpoint 2016-12-16 13:36:13 +01:00
Rodolphe Marques
72ca5e9dde fixed some pep8 issues 2016-12-16 13:06:16 +01:00
Rodolphe Marques
c1a5d5e86f Merge remote-tracking branch 'origin/master' into docker-mongo 2016-12-16 12:54:42 +01:00
ryan
dcba5421f1 schema fixes 2016-12-16 12:19:10 +01:00
ryan
243c739d2b config changes 2016-12-16 12:18:41 +01:00
ryan
33480bead2 remove rethinkdb calls 2016-12-16 12:16:00 +01:00
Troy McConaghy
9ed5853634 Minor wording change in example_deploy_conf.py 2016-12-16 10:37:05 +01:00
Troy McConaghy
57ce717fa8 Merge pull request #957 from bigchaindb/update-azure-quickstart-template-docs
Updated Azure Quickstart Template docs
2016-12-15 19:04:16 +01:00
troymc
3b7464b498 Updated Azure Quickstart Template docs 2016-12-15 18:52:00 +01:00
Sylvain Bellemare
3922b2d4fa Fix unspents endpoint 2016-12-15 17:17:18 +01:00
tim
09cbba8886 Notes, TODOs and formating 2016-12-15 17:17:18 +01:00
tim
8e8bc90742 Add unspents endpoint 2016-12-15 17:17:18 +01:00
tim
f78c90ada8 Add to_uri for TransactionLink 2016-12-15 17:17:18 +01:00
Sylvain Bellemare
56feefe3f4 Re-work test fixtures - iteration one 2016-12-15 15:54:15 +01:00
Sylvain Bellemare
65dab4f2eb Group std lib imports together (pep 8) 2016-12-15 15:51:09 +01:00
Ryan Henderson
d8256d50f2 remove rethinkdb calls (#953)
* remove rethinkdb calls from db/conftest.py
2016-12-15 14:16:30 +01:00
Rodolphe Marques
588d6eb177 Merge pull request #939 from bigchaindb/feat/905/abstract-db-changefeed
Feat/905/abstract db changefeed
2016-12-14 15:09:46 +01:00
Rodolphe Marques
3cfe8cb160 fixed typo 2016-12-14 13:28:37 +01:00
Rodolphe Marques
14a2c13a06 Removed get_old_transactions
Fixed tests.
2016-12-14 13:12:47 +01:00
Rodolphe Marques
976a3e8254 Merge remote-tracking branch 'origin/master' into feat/905/abstract-db-changefeed 2016-12-14 12:43:47 +01:00
Ryan Henderson
f725279a51 remove old tx recovery on block process start (#903) 2016-12-14 12:33:47 +01:00
libscott
dcede16aae Merge pull request #944 from bigchaindb/docs-warnings-as-errors
Treat warnings as errors in documentation builds
2016-12-13 16:59:52 +01:00
Rodolphe Marques
530681c905 Re-added the get_changefeed methos in the pipelines.
Fixed tests.
Fixed typos.
2016-12-13 15:11:25 +01:00
Scott Sadler
ec31fdeb30 treat warnings as errors in documentation builds 2016-12-13 14:55:46 +01:00
libscott
01c8eb389e Merge pull request #943 from bigchaindb/fix/package_data-yaml
include all .yaml files in package_data
2016-12-13 14:34:59 +01:00
Scott Sadler
731341a43e include all .yaml files in package_data 2016-12-13 14:28:00 +01:00
Brett Sun
0c831e6171 Upgrade python-rapidjson to 0.0.8 (#922) 2016-12-13 14:21:33 +01:00
Troy McConaghy
f75e9e9c0d Merge pull request #929 from bigchaindb/update-cryptography-page-in-docs
Updated the Cryptography page in the docs
2016-12-13 14:18:56 +01:00
troymc
0e100e405c There's no standard for Base58 encoding. 2016-12-13 14:10:18 +01:00
Sylvain Bellemare
7f143dbf57 Add watchdog lib to dev requirements 2016-12-13 13:31:00 +01:00
Rodolphe Marques
d246a1498f Added some tests for changefeed generics
pepify import
googlify docstring
2016-12-13 12:46:52 +01:00
Sylvain Bellemare
5d0c7fabf9 Add a bit of logging 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
b87baaaa1d Test backend.schema.init_database 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
a902f895fa Update function names to match the generic ones 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
bd886553d4 Add missing blank line 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
14d5564349 Fix some problem with class attribute and property 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
1f996c1746 Import ConnectionFailure exception 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
d3d42747b7 Add mongodb backend 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
11d0f4bff5 Import modules of registered (dispatch) functions 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
9bff8b40b5 Add mongodb container service for dev/tests 2016-12-13 11:59:57 +01:00
ryan
f9285fdb29 add schema 2016-12-13 11:59:57 +01:00
ryan
f3cc167edb refactor 2016-12-13 11:59:57 +01:00
ryan
ca94574150 more queries 2016-12-13 11:59:57 +01:00
ryan
2152c245ff more mongocalls 2016-12-13 11:59:57 +01:00
ryan
4877f5b03a more mongocalls 2016-12-13 11:59:57 +01:00
ryan
eb18d576e9 more mongocalls 2016-12-13 11:59:57 +01:00
ryan
aa08227740 add some mongodb setup 2016-12-13 11:59:57 +01:00
Sylvain Bellemare
dc5fd211c3 Mount Makefile in container 2016-12-13 11:52:56 +01:00
Sylvain Bellemare
d8db71c72e Add Makefile for clean up tasks, etc 2016-12-13 11:52:56 +01:00
Sylvain Bellemare
caeea09d33 Put std lib import at the top 2016-12-13 11:50:04 +01:00
Rodolphe Marques
8c46e40761 fixed documentation 2016-12-13 11:40:20 +01:00
Rodolphe Marques
007b574eb8 fixed missing import 2016-12-13 11:27:29 +01:00
Rodolphe Marques
e303e355db Delete outdated pipelines/utils.py
Reorganized and fixed tests.
2016-12-13 11:17:24 +01:00
Rodolphe Marques
134f9e85a0 Updated vote pipeline to use the changefeed abstraction
Fixed tests.
2016-12-13 11:16:37 +01:00
Rodolphe Marques
f09285d32f Fixed some code typos
Changed election pipeline to use the new changefeed abstraction
2016-12-13 11:16:29 +01:00
Rodolphe Marques
8266dfadb0 Fixed typos
Fixed failing test
2016-12-13 11:15:49 +01:00
Rodolphe Marques
dbf53c80e7 Removed rethinkdb dependencies in pipelines.block 2016-12-13 11:15:26 +01:00
Rodolphe Marques
341f43267a Initial implementation of the changefeed abstraction 2016-12-13 11:14:25 +01:00
Sylvain Bellemare
9f57d57f24 Test rethinkdb and mongodb in separate travis jobs 2016-12-13 10:25:47 +01:00
Sylvain Bellemare
b6293702ce Add todo note about not installing db drivers 2016-12-13 10:22:52 +01:00
Sylvain Bellemare
2486fb3d39 Add pymongo in install requirements 2016-12-13 10:22:52 +01:00
Sylvain Bellemare
2f4ee4d8b9 Set default of database-backend to env var if set 2016-12-13 10:22:39 +01:00
Sylvain Bellemare
b2c6474d35 Parametrize backend config 2016-12-13 10:22:39 +01:00
Troy McConaghy
4493c17476 Merge pull request #930 from bigchaindb/fix-links-in-docs
Fixed broken & redirecting links in the docs
2016-12-12 18:41:47 +01:00
Brett Sun
d7d223801d Add configuration documentation for new database.backend setting (#934) 2016-12-12 18:31:34 +01:00
Sylvain Bellemare
8a68e24e69 Abstract db layer cherrypick docs (#932)
* Add README.md to tests/ to describe test structure and pytest customizations

* Add package-level docstrings to backends

* Add README.md explaining the backend architecture

* Small improvements to docstrings in backend modules

* Restructure the backend automodule docs

* Add more docstrings to backend connections

* Add init to base backend Connection class to document expected interface

* Reword the backend/README.md docs
2016-12-12 18:28:43 +01:00
Sylvain Bellemare
4c3d5f0e2b Merge pull request #788 from bigchaindb/abstract-db-layer
Abstract database interface
2016-12-12 17:45:19 +01:00
Sylvain Bellemare
24a701096d Filter out block id 2016-12-12 17:38:41 +01:00
Sylvain Bellemare
ff583c5546 Test generic backend functions 2016-12-12 17:38:28 +01:00
Brett Sun
5f9c0f7b1b Fix docstring rst errors in the backend modules 2016-12-12 16:07:41 +01:00
Scott Sadler
448ee87944 flatten transaction - code changes 2016-12-12 16:07:41 +01:00
Scott Sadler
32c8b65f08 Remove metadata uuid 2016-12-12 16:07:41 +01:00
Brett Sun
345fc27a39 Remove durability from all database-related calls 2016-12-12 16:07:41 +01:00
Sylvain Bellemare
b9cfc5d9a2 Sync up with master 2016-12-12 15:53:56 +01:00
Sylvain Bellemare
49fca5cf3f Fix tests 2016-12-12 15:53:56 +01:00
vrde
2a820b46f3 Add connection Class 2016-12-12 15:53:56 +01:00
vrde
95b353459d Add pytest option to switch backend in tests 2016-12-12 15:53:56 +01:00
vrde
0a14f97a18 Add option to switch backend 2016-12-12 15:53:56 +01:00
vrde
6814b06c7b Add db connection info to logging 2016-12-12 15:53:56 +01:00
vrde
a634aea5a7 Add logging statement 2016-12-12 15:53:56 +01:00
vrde
3c3c1ce880 Improve tests for class initialization 2016-12-12 15:53:56 +01:00
Brett Sun
d6703e10f3 Remove unnecessary 'backend' setting from test's configuration as it's provided now by a pytest option 2016-12-12 15:53:56 +01:00
Brett Sun
b51a59e503 Use as the argument name for for clarity 2016-12-12 15:53:56 +01:00
Brett Sun
ad65e86131 Rename to in schema function arguments to for consistency 2016-12-12 15:53:56 +01:00
Brett Sun
3555b7ef94 Add argument to allow an existing connection to be reused when initializing the database 2016-12-12 15:53:56 +01:00
Brett Sun
af243907dd Fix wrong argument order for python 3.4 2016-12-12 15:53:56 +01:00
Brett Sun
ae52e015ce Fix changefeed tests that were mocking the wrong thing 2016-12-12 15:53:56 +01:00
Brett Sun
27eaae01a7 Fix base connection's run query interface 2016-12-12 15:53:56 +01:00
Brett Sun
8ffdd6a2ce Fix rethinkdb schema index test 2016-12-12 15:53:56 +01:00
Brett Sun
9a7e695e18 Fix tests still relying on being able to access removed attribute of the Bigchain class 2016-12-12 15:48:48 +01:00
Brett Sun
ccd8e74868 Fix initialization-related tests for rethinkdb schema 2016-12-12 15:48:48 +01:00
Brett Sun
32b6c50d63 Fix usage of backend functions that weren't getting a connection passed in 2016-12-12 15:48:48 +01:00
Brett Sun
8caeed54bf Fix backend module dispatch error tests broken from renaming 2016-12-12 15:48:48 +01:00
Brett Sun
2657226573 Fix Bigchain class tests due to changes to internal attributes 2016-12-12 15:48:48 +01:00
Brett Sun
597cd778e9 Fix interactive drop database commands 2016-12-12 15:48:48 +01:00
Brett Sun
dc31f7f607 Fix small module issues related to rethinkdb schema tests 2016-12-12 15:48:48 +01:00
Brett Sun
108b5cba30 Fix tests broken by adding a 'backend' key to the config 2016-12-12 15:48:48 +01:00
Brett Sun
da71b3d84b Fix backend module dispatch decorator tests broken from renaming 2016-12-12 15:48:48 +01:00
Brett Sun
941b47d1ac Fix misc tests affected by changes related to database abstraction 2016-12-12 15:48:48 +01:00
Brett Sun
9e3bca7e85 Fix schema-related database tests 2016-12-12 15:48:48 +01:00
Brett Sun
9ca7f9f270 Move tests/db/test_utils.py to rethinkdb-only schema test 2016-12-12 15:48:48 +01:00
Brett Sun
fc533bb158 Fix tests for bigchaindb commands 2016-12-12 15:48:48 +01:00
Brett Sun
9946147f77 Fix bigchaindb/commands for new connection and database interfaces 2016-12-12 15:48:48 +01:00
Brett Sun
c6acd8e1f5 Add generic init_database() function to set up database schema 2016-12-12 15:48:48 +01:00
Brett Sun
4343a9297c Add docstrings for database schema interface 2016-12-12 15:48:48 +01:00
Brett Sun
c5d55783fa Move docstrings out of rethinkdb/query.py implementation into interface 2016-12-12 15:48:48 +01:00
Brett Sun
c9766b5e92 Generalize naming of module dispatch decorator factory 2016-12-12 15:48:48 +01:00
Brett Sun
eda1c1bf55 Rename backend implementation decorators to be aligned with their action of registering functions 2016-12-12 15:48:48 +01:00
Brett Sun
6e14a63291 Add backlog and votes secondary indexes to rethinkdb's create_index() 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
9c102aa140 Add todos 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
d43e77ce4a Add docs for backend 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
67af0deaae Remove unused exception variable 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
261fe8ebf6 Remove superfluous else 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
be8f3dc69d Remove superfluous parentheses 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
cd8d038a83 End sentence with period :) 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
2be623221f Add line between std lib & 3rd party imports 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
b8bc1a5af9 Rename test module to plural form --> utils 2016-12-12 15:48:48 +01:00
Sylvain Bellemare
8c1dbc86a0 Import std libs at the top
the rationale behind importing under a test function is to import what
is being tested, and perhasp likely to fail, to isolate possible errors
resulting from the import itself

see
http://docs.pylonsproject.org/en/latest/community/testing.html#rule-never-import-the-module-under-test-at-test-module-scope for more
2016-12-12 15:48:48 +01:00
Sylvain Bellemare
f341bd1586 Rename backend.util to backend.utils 2016-12-12 15:48:48 +01:00
Brett Sun
d4da573389 Sync query interface with rethinkdb implementation based on latest changes 2016-12-12 15:48:48 +01:00
Brett Sun
75ef0f2fda Import the backend interfaces on module import 2016-12-12 15:48:48 +01:00
Brett Sun
ab18203b7c Register rethinkdb backend implementation to backend interface dispatchers 2016-12-12 15:48:48 +01:00
Brett Sun
daa0fe1f51 Add utility decorator for registering backend dispatches based on modules 2016-12-12 15:48:48 +01:00
Brett Sun
2eb83b9993 Remove unnecessary export of base Connection from backend/ 2016-12-12 15:48:48 +01:00
Brett Sun
dabb81ac98 Replace cherrypicked class-based architecture with singledispatch 2016-12-12 15:48:48 +01:00
Brett Sun
1d0a7d2153 Remove remnants of db/ folder 2016-12-12 15:48:48 +01:00
vrde
a08ba013a0 Remove dependency from bigchaindb.config 2016-12-12 15:47:43 +01:00
vrde
87c7228bc4 Add docstring, fix name 2016-12-12 15:47:43 +01:00
vrde
26c844ec22 Add defaults, fix import 2016-12-12 15:47:43 +01:00
vrde
2fd0aeca9f Add error handling 2016-12-12 15:47:43 +01:00
Brett Sun
c9a3d01112 Move db/ files into backend/ 2016-12-12 15:47:43 +01:00
vrde
24e374b860 Cherrypick from class based architecture 2016-12-12 15:47:43 +01:00
vrde
4549e2ee4a Update BigchainDB core class 2016-12-12 15:47:43 +01:00
vrde
53fb9f3d5f Add connection Class 2016-12-12 15:47:43 +01:00
vrde
9615ac22ae Create new modules layout 2016-12-12 15:47:43 +01:00
libscott
ca4fc88651 Merge pull request #865 from bigchaindb/vote-schema
Vote schema
2016-12-12 15:22:18 +01:00
Scott Sadler
98ca6ee5ab always try to include all operands on the first level of the statement 2016-12-12 15:15:38 +01:00
Scott Sadler
a635838c58 few style changes for vote-schema.py 2016-12-12 15:15:38 +01:00
Scott Sadler
4f83fce39d address some PR comments on coding style 2016-12-12 15:15:38 +01:00
Scott Sadler
ea6ae4db20 revert data-models/vote-model documentation 2016-12-12 15:15:38 +01:00
libscott
d9bc90e5aa Imports inside tests in test_consensus.py 2016-12-12 15:15:38 +01:00
Scott Sadler
94df6fc00a merge test_schema tests and tweak Data Models documentation index 2016-12-12 15:15:38 +01:00
Scott Sadler
624a0c972a remove misplaced docs/generate 2016-12-12 15:15:38 +01:00
Scott Sadler
7cb6c8913b unversion vote.rst since it's JITted now 2016-12-12 15:15:38 +01:00
Scott Sadler
a690fbee53 documentation fix for vote schema 2016-12-12 15:15:38 +01:00
Scott Sadler
6208a93673 fix linting issue 2016-12-12 15:15:38 +01:00
Scott Sadler
d7e0009ce5 Drop definitions from schemas since they clutter log output 2016-12-12 15:15:38 +01:00
Scott Sadler
e861353a73 documentation fixes for vote schema and remove vote-model.md in place of vote schema doc, and link to vote schema doc from data-models index 2016-12-12 15:15:38 +01:00
Scott Sadler
0f824b071f fix unclear code in drop_schema_descriptions and remove leftover print() 2016-12-12 15:15:38 +01:00
Scott Sadler
7453e57e7b remove descriptions from yaml schemas loaded for validating in order to reduce noise in error descriptions 2016-12-12 15:15:38 +01:00
Scott Sadler
f2e6e4d13d add tests to get coverage of consensus.py 2016-12-12 15:15:38 +01:00
Scott Sadler
f38028d727 basic tests for vote schema validator 2016-12-12 15:15:38 +01:00
Scott Sadler
bfb5be3ba4 refactor schema tests into separate modules 2016-12-12 15:15:38 +01:00
Scott Sadler
44a43dcf94 make all tests pass after vote schema introduction 2016-12-12 15:15:38 +01:00
Scott Sadler
ef5f3ddd28 better logging and arrangement for vote verification 2016-12-12 15:15:38 +01:00
Scott Sadler
c43bf10151 add call to vote schema validate in consensus.py 2016-12-12 15:15:38 +01:00
Scott Sadler
855dc7a5e8 refactor schema __init__ slightly 2016-12-12 15:15:38 +01:00
Scott Sadler
ecbeaa0b25 vote.id doesn't exist in server 2016-12-12 15:15:38 +01:00
Scott Sadler
b227739d89 render schema/vote.rst 2016-12-12 15:15:38 +01:00
Scott Sadler
31be5b3c8a generalize generate_schema_documentation.py 2016-12-12 15:15:38 +01:00
Scott Sadler
0d8a53cb68 vote schema 2016-12-12 15:15:38 +01:00
troymc
8c5947a1b2 Upgraded link to Red Hat blog post to HTTPS 2016-12-11 16:35:01 +01:00
troymc
3a64f43016 Upgraded link to RethinkDB installation page to HTTPS 2016-12-11 16:32:02 +01:00
troymc
bdb6c62833 Fixed a broken link to the Data Models section 2016-12-11 16:29:44 +01:00
troymc
16390efaaf Improved the link to the PDF about setting up on Cloud9 2016-12-11 16:27:29 +01:00
troymc
10a697fa60 Fixed broken link to The Transaction Model 2016-12-11 16:23:39 +01:00
troymc
95691579ac Updated some links in the page about setting up a dev machine 2016-12-11 16:12:25 +01:00
troymc
606dfbb1d9 Updated link to InfluxDB home page 2016-12-11 13:08:16 +01:00
troymc
fb07aeb20d Updated link to fabtools on GitHub 2016-12-11 13:05:00 +01:00
troymc
bf231df6ce Updated link to Docker docs about mounting a host dir as a data volume 2016-12-11 13:02:48 +01:00
troymc
084ad2c7c1 Fixed redirecting link to Red Hat blog 2016-12-11 12:56:31 +01:00
troymc
c2a5d325cf Updated the Cryptography page in the docs 2016-12-11 12:41:44 +01:00
troymc
24fa339a2e Fixed redirecting link to Amazon EC2 Console 2016-12-11 11:11:54 +01:00
Troy McConaghy
efbc1e1b9a Merge pull request #928 from bigchaindb/remove-docs-on-old-azure-template
Removed old Azure Quickstart Template docs, edited new ones
2016-12-10 16:44:34 +01:00
troymc
2684fd5da5 Removed old Azure quickstart template docs, edited new ones 2016-12-10 16:29:42 +01:00
libscott
6166a96410 Merge pull request #881 from bigchaindb/remove-cid-fid
Remove Condition.cid and Fulfillment.fid
2016-12-09 14:37:13 +01:00
Scott Sadler
53c2aebfab Merge remote-tracking branch 'origin/master' into remove-cid-fid 2016-12-09 14:28:38 +01:00
libscott
38ea8c3cf7 Merge pull request #924 from bigchaindb/fix-sphinx-warning-on-server-docs
Changed docs subsection title so no more Sphinx warning
2016-12-09 14:22:10 +01:00
troymc
6db782453f Changed docs subsection title so no more Sphinx warning 2016-12-09 14:16:06 +01:00
Troy McConaghy
e825a03160 Merge pull request #847 from bigchaindb/docs-on-new-azure-template
Docs on the new ARM template for deploying on Azure
2016-12-09 11:44:45 +01:00
Scott Sadler
fc88c36ee5 Merge remote-tracking branch 'origin/master' into remove-cid-fid 2016-12-09 10:42:32 +01:00
Brett Sun
86019d51eb Add tox usage to testing docs (#915)
* Use section header for CI testing in style guide document
* Add tox section to style guide document
* Reword style guide's testing section to be more general after introduction of integration tests
2016-12-08 17:10:48 +01:00
Sylvain Bellemare
6f90c8f3df Add tests for HTTP API returned errors 2016-12-08 16:50:56 +01:00
Sylvain Bellemare
209dba76a3 Add some messages when raising exceptions 2016-12-08 16:50:56 +01:00
Sylvain Bellemare
d998b00592 Return information about the exception 2016-12-08 16:50:56 +01:00
Sylvain Bellemare
cc9e3b79b6 Remove outdated comment 2016-12-08 16:50:35 +01:00
Krish
07b3f9ca4e Merge pull request #908 from krish7919/bug/781/performance-memory-usage
Fix 781 and 124
2016-12-08 13:51:05 +01:00
Sylvain Bellemare
bf0b2a32f0 Set root docs html_static_path to empty list 2016-12-08 11:45:41 +01:00
Sylvain Bellemare
793883196b Adjust container server docs building commmand 2016-12-08 11:45:41 +01:00
Sylvain Bellemare
3bdaf60acb Fix docs building warnings 2016-12-08 11:45:41 +01:00
Sylvain Bellemare
20f629256b Mount tox.ini in dev container 2016-12-08 11:45:41 +01:00
Sylvain Bellemare
abd4a54a76 Add python3.4 and vim for dev & testing 2016-12-08 11:45:41 +01:00
Sylvain Bellemare
aa436ced6e Fix #786 2016-12-08 11:45:41 +01:00
Ryan Henderson
1223695b36 add integration tests (#614) 2016-12-08 11:42:46 +01:00
Krish
85bb4a9233 Fix 781 and 124
The queue/pipeline used in the block creation process is unbounded.
When too many transactions occur, the backlog table fills up quite easily and
bigchaindb just reads all the transaction in the backlog to create a block.
This causes memory usage to grow indefinitely.

Limiting the queue size to 1000 transactions for now as the block creation and
voting happens in batches of 1000. Can be increased later in case block size
is increased.
2016-12-08 08:54:21 +00:00
Troy McConaghy
bd6b9da080 Merge pull request #821 from bigchaindb/issue/780/remove-api-endpoint-setting
Removed the "api_endpoint" setting from everywhere (in this repo)
2016-12-06 17:33:14 +01:00
libscott
0e94a66302 Merge pull request #902 from bigchaindb/fix/transaction-model-flat-metadata
Fix metadata description in transaction-model.rst
2016-12-06 17:20:06 +01:00
Scott Sadler
bdc706d633 fix metadata description in transaction-model.rst 2016-12-06 16:58:06 +01:00
Sylvain Bellemare
7940479ee3 Make the autodoc members option the default 2016-12-06 10:23:49 +01:00
Troy McConaghy
44d1bb2c97 Fixed minor error in changelog for 0.8.0
v0.8.0 doesn't actually do transaction schema validation. That got merged shortly _after_ the v0.8.0 release, in PR #880
2016-12-02 15:47:19 +01:00
libscott
8afb15bccf Merge pull request #892 from bigchaindb/fix/sign-http-server-api-examples
Sign the tx in http-client-server-api.html
2016-12-02 15:12:53 +01:00
Sylvain Bellemare
9dacc12b3c Handle transaction schema validation errors
in POST /transactions
2016-12-02 14:32:18 +01:00
Sylvain Bellemare
602dfbea06 Add transaction schema validation to the server
by overriding Transaction.from_dict() in models.py
2016-12-02 14:32:18 +01:00
Sylvain Bellemare
96143f7e60 Use explicit chaining to capture the cause 2016-12-02 14:32:18 +01:00
Scott Sadler
4ce7f4e95d sign the tx in http-client-server-api.html, server would reject otherwise 2016-12-02 13:47:36 +01:00
Scott Sadler
b2f2ce3523 hotfix release process since old step left in by mistake 2016-12-01 16:27:00 +01:00
troymc
adde84970f Fixed merge conflict in bigchaindb/__init__.py 2016-12-01 16:09:34 +01:00
libscott
97ff0efd8b Merge pull request #855 from bigchaindb/flat-transaction
Flat transaction
2016-12-01 15:03:43 +01:00
Scott Sadler
8f513fc81d put back a pluck() that was removed by accident 2016-12-01 14:49:05 +01:00
Scott Sadler
e699536a64 Fix transaction description in transaction.yaml 2016-12-01 14:37:55 +01:00
Scott Sadler
21af588f7c docs update for flat transaction 2016-12-01 14:37:41 +01:00
Scott Sadler
8d4677f456 flatten transaction - code changes 2016-12-01 14:31:31 +01:00
libscott
e4026db85f Merge pull request #891 from bigchaindb/generate-http-docs-examples
Auto generate examples in http server API docs
2016-12-01 10:23:37 +01:00
Scott Sadler
f4164a6970 nomenclature fix in generate_http_server_api_documentation.py 2016-12-01 10:17:58 +01:00
Scott Sadler
ec38d06856 add test to make sure documentation can build 2016-11-30 16:41:24 +01:00
Scott Sadler
49726c4a31 make html runs generation scripts for documentation, generates http server examples 2016-11-30 16:28:58 +01:00
libscott
a30c79f3d5 Merge pull request #856 from bigchaindb/remove-metadata-uuid
Remove metadata uuid
2016-11-30 06:20:32 +01:00
Troy McConaghy
d6c93a3c9e Merge pull request #889 from bigchaindb/bump-version-to-0.9.0.dev
Bump version to 0.9.0.dev
2016-11-29 16:48:11 +01:00
Troy McConaghy
76ce436e03 Bump version to 0.9.0.dev 2016-11-29 16:44:11 +01:00
Scott Sadler
18d018519f remove Condition.cid and Fulfillment.fid in favour of dereferencing conditions and fulfillments by their location in their respective arrays 2016-11-29 09:59:43 +01:00
Scott Sadler
a6eb52d76d disallow empty metadata dict in favour of null 2016-11-28 17:34:46 +01:00
Scott Sadler
71dcee019f Remove metadata uuid 2016-11-28 17:34:46 +01:00
troymc
17322b1e3a Addressed all comments by @sohkai in new Azure template page 2016-11-22 13:59:17 +01:00
troymc
03406d2760 docs: azure template -> old & new azure templates 2016-11-21 16:41:53 +01:00
troymc
29d783425d Remove or comment-out the api_endpoint setting everywhere 2016-11-15 17:05:09 +01:00
troymc
5bf213d873 Removed api_endpoint from HTTP API docs & wrote how API Root URL is truly determined 2016-11-15 16:20:18 +01:00
578 changed files with 37815 additions and 16318 deletions

14
.ci/entrypoint.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
set -e -x
if [[ ${BIGCHAINDB_CI_ABCI} == 'enable' ]]; then
sleep 3600
else
bigchaindb -l DEBUG start
fi

12
.ci/travis-after-success.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
set -e -x
if [[ -z ${TOXENV} ]] && [[ ${BIGCHAINDB_CI_ABCI} != 'enable' ]] && [[ ${BIGCHAINDB_ACCEPTANCE_TEST} != 'enable' ]]; then
codecov -v -f htmlcov/coverage.xml
fi

16
.ci/travis-before-install.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
if [[ -z ${TOXENV} ]]; then
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
sudo rm /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
fi

18
.ci/travis-before-script.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
set -e -x
if [[ -z ${TOXENV} ]]; then
if [[ ${BIGCHAINDB_CI_ABCI} == 'enable' ]]; then
docker-compose up -d bigchaindb
else
docker-compose up -d bdb
fi
fi

21
.ci/travis-install.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
set -e -x
pip install --upgrade pip
if [[ -n ${TOXENV} ]]; then
pip install --upgrade tox
elif [[ ${BIGCHAINDB_CI_ABCI} == 'enable' ]]; then
docker-compose build --no-cache --build-arg abci_status=enable bigchaindb
elif [[ $BIGCHAINDB_INTEGRATION_TEST == 'enable' ]]; then
docker-compose build bigchaindb python-driver
else
docker-compose build --no-cache bigchaindb
pip install --upgrade codecov
fi

18
.ci/travis_script.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
set -e -x
if [[ -n ${TOXENV} ]]; then
tox -e ${TOXENV}
elif [[ ${BIGCHAINDB_CI_ABCI} == 'enable' ]]; then
docker-compose exec bigchaindb pytest -v -m abci
elif [[ ${BIGCHAINDB_ACCEPTANCE_TEST} == 'enable' ]]; then
./run-acceptance-test.sh
else
docker-compose exec bigchaindb pytest -v --cov=bigchaindb --cov-report xml:htmlcov/coverage.xml
fi

10
.gitattributes vendored
View File

@ -1,10 +0,0 @@
benchmarking-tests export-ignore
deploy-cluster-aws export-ignore
docs export-ignore export-ignore
speed-tests export-ignore
tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
*.md export-ignore
codecov.yml export-ignore

14
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,14 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# How to Contribute to the BigchainDB Project
There are many ways you can contribute to the BigchainDB project, some very easy and others more involved.
All of that is documented elsewhere: go to the "[Contributing to BigchainDB" docs on ReadTheDocs](https://docs.bigchaindb.com/projects/contributing/en/latest/index.html).
Note: GitHub automatically links to this file (`.github/CONTRIBUTING.md`) when a contributor creates a new issue or pull request, so you shouldn't delete it. Just use it to point people to full and proper help elsewhere.

20
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,20 @@
# Do you want to:
- make a bug report? Then read below about what should go in a bug report.
- make a feature request or proposal? Then read [the page about how to make a feature request or proposal](https://docs.bigchaindb.com/projects/contributing/en/latest/ways-can-contribute/make-a-feature-request-or-proposal.html).
- ask a question about BigchainDB? Then [go to Gitter](https://gitter.im/bigchaindb/bigchaindb) (our chat room) and ask it there.
- share your neat idea or realization? Then [go to Gitter](https://gitter.im/bigchaindb/bigchaindb) (our chat room) and share it there.
# What Should Go in a Bug Report
- What computer are you on (hardware)?
- What operating system are you using, including version. e.g. Ubuntu 14.04? Fedora 23?
- What version of BigchainDB software were you using? Is that the latest version?
- What, exactly, did you do to get to the point where you got stuck? Describe all the steps so we can get there too. Show screenshots or copy-and-paste text to GitHub.
- Show what actually happened.
- Say what you tried to do to resolve the problem.
- Provide details to convince us that it matters to you. Is it for a school project, a job, a contract with a deadline, a child who needs it for Christmas?
We will do our best but please understand that we don't have time to help everyone, especially people who don't care to help us help them. "It doesn't work." is not going to get any reaction from us. We need _details_.
Tip: Use Github code block formatting to make code render pretty in GitHub. To do that, put three backticks followed by a string to set the type of code (e.g. `Python`), then the code, and then end with three backticks. There's more information about [inserting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) in the GitHub help pages.

30
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
**Expected behavior**
A clear and concise description of what you expected to happen.
**Logs or terminal output**
If applicable, add add textual content to help explain your problem.
**Desktop (please complete the following information):**
- Distribution: [e.g. Ubuntu 18.04]
- Bigchaindb version:
- Tendermint version:
- Mongodb version:
- Python full version: [e.g. Python 3.6.6]
**Additional context**
Add any other context about the problem here.

18
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,18 @@
Make sure the title of this pull request has the form:
**Problem: A short statement of the problem.**
## Solution
A short statement about how this PR solves the **Problem**.
## Issues Resolved
What issues does this PR resolve, if any? Please include lines like the following (i.e. "Resolves #NNNN), so that when this PR gets merged, GitHub will automatically close those issues.
Resolves #NNNN
Resolves #MMMM
## BEPs Implemented
What [BEPs](https://github.com/bigchaindb/beps) does this pull request implement, if any?

42
.gitignore vendored
View File

@ -6,6 +6,21 @@ __pycache__/
# C extensions
*.so
# Swap -- copypasta from https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# Session
Session.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Distribution / packaging
.Python
env/
@ -40,6 +55,7 @@ htmlcov/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
@ -65,15 +81,19 @@ target/
# pyenv
.python-version
# Some files created when deploying a cluster on AWS
deploy-cluster-aws/conf/rethinkdb.conf
deploy-cluster-aws/confiles/
deploy-cluster-aws/client_confile
deploy-cluster-aws/hostlist.py
deploy-cluster-aws/ssh_key.py
benchmarking-tests/hostlist.py
benchmarking-tests/ssh_key.py
# Just in time documentation
docs/server/source/http-samples
# Ansible-specific files
ntools/one-m/ansible/hosts
ntools/one-m/ansible/ansible.cfg
# Terraform state files
# See https://stackoverflow.com/a/41482391
terraform.tfstate
terraform.tfstate.backup
# tendermint data
tmdata/data
network/*/data
# Docs that are fetched at build time
docs/contributing/source/cross-project-policies/*.md
.DS_Store

25
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,25 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.1.1
hooks:
- id: trailing-whitespace
args: ['--no-markdown-linebreak-ext']
- id: check-merge-conflict
- id: debug-statements
- id: check-added-large-files
- id: flake8
- repo: git://github.com/chewse/pre-commit-mirrors-pydocstyle
sha: v2.1.1
hooks:
- id: pydocstyle
# list of error codes to check, see: http://www.pydocstyle.org/en/latest/error_codes.html
args: ['--select=D204,D201,D209,D210,D212,D300,D403']
# negate the exclude to only apply the hooks to 'bigchaindb' and 'tests' folder
exclude: '^(?!bigchaindb/)(?!tests/)(?!acceptance/)'

11
.readthedocs.yml Normal file
View File

@ -0,0 +1,11 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
build:
image: latest
python:
version: 3.6
pip_install: true

View File

@ -1,25 +1,77 @@
# Copyright © 2020, 2021 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
sudo: required
dist: focal
services:
- docker
language: python
cache: pip
python:
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
before_install:
- source /etc/lsb-release
- echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee -a /etc/apt/sources.list.d/rethinkdb.list
- wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
- sudo apt-get update -qq
env:
global:
- DOCKER_COMPOSE_VERSION=1.29.2
matrix:
- TOXENV=flake8
- TOXENV=docsroot
install:
- sudo apt-get install rethinkdb
- pip install -e .[test]
- pip install codecov
matrix:
fast_finish: true
include:
- python: 3.6
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- python: 3.6
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- BIGCHAINDB_CI_ABCI=enable
- python: 3.6
env:
- BIGCHAINDB_ACCEPTANCE_TEST=enable
- python: 3.7
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- python: 3.7
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- BIGCHAINDB_CI_ABCI=enable
- python: 3.7
env:
- BIGCHAINDB_ACCEPTANCE_TEST=enable
- python: 3.8
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- python: 3.8
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- BIGCHAINDB_CI_ABCI=enable
- python: 3.8
env:
- BIGCHAINDB_ACCEPTANCE_TEST=enable
before_script:
- flake8 --max-line-length 119 bigchaindb/
- rethinkdb --daemon
script: py.test -n auto -s -v --cov=bigchaindb
before_install: sudo .ci/travis-before-install.sh
after_success: codecov
install: .ci/travis-install.sh
before_script: .ci/travis-before-script.sh
script: .ci/travis_script.sh
after_success: .ci/travis-after-success.sh

View File

@ -1,9 +1,18 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Change Log (Release Notes)
All _notable_ changes to this project will be documented in this file (`CHANGELOG.md`).
This project adheres to [Semantic Versioning](http://semver.org/) (or at least we try).
Contributors to this file, please follow the guidelines on [keepachangelog.com](http://keepachangelog.com/).
Note that each version (or "release") is the name of a [Git _tag_](https://git-scm.com/book/en/v2/Git-Basics-Tagging) of a particular commit, so the associated date and time are the date and time of that commit (as reported by GitHub), _not_ the "Uploaded on" date listed on PyPI (which may differ).
This project adheres to [the Python form of Semantic Versioning](https://packaging.python.org/tutorials/distributing-packages/#choosing-a-versioning-scheme) (or at least we try). The BigchainDB public API _was_ defined in this file but that definition was moved and can now be found in [BEP-7](https://github.com/bigchaindb/BEPs/tree/master/7).
Contributors to this file, please follow the guidelines on [keepachangelog.com](http://keepachangelog.com/). Note that each version (or "release") is the name of a [Git _tag_](https://git-scm.com/book/en/v2/Git-Basics-Tagging) of a particular commit, so the associated date and time are the date and time of that commit (as reported by GitHub), _not_ the "Uploaded on" date listed on PyPI (which may differ).
For reference, the possible headings are:
* **Added** for new features.
@ -13,8 +22,676 @@ For reference, the possible headings are:
* **Fixed** for any bug fixes.
* **Security** to invite users to upgrade in case of vulnerabilities.
* **External Contributors** to list contributors outside of BigchainDB GmbH.
* **Known Issues**
* **Notes**
## [2.2.2] - 2020-08-12
### Security
Several dependencies updated including Flask that had vulnerability.
### Fixed
* Updated priv_validator key format in stack script (#2707)
### External Contributors
* @aostrun - [#2708](https://github.com/bigchaindb/bigchaindb/pull/2708)
## [2.2.1] - 2020-04-14
### Fixed
Gevent library API update is incompatible with bigchaindb-abci 1.0.1 version.
Updated bigchaindb-abci.
## [2.2.0] - 2020-02-20
### Added
Support for multiple ABCI versions.
## [2.1.0] - 2019-11-06
### Added
Option for last transaction retrieval added.
## [2.0] - 2019-09-26
### Changed
Migrated from Tendermint 0.22.8 to 0.31.5.
## [2.0 Beta 9] - 2018-11-27
### Changed
Removed support for TLSv1 and TLSv1.1 in all NGINX config files. Kept support for TLSv1.2 and added support for TLSv1.3. [Pull Request #2601](https://github.com/bigchaindb/bigchaindb/pull/2601)
### Fixed
Fixed two issues with schema validation. Pull requests [#2606](https://github.com/bigchaindb/bigchaindb/pull/2606) & [#2607](https://github.com/bigchaindb/bigchaindb/pull/2607)
### External Contributors
[@gamjapark](https://github.com/gamjapark) and team translated all the [BigchainDB root docs](https://docs.bigchaindb.com/en/latest/korean/index.html) into Korean. [Pull Request #2603](https://github.com/bigchaindb/bigchaindb/pull/2603)
## [2.0 Beta 8] - 2018-11-03
### Changed
* Revised the [Simple Deployment Template](http://docs.bigchaindb.com/projects/server/en/latest/simple-deployment-template/index.html) in the docs. Added NGINX to the mix. Pull Requests [#2578](https://github.com/bigchaindb/bigchaindb/pull/2578) and [#2579](https://github.com/bigchaindb/bigchaindb/pull/2579)
* Revised `nginx/nginx.conf` to enable CORS. [Pull Request #2580](https://github.com/bigchaindb/bigchaindb/pull/2580)
### Fixed
* Fixed a typo in the Kubernetes ConfigMap template. [Pull Request #2583](https://github.com/bigchaindb/bigchaindb/pull/2583)
### External Contributors
[@gamjapark](https://github.com/gamjapark) translated the main `README.md` file into Korean. [Pull Request #2592](https://github.com/bigchaindb/bigchaindb/pull/2592)
## [2.0 Beta 7] - 2018-09-28
Tag name: v2.0.0b7
### Added
Completed the implementation of chain-migration elections (BEP-42). Pull requests [#2553](https://github.com/bigchaindb/bigchaindb/pull/2553), [#2556](https://github.com/bigchaindb/bigchaindb/pull/2556), [#2558](https://github.com/bigchaindb/bigchaindb/pull/2558), [#2563](https://github.com/bigchaindb/bigchaindb/pull/2563) and [#2566](https://github.com/bigchaindb/bigchaindb/pull/2566)
### Changed
* Code that used the Python driver's (deprecated) transactions.send() method now uses its transactions.send_commit() method instead. [Pull request #2547](https://github.com/bigchaindb/bigchaindb/pull/2547)
* Code that implied pluggable "consensus" now implies pluggable transaction "validation" (a more accurate word). [Pull request #2561](https://github.com/bigchaindb/bigchaindb/pull/2561)
### Removed
Benchmark logs. [Pull request #2565](https://github.com/bigchaindb/bigchaindb/pull/2565)
### Fixed
A bug caused by an incorrect MongoDB query. [Pull request #2567](https://github.com/bigchaindb/bigchaindb/pull/2567)
### Notes
There's now better documentation about logs, log rotation, and the `server.bind` config setting. Pull requests [#2546](https://github.com/bigchaindb/bigchaindb/pull/2546) and [#2575](https://github.com/bigchaindb/bigchaindb/pull/2575)
## [2.0 Beta 6] - 2018-09-17
Tag name: v2.0.0b6
### Added
* [New documentation about privacy and handling private data](https://docs.bigchaindb.com/en/latest/private-data.html). [Pull request #2437](https://github.com/bigchaindb/bigchaindb/pull/2437)
* New documentation about log rotation. Also rotate Tendermint logs if started using Monit. [Pull request #2528](https://github.com/bigchaindb/bigchaindb/pull/2528)
* Began implementing one of the migration strategies outlined in [BEP-42](https://github.com/bigchaindb/BEPs/tree/master/42). That involved creating a more general-purpose election process and commands. Pull requests [#2488](https://github.com/bigchaindb/bigchaindb/pull/2488), [#2495](https://github.com/bigchaindb/bigchaindb/pull/2495), [#2498](https://github.com/bigchaindb/bigchaindb/pull/2498), [#2515](https://github.com/bigchaindb/bigchaindb/pull/2515), [#2535](https://github.com/bigchaindb/bigchaindb/pull/2535)
* Used memoization to avoid doing some validation checks multiple times. [Pull request #2490](https://github.com/bigchaindb/bigchaindb/pull/2490)
* Created an all-in-one Docker image containing BigchainDB Server, Tendermint and MongoDB. It was created for a particular user and is not recommended for production use unless you really know what you're doing. [Pull request #2424](https://github.com/bigchaindb/bigchaindb/pull/2424)
### Changed
* The supported versions of Tendermint are now hard-wired into BigchainDB Server: it checks to see what version the connected Tendermint has, and if it's not compatible, BigchainDB Server exits with an error message. [Pull request #2541](https://github.com/bigchaindb/bigchaindb/pull/2541)
* The docs no longer say to install the highest version of Tendermint: they say to install a specific version. [Pull request #2524](https://github.com/bigchaindb/bigchaindb/pull/2524)
* The setup docs include more recommended settings for `config.toml`. [Pull request #2516](https://github.com/bigchaindb/bigchaindb/pull/2516)
* The process to add, remove or update the voting power of a validator at run time (using the `bigchaindb upsert-validator` subcommands) was completely changed and is now fully working. See [issue #2372](https://github.com/bigchaindb/bigchaindb/issues/2372) and all the pull requests it references. Pull requests [#2439](https://github.com/bigchaindb/bigchaindb/pull/2439) and [#2440](https://github.com/bigchaindb/bigchaindb/pull/2440)
* The license on the documentation was changed from CC-BY-SA-4 to CC-BY-4. [Pull request #2427](https://github.com/bigchaindb/bigchaindb/pull/2427)
* Re-activated and/or updated some unit tests that had been deacivated during the migration to Tendermint. Pull requests [#2390](https://github.com/bigchaindb/bigchaindb/pull/2390), [#2415](https://github.com/bigchaindb/bigchaindb/pull/2415), [#2452](https://github.com/bigchaindb/bigchaindb/pull/24), [#2456](https://github.com/bigchaindb/bigchaindb/pull/2456)
* Updated RapidJSON to a newer, faster version. [Pull request #2470](https://github.com/bigchaindb/bigchaindb/pull/2470)
* The Java driver is now officially supported. [Pull request #2478](https://github.com/bigchaindb/bigchaindb/pull/2478)
* The MongoDB indexes on transaction id and block height were changed to be [unique indexes](https://docs.mongodb.com/manual/core/index-unique/). [Pull request #2492](https://github.com/bigchaindb/bigchaindb/pull/2492)
* Updated the required `cryptoconditions` package to a newer one. [Pull request #2494](https://github.com/bigchaindb/bigchaindb/pull/2494)
### Removed
* Removed some old code and tests. Pull requests
[#2374](https://github.com/bigchaindb/bigchaindb/pull/2374),
[#2452](https://github.com/bigchaindb/bigchaindb/pull/2452),
[#2474](https://github.com/bigchaindb/bigchaindb/pull/2474),
[#2476](https://github.com/bigchaindb/bigchaindb/pull/2476),
[#2491](https://github.com/bigchaindb/bigchaindb/pull/2491)
### Fixed
* Fixed the Events API so that it only sends valid transactions to subscribers. Also changed how it works internally, so now it is more reliable. [Pull request #2529](https://github.com/bigchaindb/bigchaindb/pull/2529)
* Fixed a bug where MongoDB database initialization would abort if a collection already existed. [Pull request #2520](https://github.com/bigchaindb/bigchaindb/pull/2520)
* Fixed a unit test that was failing randomly. [Pull request #2423](https://github.com/bigchaindb/bigchaindb/pull/2423)
* Fixed the validator curl port. [Pull request #2447](https://github.com/bigchaindb/bigchaindb/pull/2447)
* Fixed an error in the docs about the HTTP POST /transactions endpoint. [Pull request #2481](https://github.com/bigchaindb/bigchaindb/pull/2481)
* Fixed a unit test that could loop forever. [Pull requqest #2486](https://github.com/bigchaindb/bigchaindb/pull/2486)
* Fixed a bug when validating a CREATE + TRANSFER. [Pull request #2487](https://github.com/bigchaindb/bigchaindb/pull/2487)
* Fixed the HTTP response when posting a transaction in commit mode. [Pull request #2510](https://github.com/bigchaindb/bigchaindb/pull/2510)
* Fixed a crash that happened when attempting to restart BigchainDB at Tendermint block height 1. [Pull request#2519](https://github.com/bigchaindb/bigchaindb/pull/2519)
### External Contributors
@danacr - [Pull request #2447](https://github.com/bigchaindb/bigchaindb/pull/2447)
### Notes
The docs section titled "Production Deployment Template" was renamed to "Kubernetes Deployment Template" and we no longer consider it the go-to deployment template. The "Simple Deployment Template" is simpler, easier to understand, and less expensive (unless you are with an organization that already has a big Kubernetes cluster).
## [2.0 Beta 5] - 2018-08-01
Tag name: v2.0.0b5
### Changed
* Supported version of Tendermint `0.22.3` -> `0.22.8`. [Pull request #2429](https://github.com/bigchaindb/bigchaindb/pull/2429).
### Fixed
* Stateful validation raises a DoubleSpend exception if there is any other transaction that spends the same output(s) even if it has the same transaction ID. [Pull request #2422](https://github.com/bigchaindb/bigchaindb/pull/2422).
## [2.0 Beta 4] - 2018-07-30
Tag name: v2.0.0b4
### Added
- Added scripts for creating a configuration to manage processes with Monit. [Pull request #2410](https://github.com/bigchaindb/bigchaindb/pull/2410).
### Fixed
- Redundant asset and metadata queries were removed. [Pull request #2409](https://github.com/bigchaindb/bigchaindb/pull/2409).
- Signal handling was fixed for BigchainDB processes. [Pull request #2395](https://github.com/bigchaindb/bigchaindb/pull/2395).
- Some of the abruptly closed sockets that used to stay in memory are being cleaned up now. [Pull request 2408](https://github.com/bigchaindb/bigchaindb/pull/2408).
- Fixed the bug when WebSockets powering Events API became unresponsive. [Pull request #2413](https://github.com/bigchaindb/bigchaindb/pull/2413).
### Notes:
* The instructions on how to write a BEP were simplified. [Pull request #2347](https://github.com/bigchaindb/bigchaindb/pull/2347).
* A section about troubleshooting was added to the network setup guide. [Pull request #2398](https://github.com/bigchaindb/bigchaindb/pull/2398).
* Some of the core code was given a better package structure. [Pull request #2401](https://github.com/bigchaindb/bigchaindb/pull/2401).
* Some of the previously disabled unit tests were re-enabled and updated. Pull requests [#2404](https://github.com/bigchaindb/bigchaindb/pull/2404) and [#2402](https://github.com/bigchaindb/bigchaindb/pull/2402).
* Some building blocks for dynamically adding new validators were introduced. [Pull request #2392](https://github.com/bigchaindb/bigchaindb/pull/2392).
## [2.0 Beta 3] - 2018-07-18
Tag name: v2.0.0b3
### Fixed
Fixed a bug in transaction validation. For some more-complex situations, it would say that a valid transaction was invalid. This bug was actually fixed before; it was [issue #1271](https://github.com/bigchaindb/bigchaindb/issues/1271). The unit test for it was turned off while we integrated Tendermint. Then the query implementation code got changed, reintroducing the bug, but the unit test was off so the bug wasn't caught. When we turned the test back on, shortly after releasing Beta 2, it failed, unveiling the bug. [Pull request #2389](https://github.com/bigchaindb/bigchaindb/pull/2389)
## [2.0 Beta 2] - 2018-07-16
Tag name: v2.0.0b2
### Added
* Added new configuration settings `tendermint.host` and `tendermint.port`. [Pull request #2342](https://github.com/bigchaindb/bigchaindb/pull/2342)
* Added tests to ensure that BigchainDB gracefully handles "nasty" strings in keys and values. [Pull request #2334](https://github.com/bigchaindb/bigchaindb/pull/2334)
* Added a new logging handler to capture benchmark stats to a separate file. [Pull request #2349](https://github.com/bigchaindb/bigchaindb/pull/2349)
### Changed
* Changed the names of BigchainDB processes (Python processes) to include 'bigchaindb', so they are easier to spot and find. [Pull request #2354](https://github.com/bigchaindb/bigchaindb/pull/2354)
* Updated all code to support the latest version of Tendermint. Note that the BigchainDB ABCI server now listens to port 26657 instead of 46657. Pull requests [#2375](https://github.com/bigchaindb/bigchaindb/pull/2375) and [#2380](https://github.com/bigchaindb/bigchaindb/pull/2380)
### Removed
Removed all support and code for the old backlog_reassign_delay setting. [Pull request #2332](https://github.com/bigchaindb/bigchaindb/pull/2332)
### Fixed
* Fixed a bug that sometimes arose when using Docker Compose. (Tendermint would freeze.) [Pull request #2341](https://github.com/bigchaindb/bigchaindb/pull/2341)
* Fixed a bug in the code that creates a MongoDB index for the "id" in the transactions collection. It works now, and performance is improved. [Pull request #2378](https://github.com/bigchaindb/bigchaindb/pull/2378)
* The logging server would keep runnning in some tear-down scenarios. It doesn't do that any more. [Pull request #2304](https://github.com/bigchaindb/bigchaindb/pull/2304)
### External Contributors
@hrntknr - [Pull request #2331](https://github.com/bigchaindb/bigchaindb/pull/2331)
### Known Issues
The `bigchaindb upsert-validator` subcommand is not working yet, but a solution ([BEP-21](https://github.com/bigchaindb/BEPs/tree/master/21)) has been finalized and will be implemented before we release the final BigchainDB 2.0.
### Notes
* A lot of old/dead code was deleted. Pull requests
[#2319](https://github.com/bigchaindb/bigchaindb/pull/2319),
[#2338](https://github.com/bigchaindb/bigchaindb/pull/2338),
[#2357](https://github.com/bigchaindb/bigchaindb/pull/2357),
[#2365](https://github.com/bigchaindb/bigchaindb/pull/2365),
[#2366](https://github.com/bigchaindb/bigchaindb/pull/2366),
[#2368](https://github.com/bigchaindb/bigchaindb/pull/2368) and
[#2374](https://github.com/bigchaindb/bigchaindb/pull/2374)
* Improved the documentation page "How to setup a BigchainDB Network". [Pull Request #2312](https://github.com/bigchaindb/bigchaindb/pull/2312)
## [2.0 Beta 1] - 2018-06-01
Tag name: v2.0.0b1
### Fixed
* Fixed a bug that arose with some code that treated transactions-waiting-for-block-inclusion as if they were already stored in MongoDB (i.e. already in a block). [Pull request #2318](https://github.com/bigchaindb/bigchaindb/pull/2318)
* If a user asked for a block and it happened to be an empty block, BigchainDB returned 404 Not Found, as if the block did not exist. Now it returns a 200 OK with a block containing no transactions, i.e. an empty block. [Pull request #2321](https://github.com/bigchaindb/bigchaindb/pull/2321)
### Known Issues
* An issue was found with the `bigchaindb upsert-validator` command. A solution was proposed in [BEP-19](https://github.com/bigchaindb/BEPs/pull/45) and is being implemented in [pull request #2314](https://github.com/bigchaindb/bigchaindb/pull/2314)
* If you run BigchainDB locally using `make start` (i.e. using Docker Compose) and then you put the node under heavy write load, Tendermint can become unresponsive and running `make stop` can hang.
* There seems to be one or more issues with Tendermint when it is put under heavy load (i.e. even when BigchainDB isn't involved). See Tendermint issues [#1394](https://github.com/tendermint/tendermint/issues/1394), [#1642](https://github.com/tendermint/tendermint/issues/1642) and [#1661](https://github.com/tendermint/tendermint/issues/1661)
### Notes
* There's a [new docs page](https://docs.bigchaindb.com/projects/server/en/v2.0.0b1/simple-network-setup.html) about how to set up a network where each node uses a single virtual machine.
* We checked, and BigchainDB 2.0 Beta 1 works with MongoDB 3.6 (and 3.4).
* Support for RethinkDB is completely gone.
## [2.0 Alpha 6] - 2018-05-17
Tag name: v2.0.0a6
### Changed
Upgraded PyMongo to version 3.6 (which is compatible with MongoDB 3.6, 3.4 [and more](https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#python-driver-compatibility)). [Pull request #2298](https://github.com/bigchaindb/bigchaindb/pull/2298)
### Fixed
When deploying a node using our Docker Compose file, it didn't expose port 46656, which is used by Tendermint for inter-node communications, so the node couldn't communicate with other nodes. We fixed that in [pull request #2299](https://github.com/bigchaindb/bigchaindb/pull/2299)
### Notes
We ran all our tests using MongoDB 3.6 and they all passed, so it seems safe to use BigchainDB with MongoDB 3.6 from now on.
## [2.0 Alpha 5] - 2018-05-11
Tag name: v2.0.0a5
### Changed
To resolve [issue #2279](https://github.com/bigchaindb/bigchaindb/issues/2279), we made some changes to the `bigchaindb-abci` package (which is our fork of `py-abci`) and told BigchainDB to use the new version (`bigchaindb-abci==0.4.5`). [Pull request #2281](https://github.com/bigchaindb/bigchaindb/pull/2281).
## [2.0 Alpha 4] - 2018-05-09
Tag name: v2.0.0a4
### Changed
The Kubernetes liveness probe for the BigchainDB StatefulSet was improved to check the Tendermint /status endpoint in addition to the Tendermint /abci_info endpoint. [Pull request #2275](https://github.com/bigchaindb/bigchaindb/pull/2275)
### Fixed
[Pull request #2270](https://github.com/bigchaindb/bigchaindb/pull/2270) resolved [issue #2269](https://github.com/bigchaindb/bigchaindb/issues/2269).
### Notes
There's a new [page in the docs about storing files in BigchainDB](https://docs.bigchaindb.com/en/latest/store-files.html). [Pull request #2259](https://github.com/bigchaindb/bigchaindb/pull/2259)
## [2.0 Alpha 3] - 2018-05-03
Tag name: v2.0.0a3
### Changed
* Upgraded BigchainDB Server code to use the latest version of Tendermint: version 0.19.2. Pull requests [#2249](https://github.com/bigchaindb/bigchaindb/pull/2249), [#2252](https://github.com/bigchaindb/bigchaindb/pull/2252) and [#2253](https://github.com/bigchaindb/bigchaindb/pull/2253)
* Made some fixes to `py-abci` (an external Python package) and used our fixed version with BigchainDB. Those fixes resolved several known issues, including [issue #2182](https://github.com/bigchaindb/bigchaindb/issues/2182) and issues with large transactions in general. Note: At the time of writing, our fixes to `py-abci` hadn't been merged into the main `py-abci` repository or its latest release on PyPI; we were using our own special `bigchaindb-abci` package (which included our fixes). Pull requests [#2250](https://github.com/bigchaindb/bigchaindb/pull/2250) and [#2261](https://github.com/bigchaindb/bigchaindb/pull/2261)
* If BigchainDB Server crashes and then comes back, Tendermint Core doesn't try to reconnect to it. That's just how Tendermint Core works. We revised our Kubernetes-based production deployment template to resolve that issue: BigchainDB Server and Tendermint Core are now in the same Kubernetes StatefulSet; if the connection between them ever goes down, then Kubernetes restarts the whole StatefulSet. [Pull request #2242](https://github.com/bigchaindb/bigchaindb/pull/2242)
### Fixed
Re-enabled multi-threading. [Pull request #2258](https://github.com/bigchaindb/bigchaindb/pull/2258)
### Known Issues
Tendermint changed how it responds to a request to store data (via the [Tendermint Broadcast API](https://tendermint.com/docs/tendermint-core/using-tendermint.html#broadcast-api)) between version 0.12 and 0.19.2. We started modifying the code of BigchainDB Server to account for those changes in responses (in [pull request #2239](https://github.com/bigchaindb/bigchaindb/pull/2239)), but we found that there's a difference between what the Tendermint documentation _says_ about those responses and how Tendermint actually responds. We need to determine Tendermint's intent before we can finalize that pull request.
### Notes
We were focused on getting the public BigchainDB Testnet stable during the development of BigchainDB 2.0 Alpha 3, and we think we largely succeeded. Because of that focus, we delayed the deployment of an internal test network until later. It would have had the same instabilities as the public BigchainDB Testnet anyway. In the future, we'll always test a new version of BigchainDB on our internal test network before deploying it on the public BigchainDB Testnet. (That wasn't possible this time around, because there was no old/stable version of BigchainDB 2.n to run on the public BigchainDB Testnet while we tested BigchainDB 2.[n+1] internally.)
## [2.0 Alpha 2] - 2018-04-18
Tag name: v2.0.0a2
### Added
An implementation of [BEP-8 (BigchainDB Enhancement Proposal #8)](https://github.com/bigchaindb/BEPs/tree/master/8), which makes sure a node can recover from a system fault (e.g. a crash) into a consistent state, i.e. a state where the data in the node's local MongoDB database is consistent with the data stored in the blockchain. Pull requests [#2135](https://github.com/bigchaindb/bigchaindb/pull/2135) and [#2207](https://github.com/bigchaindb/bigchaindb/pull/2207)
### Changed
When someone uses the HTTP API to send a new transaction to a BigchainDB network using the [POST /api/v1/transactions?mode={mode}](https://docs.bigchaindb.com/projects/server/en/master/http-client-server-api.html#post--api-v1-transactions?mode=mode) endpoint, they now get back a more informative HTTP response, so they can better-understand what happened. This is only when mode is `commit` or `sync`, because `async` _means_ that the response is immediate, without waiting to see what happened to the transaction. [Pull request #2198](https://github.com/bigchaindb/bigchaindb/pull/2198)
### Known Issues
* If BigchainDB Server crashes and then is restarted, Tendermint Core won't try to reconnect to BigchainDB Server and so all operations requiring that connection won't work. We only understood this recently. We'll write a blog post explaining what we intend to do about it.
* The known issues in 2.0 Alpha (listed below) are still there.
## [2.0 Alpha] - 2018-04-03
Tag name: v2.0.0a1
There were _many_ changes between 1.3 and 2.0 Alpha, too many to list here. We wrote a series of blog posts to summarize most changes, especially those that affect end users and application developers:
* [BigchainDB 2.0 is Byzantine Fault Tolerant](https://blog.bigchaindb.com/bigchaindb-2-0-is-byzantine-fault-tolerant-5ffdac96bc44)
* [Some HTTP API Changes in the Next Release](https://blog.bigchaindb.com/some-http-api-changes-in-the-next-release-49612a537b0c)
* [Three Transaction Model Changes in the Next Release](https://blog.bigchaindb.com/three-transaction-model-changes-in-the-next-release-dadbac50094a)
* [Changes to the Server Command Line Interface in BigchainDB 2.0](https://blog.bigchaindb.com/changes-to-the-server-command-line-interface-in-bigchaindb-2-0-e1d6576e7155)
* _A forthcoming post about changes in BigchainDB Server configuration settings_
### External Contributors
* @r7vme contributed [pull request #1984](https://github.com/bigchaindb/bigchaindb/pull/1984) which fixed a bug in our Kubernetes-based production deployment template.
### Known Issues
We intend to resolve these issues before releasing the final BigchainDB 2.0:
* There's a known Heisenbug that (sometimes) arises and we found that making the BigchainDB webserver single-threaded prevents that bug from causing problems. We intend to resolve that bug, but in the meantime our temporary workaround is to change the _default_ webserver configuration settings to single-threaded mode, i.e. `BIGCHAINDB_SERVER_WORKERS=1` and `BIGCHAINDB_SERVER_THREADS=1`.
* Issues sometimes happen when a large transaction is sent to a BigchainDB network.
## [1.3] - 2017-11-21
Tag name: v1.3.0
### Added
* Metadata full-text search. [Pull request #1812](https://github.com/bigchaindb/bigchaindb/pull/1812)
### Notes
* Improved documentation about blocks and votes. [Pull request #1855](https://github.com/bigchaindb/bigchaindb/pull/1855)
## [1.2] - 2017-11-13
Tag name: v1.2.0
### Added
* New and improved installation setup docs and code. Pull requests [#1775](https://github.com/bigchaindb/bigchaindb/pull/1775) and [#1785](https://github.com/bigchaindb/bigchaindb/pull/1785)
* New BigchainDB configuration setting to set the port number of the log server: `log.port`. [Pull request #1796](https://github.com/bigchaindb/bigchaindb/pull/1796)
* New secondary index on `id` in the bigchain table. That will make some queries execute faster. [Pull request #1803](https://github.com/bigchaindb/bigchaindb/pull/1803)
* When using MongoDB, there are some restrictions on allowed names for keys (JSON keys). Those restrictions were always there but now BigchainDB checks key names explicitly, rather than leaving that to MongoDB. Pull requests [#1807](https://github.com/bigchaindb/bigchaindb/pull/1807) and [#1811](https://github.com/bigchaindb/bigchaindb/pull/1811)
* When using MongoDB, there are some restrictions on the allowed values of "language" (if that key is used in the values of `metadata` or `asset.data`). Those restrictions were always there but now BigchainDB checks the values explicitly, rather than leaving that to MongoDB. Pull requests [#1806](https://github.com/bigchaindb/bigchaindb/pull/1806) and [#1811](https://github.com/bigchaindb/bigchaindb/pull/1811)
* There's a new page in the root docs about permissions in BigchainDB. [Pull request #1788](https://github.com/bigchaindb/bigchaindb/pull/1788)
* There's a new option in the `bigchaindb start` command: `bigchaindb start --no-init` will avoid doing `bigchaindb init` if it wasn't done already. [Pull request #1814](https://github.com/bigchaindb/bigchaindb/pull/1814)
### Fixed
* Fixed a bug where setting the log level in a BigchainDB config file didn't have any effect. It does now. [Pull request #1797](https://github.com/bigchaindb/bigchaindb/pull/1797)
* The docs were wrong about there being no Ping/Pong support in the Events API. There is, so the docs were fixed. [Pull request #1799](https://github.com/bigchaindb/bigchaindb/pull/1799)
* Fixed an issue with closing WebSocket connections properly. [Pull request #1819](https://github.com/bigchaindb/bigchaindb/pull/1819)
### Notes
* Many changes were made to the Kubernetes-based production deployment template and code.
## [1.1] - 2017-09-26
Tag name: v1.1.0
### Added
* Support for server-side plugins that can add support for alternate event consumers (other than the WebSocket API). [Pull request #1707](https://github.com/bigchaindb/bigchaindb/pull/1707)
* New configuration settings to set the *advertised* wsserver scheme, host and port. (The *advertised* ones are the ones that external users use to connect to the WebSocket API.) [Pull request #1703](https://github.com/bigchaindb/bigchaindb/pull/1703)
* Support for secure (TLS) WebSocket connections. [Pull request #1619](https://github.com/bigchaindb/bigchaindb/pull/1619)
* A new page of documentation about the contents of a condition (inside a transaction). [Pull request #1668](https://github.com/bigchaindb/bigchaindb/pull/1668)
### Changed
* We updated our definition of the **public API** (at the top of this document). [Pull request #1700](https://github.com/bigchaindb/bigchaindb/pull/1700)
* The HTTP API Logger now logs the request path and method as well. [Pull request #1644](https://github.com/bigchaindb/bigchaindb/pull/1644)
### External Contributors
* @carchrae - [Pull request #1731](https://github.com/bigchaindb/bigchaindb/pull/1731)
* @ivanbakel - [Pull request #1706](https://github.com/bigchaindb/bigchaindb/pull/1706)
* @ketanbhatt - Pull requests [#1643](https://github.com/bigchaindb/bigchaindb/pull/1643) and [#1644](https://github.com/bigchaindb/bigchaindb/pull/1644)
### Notes
* New drivers & tools from our community:
* [Java driver](https://github.com/authenteq/java-bigchaindb-driver), by [Authenteq](https://authenteq.com/)
* [Ruby library](https://rubygems.org/gems/bigchaindb), by @nileshtrivedi
* Many improvements to our production deployment template (which uses Kubernetes).
* The production deployment template for the multi-node case was out of date. We updated that and verified it. [Pull request #1713](https://github.com/bigchaindb/bigchaindb/pull/1713)
## [1.0.1] - 2017-07-13
Tag name: v1.0.1
### Fixed
* Various issues in the Quickstart page. Pull requests
[#1641](https://github.com/bigchaindb/bigchaindb/pull/1641) and
[#1648](https://github.com/bigchaindb/bigchaindb/pull/1648).
* Changefeed hanging when MongoDB primary node is turned off.
[Pull request #1638](https://github.com/bigchaindb/bigchaindb/pull/1638).
* Missing `assets` tables for RethinkDB backend.
[Pull request #1646](https://github.com/bigchaindb/bigchaindb/pull/1646).
* Cryptoconditions version mismatch.
[Pull request #1659](https://github.com/bigchaindb/bigchaindb/pull/1659).
## [1.0.0] - 2017-07-05
Tag name: v1.0.0
**This just reports the changes since the release of 1.0.0rc1. If you want the full picture of all changes since 0.10, then read the 1.0.0rc1 change log below as well as the upgrade guide.**
### Changed
* The file name of the upgrade guide changed from `docs/upgrade-guides/v0.10-->v1.0.md` to `docs/upgrade-guides/v0.10-v1.0.md`.
* In `transaction.inputs[n].fulfills`, `output` was renamed to `output_index`. [Pull Request #1596](https://github.com/bigchaindb/bigchaindb/pull/1596)
* In `transaction.outputs[n].condition.details`, 1) `signature` was removed (from signature conditions) and 2) `subfulfillments` was renamed to `subconditions` (in threshold conditions). [Pull Request #1589](https://github.com/bigchaindb/bigchaindb/pull/1589)
* Refined transaction schema validation to check that the `transaction.outputs[n].condition.uri` corresponds to a condition that BigchainDB Server 1.0.0 actually supports. [Pull Request #1597](https://github.com/bigchaindb/bigchaindb/pull/1597)
* Before, GET requests (to the HTTP API) with header `Content-Type: 'application/json'` would get a response with the message, "The browser (or proxy) sent a request that this server could not understand." Now, if a GET request includes a `Content-Type` header, that header gets deleted (i.e. ignored). [Pull Request #1630](https://github.com/bigchaindb/bigchaindb/pull/1630)
### Fixed
* If an end user sends a transaction with `operation` equal to `GENESIS`, it will be rejected as invalid. [Pull Request #1612](https://github.com/bigchaindb/bigchaindb/pull/1612)
## [1.0.0rc1] - 2017-06-23
Tag name: v1.0.0rc1
### Added
* Support for secure TLS/SSL communication between MongoDB and {BigchainDB, MongoDB Backup Agent, MongoDB Monitoring Agent}. Pull Requests
[#1456](https://github.com/bigchaindb/bigchaindb/pull/1456),
[#1497](https://github.com/bigchaindb/bigchaindb/pull/1497),
[#1510](https://github.com/bigchaindb/bigchaindb/pull/1510),
[#1536](https://github.com/bigchaindb/bigchaindb/pull/1536),
[#1551](https://github.com/bigchaindb/bigchaindb/pull/1551) and
[#1552](https://github.com/bigchaindb/bigchaindb/pull/1552).
* Text search support (only if using MongoDB). Pull Requests [#1469](https://github.com/bigchaindb/bigchaindb/pull/1469) and [#1471](https://github.com/bigchaindb/bigchaindb/pull/1471)
* The `database.connection_timeout` configuration setting now works with RethinkDB too. [#1512](https://github.com/bigchaindb/bigchaindb/pull/1512)
* New code and tools for benchmarking CREATE transactions. [Pull Request #1511](https://github.com/bigchaindb/bigchaindb/pull/1511)
### Changed
* There's an upgrade guide in `docs/upgrade-guides/v0.10-->v1.0.md`. It only covers changes to the transaction model and HTTP API. If that file hasn't been merged yet, see [Pull Request #1547](https://github.com/bigchaindb/bigchaindb/pull/1547)
* Cryptographic signatures now sign the whole (serialized) transaction body, including the transaction ID, but with all `"fulfillment"` values changed to `None`. [Pull Request #1225](https://github.com/bigchaindb/bigchaindb/pull/1225)
* In transactions, the value of `"amount"` must be a string. (Before, it was supposed to be a number.) [Pull Request #1286](https://github.com/bigchaindb/bigchaindb/pull/1286)
* In `setup.py`, the "Development Status" (as reported on PyPI) was changed from Alpha to Beta. [Pull Request #1437](https://github.com/bigchaindb/bigchaindb/pull/1437)
* If you explicitly specify a config file, e.g. `bigchaindb -c path/to/config start` and that file can't be found, then BigchainDB Server will fail with a helpful error message. [Pull Request #1486](https://github.com/bigchaindb/bigchaindb/pull/1486)
* Reduced the response time on the HTTP API endpoint to get all the unspent outputs associated with a given public key (a.k.a. "fast unspents"). [Pull Request #1411](https://github.com/bigchaindb/bigchaindb/pull/1411)
* Internally, the value of an asset's `"data"` is now stored in a separate assets table. This enabled the new text search. Each asset data is stored along with the associated CREATE transaction ID (asset ID). That data gets written when the containing block gets written to the bigchain table. [Pull Request #1460](https://github.com/bigchaindb/bigchaindb/pull/1460)
* Schema validation was sped up by switching to `rapidjson-schema`. [Pull Request #1494](https://github.com/bigchaindb/bigchaindb/pull/1494)
* If a node comes back from being down for a while, it will resume voting on blocks in the order determined by the MongoDB oplog, in the case of MongoDB. (In the case of RethinkDB, blocks missed in the changefeed will not be voted on.) [Pull Request #1389](https://github.com/bigchaindb/bigchaindb/pull/1389)
* Parallelized transaction schema validation in the vote pipeline. [Pull Request #1492](https://github.com/bigchaindb/bigchaindb/pull/1492)
* `asset.data` or `asset.id` are now *required* in a CREATE or TRANSFER transaction, respectively. [Pull Request #1518](https://github.com/bigchaindb/bigchaindb/pull/1518)
* The HTTP response body, in the response to the `GET /` and the `GET /api/v1` endpoints, was changed substantially. [Pull Request #1529](https://github.com/bigchaindb/bigchaindb/pull/1529)
* Changed the HTTP `GET /api/v1/transactions/{transaction_id}` endpoint. It now only returns the transaction if it's in a valid block. It also returns a new header with a relative link to a status monitor. [Pull Request #1543](https://github.com/bigchaindb/bigchaindb/pull/1543)
* All instances of `txid` and `tx_id` were replaced with `transaction_id`, in the transaction model and the HTTP API. [Pull Request #1532](https://github.com/bigchaindb/bigchaindb/pull/1532)
* The hostname and port were removed from all URLs in all HTTP API responses. [Pull Request #1538](https://github.com/bigchaindb/bigchaindb/pull/1538)
* Relative links were replaced with JSON objects in HTTP API responses. [Pull Request #1541](https://github.com/bigchaindb/bigchaindb/pull/1541)
* In the outputs endpoint of the HTTP API, the query parameter `unspent` was changed to `spent` (so no more double negatives). If that query parameter isn't included, then all outputs matching the specificed public key will be returned. If `spent=true`, then only the spent outputs will be returned. If `spent=false`, then only the unspent outputs will be returned. [Pull Request #1545](https://github.com/bigchaindb/bigchaindb/pull/1545)
* The supported crypto-conditions changed from version 01 of the crypto-conditions spec to version 02. [Pull Request #1562](https://github.com/bigchaindb/bigchaindb/pull/1562)
* The value of "version" inside a transaction must now be "1.0". (Before, it could be "0.anything".) [Pull Request #1574](https://github.com/bigchaindb/bigchaindb/pull/1574)
### Removed
* The `server.threads` configuration setting (for the Gunicorn HTTP server) was removed from the default set of BigchainDB configuration settings. [Pull Request #1488](https://github.com/bigchaindb/bigchaindb/pull/1488)
### Fixed
* The `GET /api/v1/outputs` endpoint was failing for some transactions with threshold conditions. Fixed in [Pull Request #1450](https://github.com/bigchaindb/bigchaindb/pull/1450)
### External Contributors
* @elopio - Pull Requests [#1415](https://github.com/bigchaindb/bigchaindb/pull/1415) and [#1491](https://github.com/bigchaindb/bigchaindb/pull/1491)
* @CsterKuroi - [Pull Request #1447](https://github.com/bigchaindb/bigchaindb/pull/1447)
* @tdsgit - [Pull Request #1512](https://github.com/bigchaindb/bigchaindb/pull/1512)
* @lavinasachdev3 - [Pull Request #1357](https://github.com/bigchaindb/bigchaindb/pull/1357)
### Notes
* We dropped support for Python 3.4. [Pull Request #1564](https://github.com/bigchaindb/bigchaindb/pull/1564)
* There were many improvements to our Kubernetes-based production deployment template (and the associated documentaiton).
* There is now a [BigchainDB Ruby driver](https://github.com/LicenseRocks/bigchaindb_ruby), created by @addywaddy at [license.rocks](https://github.com/bigchaindb/bigchaindb/pull/1437).
* The [BigchainDB JavaScript driver](https://github.com/bigchaindb/js-bigchaindb-driver) was moved to a different GitHub repo and is now officially maintained by the BigchainDB team.
* We continue to recommend using MongoDB.
## [0.10.3] - 2017-06-29
Tag name: v0.10.3
## Fixed
* Pin minor+ version of `cryptoconditions` to avoid upgrading to a non
compatible version.
[commit 97268a5](https://github.com/bigchaindb/bigchaindb/commit/97268a577bf27942a87d8eb838f4816165c84fd5)
## [0.10.2] - 2017-05-16
Tag name: v0.10.2
### Added
* Add Cross Origin Resource Sharing (CORS) support for the HTTP API.
[Commit 6cb7596](https://github.com/bigchaindb/bigchaindb/commit/6cb75960b05403c77bdae0fd327612482589efcb)
### Fixed
* Fixed `streams_v1` API link in response to `GET /api/v1`.
[Pull Request #1466](https://github.com/bigchaindb/bigchaindb/pull/1466)
* Fixed mismatch between docs and implementation for `GET /blocks?status=`
endpoint. The `status` query parameter is now case insensitive.
[Pull Request #1464](https://github.com/bigchaindb/bigchaindb/pull/1464)
## [0.10.1] - 2017-04-19
Tag name: v0.10.1
### Added
* Documentation for the BigchainDB settings `wsserver.host` and `wsserver.port`. [Pull Request #1408](https://github.com/bigchaindb/bigchaindb/pull/1408)
### Fixed
* Fixed `Dockerfile`, which was failing to build. It now starts `FROM python:3.6` (instead of `FROM ubuntu:xenial`). [Pull Request #1410](https://github.com/bigchaindb/bigchaindb/pull/1410)
* Fixed the `Makefile` so that `release` depends on `dist`. [Pull Request #1405](https://github.com/bigchaindb/bigchaindb/pull/1405)
## [0.10.0] - 2017-04-18
Tag name: v0.10.0
### Added
* Improved logging. Added logging to file. Added `--log-level` option to `bigchaindb start` command. Added new logging configuration settings. Pull Requests
[#1285](https://github.com/bigchaindb/bigchaindb/pull/1285),
[#1307](https://github.com/bigchaindb/bigchaindb/pull/1307),
[#1324](https://github.com/bigchaindb/bigchaindb/pull/1324),
[#1326](https://github.com/bigchaindb/bigchaindb/pull/1326),
[#1327](https://github.com/bigchaindb/bigchaindb/pull/1327),
[#1330](https://github.com/bigchaindb/bigchaindb/pull/1330),
[#1365](https://github.com/bigchaindb/bigchaindb/pull/1365),
[#1394](https://github.com/bigchaindb/bigchaindb/pull/1394),
[#1396](https://github.com/bigchaindb/bigchaindb/pull/1396),
[#1398](https://github.com/bigchaindb/bigchaindb/pull/1398) and
[#1402](https://github.com/bigchaindb/bigchaindb/pull/1402)
* Events API using WebSocket protocol. Pull Requests
[#1086](https://github.com/bigchaindb/bigchaindb/pull/1086),
[#1347](https://github.com/bigchaindb/bigchaindb/pull/1347),
[#1349](https://github.com/bigchaindb/bigchaindb/pull/1349),
[#1356](https://github.com/bigchaindb/bigchaindb/pull/1356),
[#1368](https://github.com/bigchaindb/bigchaindb/pull/1368),
[#1401](https://github.com/bigchaindb/bigchaindb/pull/1401) and
[#1403](https://github.com/bigchaindb/bigchaindb/pull/1403)
* Initial support for using SSL with MongoDB (work in progress). Pull Requests
[#1299](https://github.com/bigchaindb/bigchaindb/pull/1299) and
[#1348](https://github.com/bigchaindb/bigchaindb/pull/1348)
### Changed
* The main BigchainDB Dockerfile (and its generated Docker image) now contains only BigchainDB Server. (It used to contain both BigchainDB Server and RethinkDB.) You must now run MongoDB or RethinkDB in a separate Docker container. [Pull Request #1174](https://github.com/bigchaindb/bigchaindb/pull/1174)
* Made separate schemas for CREATE and TRANSFER transactions. [Pull Request #1257](https://github.com/bigchaindb/bigchaindb/pull/1257)
* When signing transactions with threshold conditions, we now sign all subconditions for a public key. [Pull Request #1294](https://github.com/bigchaindb/bigchaindb/pull/1294)
* Many changes to the voting-related code, including how we validate votes and prevent duplicate votes by the same node. Pull Requests [#1215](https://github.com/bigchaindb/bigchaindb/pull/1215) and [#1258](https://github.com/bigchaindb/bigchaindb/pull/1258)
### Removed
* Removed the `bigchaindb load` command. Pull Requests
[#1261](https://github.com/bigchaindb/bigchaindb/pull/1261),
[#1273](https://github.com/bigchaindb/bigchaindb/pull/1273) and
[#1301](https://github.com/bigchaindb/bigchaindb/pull/1301)
* Removed old `/speed-tests` and `/benchmarking-tests` directories. [Pull Request #1359](https://github.com/bigchaindb/bigchaindb/pull/1359)
### Fixed
* Fixed the URL of the BigchainDB docs returned by the HTTP API. [Pull Request #1178](https://github.com/bigchaindb/bigchaindb/pull/1178)
* Fixed the MongoDB changefeed: it wasn't reporting update operations. [Pull Request #1193](https://github.com/bigchaindb/bigchaindb/pull/1193)
* Fixed the block-creation process: it wasn't checking if the transaction was previously included in:
* a valid block. [Pull Request #1208](https://github.com/bigchaindb/bigchaindb/pull/1208)
* the block-under-construction. Pull Requests [#1237](https://github.com/bigchaindb/bigchaindb/issues/1237) and [#1377](https://github.com/bigchaindb/bigchaindb/issues/1377)
### External Contributors
In alphabetical order by GitHub username:
* @anryko - [Pull Request #1277](https://github.com/bigchaindb/bigchaindb/pull/1277)
* @anujism - [Pull Request #1366](https://github.com/bigchaindb/bigchaindb/pull/1366)
* @jackric - [Pull Request #1365](https://github.com/bigchaindb/bigchaindb/pull/1365)
* @lavinasachdev3 - [Pull Request #1358](https://github.com/bigchaindb/bigchaindb/pull/1358)
* @morrme - [Pull Request #1340](https://github.com/bigchaindb/bigchaindb/pull/1340)
* @tomconte - [Pull Request #1299](https://github.com/bigchaindb/bigchaindb/pull/1299)
* @tymlez - Pull Requests [#1108](https://github.com/bigchaindb/bigchaindb/pull/1108) & [#1209](https://github.com/bigchaindb/bigchaindb/pull/1209)
### Notes
* MongoDB is now the recommended database backend (not RethinkDB).
* There are some initial docs about how to deploy a BigchainDB node on Kubernetes. It's work in progress.
## [0.9.5] - 2017-03-29
Tag name: v0.9.5
### Fixed
Upgrade `python-rapidjson` to `0.0.11`(fixes #1350 - thanks to @ferOnti for
reporting).
## [0.9.4] - 2017-03-16
Tag name: v0.9.4
### Fixed
Fixed #1271 (false double spend error). Thanks to @jmduque for reporting the
problem along with a very detailed diagnosis and useful recommendations.
## [0.9.3] - 2017-03-06
Tag name: v0.9.3
### Fixed
Fixed HTTP API 500 error on `GET /outputs`: issues #1200 and #1231.
## [0.9.2] - 2017-03-02
Tag name: v0.9.2
### Fixed
Pin `python-rapidjson` library in `setup.py` to prevent `bigchaindb`'s
installation to fail due to
https://github.com/python-rapidjson/python-rapidjson/issues/62.
## [0.9.1] - 2017-02-06
Tag name: v0.9.1
### Fixed
* Fixed bug in how the transaction `VERSION` string was calculated from the BigchainDB Server `__short_version__` string. [Pull Request #1160](https://github.com/bigchaindb/bigchaindb/pull/1160)
## [0.9.0] - 2017-02-06
Tag name: v0.9.0
It has been more than two months since the v0.8.0 release, so there have been _many_ changes. We decided to describe them in broad strokes, with links to more details elsewhere.
### Added
- Support for MongoDB as a backend database.
- Some configuration settings and `bigchaindb` command-line commands were added. In particular, one can specify the database backend (`rethinkdb` or `mongodb`). For MongoDB, one can specify the name of the replicaset. Also for MongoDB, there are new command-line commands to add and remove hosts from the replicaset. See [the Settings & CLI docs](https://docs.bigchaindb.com/projects/server/en/v0.9.0/server-reference/index.html).
- Transaction schema validation. The transaction schema is also used to auto-generate some docs. [Pull Request #880](https://github.com/bigchaindb/bigchaindb/pull/880)
- Vote schema validation. The vote schema is also used to auto-generate some docs. [Pull Request #865](https://github.com/bigchaindb/bigchaindb/pull/865)
- New `ENABLE_WEB_ADMIN` setting in the AWS deployment configuration file. [Pull Request #1015](https://github.com/bigchaindb/bigchaindb/pull/1015)
### Changed
- The transaction model has changed substantially. @libscott wrote a blog post about the changes and it will be published soon on [the BigchainDB Blog](https://blog.bigchaindb.com/). Also, see [the docs about the transaction model](https://docs.bigchaindb.com/projects/server/en/v0.9.0/data-models/transaction-model.html).
- The HTTP API has changed substantially. @diminator wrote a blog post about the changes and it will be published soon on [the BigchainDB Blog](https://blog.bigchaindb.com/). Also, see [the docs about the vote model](https://docs.bigchaindb.com/projects/server/en/v0.9.0/data-models/vote-model.html).
- All RethinkDB-specific database calls were replaced with abstract calls to a backend database.
- Some improvements to the Dockerfile, e.g. Pull Requests [#1011](https://github.com/bigchaindb/bigchaindb/pull/1011) and [#1121](https://github.com/bigchaindb/bigchaindb/pull/1121)
- Many improvements to the tests
- We standardized on supporting Ubuntu 16.04 for now (but BigchainDB Server also works on similar Linux distros).
### Removed
- `api_endpoint` was removed from the BigchainDB configuration settings. (It was never used anyway.) [Pull Request #821](https://github.com/bigchaindb/bigchaindb/pull/821)
- Removed all remaining StatsD monitoring code, configuration settings, docs, etc. (We'll add another monitoring solution in the future.) [Pull Request #1138](https://github.com/bigchaindb/bigchaindb/pull/1138)
### Fixed
- Fixed a memory (RAM) overflow problem when under heavy load by bounding the size of the queue at the entrance to the block pipeline. [Pull Request #908](https://github.com/bigchaindb/bigchaindb/pull/908)
- Fixed some logic in block validation. [Pull Request #1130](https://github.com/bigchaindb/bigchaindb/pull/1130)
### External Contributors
- @amirelemam - [Pull Request #762](https://github.com/bigchaindb/bigchaindb/pull/762) (closed but used as the basis for [Pull Request #1074](https://github.com/bigchaindb/bigchaindb/pull/1074))
- @utarl - [Pull Request #1019](https://github.com/bigchaindb/bigchaindb/pull/1019)
### Notes
- There were many additions and changes to the documentation. Fun fact: The JSON in the HTTP API docs is now auto-generated to be consistent with the current code.
- There's a draft spec for a BigchainDB Event Stream API and we welcome your feedback. See [Pull Request #1086](https://github.com/bigchaindb/bigchaindb/pull/1086)
## [0.8.2] - 2017-01-27
Tag name: v0.8.2
@ -26,21 +703,17 @@ Tag name: v0.8.2
## [0.8.1] - 2017-01-16
Tag name: v0.8.1
= commit:
committed:
### Changed
- Upgrade pysha3 to 1.0.0 (supports official NIST standard).
### Fixed
- Workaround for rapidjson problem with package metadata extraction
(https://github.com/kenrobbins/python-rapidjson/pull/52).
(https://github.com/kenrobbins/python-rapidjson/pull/52).
## [0.8.0] - 2016-11-29
Tag name: v0.8.0
= commit:
committed:
### Added
- The big new thing in version 0.8.0 is support for divisible assets, i.e. assets like carrots or thumbtacks, where the initial CREATE transaction can register/create some amount (e.g. 542 carrots), the first TRANSFER transaction can split that amount across multiple owners, and so on. [Pull Request #794](https://github.com/bigchaindb/bigchaindb/pull/794)
@ -61,7 +734,7 @@ committed:
- Renamed "verifying key" to "public key". Renamed "signing key" to "private key". Renamed "vk" to "pk". [Pull Request #807](https://github.com/bigchaindb/bigchaindb/pull/807)
- `get_transaction_by_asset_id` now ignores invalid transactions. [Pull Request #810](https://github.com/bigchaindb/bigchaindb/pull/810)
- `get_transaction_by_metadata_id` now ignores invalid transactions. [Pull Request #811](https://github.com/bigchaindb/bigchaindb/pull/811)
- Updates to the configs and scripts for deploying a test network on AWS. The example config file deploys virtual machines running Ubuntu 16.04 now. Pull Requests
- Updates to the configs and scripts for deploying a test network on AWS. The example config file deploys virtual machines running Ubuntu 16.04 now. Pull Requests
[#771](https://github.com/bigchaindb/bigchaindb/pull/771),
[#813](https://github.com/bigchaindb/bigchaindb/pull/813)
- Changed logging of transactions on block creation so now it just says the length of the list of transactions, rather than listing all the transactions. [Pull Request #861](https://github.com/bigchaindb/bigchaindb/pull/861)
@ -129,7 +802,7 @@ committed: Oct 28, 2016, 4:00 PM GMT+2
2. an `assignee`: the public key of the node it was assigned to.
- The `assignment_timestamp` wasn't removed before writing the transaction to a block. That was fixed in [Pull Request #627](https://github.com/bigchaindb/bigchaindb/pull/627)
- The `assignment_timestamp` and `assignee` weren't removed in the response to an HTTP API request sent to the `/api/v1/transactions/<txid>` endpoint. That was fixed in [Pull Request #646](https://github.com/bigchaindb/bigchaindb/pull/646)
- When validating a TRANSFER transaction, if any fulfillment refers to a transaction that's _not_ in a valid block, then the transaction isn't valid. This wasn't checked before but it is now. [Pull Request #629](https://github.com/bigchaindb/bigchaindb/pull/629)
- When validating a TRANSFER transaction, if any fulfillment refers to a transaction that's _not_ in a valid block, then the transaction isn't valid. This wasn't checked before but it is now. [Pull Request #629](https://github.com/bigchaindb/bigchaindb/pull/629)
### External Contributors
- @MinchinWeb - [Pull Request #696](https://github.com/bigchaindb/bigchaindb/pull/696)
@ -157,11 +830,11 @@ committed: Oct 28, 2016, 4:00 PM GMT+2
[#684](https://github.com/bigchaindb/bigchaindb/pull/684),
[#688](https://github.com/bigchaindb/bigchaindb/pull/688),
[#699](https://github.com/bigchaindb/bigchaindb/pull/699),
[#705](https://github.com/bigchaindb/bigchaindb/pull/705),
[#705](https://github.com/bigchaindb/bigchaindb/pull/705),
[#737](https://github.com/bigchaindb/bigchaindb/pull/737),
[#748](https://github.com/bigchaindb/bigchaindb/pull/748),
[#753](https://github.com/bigchaindb/bigchaindb/pull/753),
[#757](https://github.com/bigchaindb/bigchaindb/pull/757),
[#748](https://github.com/bigchaindb/bigchaindb/pull/748),
[#753](https://github.com/bigchaindb/bigchaindb/pull/753),
[#757](https://github.com/bigchaindb/bigchaindb/pull/757),
[#759](https://github.com/bigchaindb/bigchaindb/pull/759), and more
@ -286,7 +959,7 @@ committed: June 15, 2016, 1:42 PM GMT+2
### Changed
- Round timestamps to a precision of one second, and replace payload hash with payload UUID in transactions: [Pull Request #384](https://github.com/bigchaindb/bigchaindb/pull/384)
- Updated cryptoconditions API usage: [Pull Request #373](https://github.com/bigchaindb/bigchaindb/pull/373)
- Updated cryptoconditions API usage: [Pull Request #373](https://github.com/bigchaindb/bigchaindb/pull/373)
## [0.4.1] - 2016-06-13
@ -331,7 +1004,7 @@ committed: May 27, 2016, 1:42 PM GMT+2
### Changed
- The block processes now use GroupProcess: [Pull Request #267](https://github.com/bigchaindb/bigchaindb/pull/267)
- Replaced the `json` Python package with `rapidjson` (a Python wrapper for a fast JSON parser/generator written in C++), to speed up JSON serialization and deserialization: [Pull Request #318](https://github.com/bigchaindb/bigchaindb/pull/318)
- Overhauled `ROADMAP.md` and moved it to [the bigchaindb/org repository](https://github.com/bigchaindb/org): Pull Requests
- Overhauled `ROADMAP.md` and moved it to [the bigchaindb/org repository](https://github.com/bigchaindb/org): Pull Requests
[#282](https://github.com/bigchaindb/bigchaindb/pull/282),
[#306](https://github.com/bigchaindb/bigchaindb/pull/306),
[#308](https://github.com/bigchaindb/bigchaindb/pull/308),
@ -379,18 +1052,18 @@ committed: April 26, 2016, 11:09 AM GMT+2
- Ability to use environment variables to set (or partially set) configuration settings: [Pull Request #153](https://github.com/bigchaindb/bigchaindb/pull/153)
- `bigchaindb --export-my-pubkey`: [Pull Request #186](https://github.com/bigchaindb/bigchaindb/pull/186)
- `bigchaindb --version`, and one central source for the current version (`version.py`): [Pull Request #208](https://github.com/bigchaindb/bigchaindb/pull/208)
- AWS deployment scripts: Pull Requests
- AWS deployment scripts: Pull Requests
[#160](https://github.com/bigchaindb/bigchaindb/pull/160),
[#166](https://github.com/bigchaindb/bigchaindb/pull/166),
[#172](https://github.com/bigchaindb/bigchaindb/pull/172),
[#203](https://github.com/bigchaindb/bigchaindb/pull/203)
- `codecov.yml`: [Pull Request #161](https://github.com/bigchaindb/bigchaindb/pull/161)
- `CHANGELOG.md` (this file): [Pull Request #117](https://github.com/bigchaindb/bigchaindb/pull/117)
- Signatures using Ed25519: Pull Requests
- Signatures using Ed25519: Pull Requests
[#138](https://github.com/bigchaindb/bigchaindb/pull/138),
[#152](https://github.com/bigchaindb/bigchaindb/pull/152)
- Multisig support: [Pull Request #107](https://github.com/bigchaindb/bigchaindb/pull/107)
- HTTP Server & Web API: Pull Requests
- HTTP Server & Web API: Pull Requests
[#102](https://github.com/bigchaindb/bigchaindb/pull/102),
[#150](https://github.com/bigchaindb/bigchaindb/pull/150),
[#155](https://github.com/bigchaindb/bigchaindb/pull/155),
@ -409,7 +1082,7 @@ committed: April 26, 2016, 11:09 AM GMT+2
- Bug related to running the `bigchaindb-benchmark load` on docker [Pull Request #225](https://github.com/bigchaindb/bigchaindb/pull/225)
## External Contributors
- [@thedoctor](https://github.com/thedoctor): Pull Requests
- [@thedoctor](https://github.com/thedoctor): Pull Requests
[#99](https://github.com/bigchaindb/bigchaindb/pull/99),
[#136](https://github.com/bigchaindb/bigchaindb/pull/136)
- [@roderik](https://github.com/roderik): [Pull Request #162](https://github.com/bigchaindb/bigchaindb/pull/162)
@ -425,8 +1098,8 @@ committed: April 20, 2016, 3:31 PM GMT+2
## [0.1.4] - 2016-02-22
Tag name: v0.1.4
= commit: c4c850f480bc9ae72df2a54f81c0825b6fb4ed62
Tag name: v0.1.4
= commit: c4c850f480bc9ae72df2a54f81c0825b6fb4ed62
committed: Feb 22, 2016, 11:51 AM GMT+1
### Added
@ -447,8 +1120,8 @@ committed Feb 16, 2016, 11:37 AM GMT+1
## [0.1.2] - 2016-02-15
Tag name: v0.1.2
= commit d2ff24166d69dda68dd7b4a24a88279b1d37e222
Tag name: v0.1.2
= commit d2ff24166d69dda68dd7b4a24a88279b1d37e222
committed Feb 15, 2016, 2:23 PM GMT+1
### Added
@ -458,8 +1131,8 @@ committed Feb 15, 2016, 2:23 PM GMT+1
- Fix exception when running `start`: [Pull Request #32](https://github.com/bigchaindb/bigchaindb/pull/32) resolved [Issue #35]
## [0.1.1] - 2016-02-15
Tag name: v0.1.1
= commit 2a025448b29fe7056760de1039c73bbcfe992461
Tag name: v0.1.1
= commit 2a025448b29fe7056760de1039c73bbcfe992461
committed Feb 15, 2016, 10:48 AM GMT+1
### Added

View File

@ -1,3 +1,10 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
@ -35,7 +42,7 @@ This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior directed at yourself or another community member may be
reported by contacting a project maintainer at [conduct@bigchaindb.com](mailto:conduct@bigchaindb.com). All
reported by contacting a project maintainer at [contact@bigchaindb.com](mailto:contact@bigchaindb.com). All
complaints will be reviewed and investigated and will result in a response that
is appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an

View File

@ -1,153 +0,0 @@
# How to Contribute to the BigchainDB Project
There are many ways you can contribute to the BigchainDB project, some very easy and others more involved. We want to be friendly and welcoming to all potential contributors, so we ask that everyone involved abide by some simple guidelines outlined in our [Code of Conduct](./CODE_OF_CONDUCT.md).
## Easy Ways to Contribute
The BigchainDB community has a Google Group and a Gitter chatroom. Our [Community page](https://www.bigchaindb.com/community) has more information about those.
You can also follow us on Twitter [@BigchainDB](https://twitter.com/BigchainDB) or read [our blog on Medium](https://medium.com/the-bigchaindb-blog).
If you want to file a bug report, suggest a feature, or ask a code-related question, please go to the `bigchaindb/bigchaindb` repository on GitHub and [create a new Issue](https://github.com/bigchaindb/bigchaindb/issues/new). (You will need a [GitHub account](https://github.com/signup/free) (free).) Please describe the issue clearly, including steps to reproduce when it is a bug.
## How to Contribute Code or Documentation
### Step 0 - Decide on an Issue to Resolve, or Create One
We want you to feel like your contributions (pull requests) are welcome, but if you contribute something unnecessary, unwanted, or perplexing, then your experience may be unpleasant. Your pull request may sit gathering dust as everyone scratches their heads wondering what to do with it.
To prevent that situation, we ask that all pull requests should resolve, address, or fix an existing issue. If there is no existing issue, then you should create one first. That way there can be commentary and discussion first, and you can have a better idea of what to expect when you create a corresponding pull request.
When you submit a pull request, please mention the issue (or issues) that it resolves, e.g. "Resolves #123".
Exception: hotfixes and minor changes don't require a pre-existing issue, but please write a thorough pull request description.
### Step 1 - Prepare and Familiarize Yourself
To contribute code or documentation, you need a [GitHub account](https://github.com/signup/free).
Familiarize yourself with how we do coding and documentation in the BigchainDB project, including:
* [our Python Style Guide](PYTHON_STYLE_GUIDE.md) (includes how we write tests)
* [our documentation strategy](./docs/README.md) (including in-code documentation)
* the GitHub Flow (workflow)
* [GitHub Guide: Understanding the GitHub Flow](https://guides.github.com/introduction/flow/)
* [Scott Chacon's blog post about GitHub Flow](http://scottchacon.com/2011/08/31/github-flow.html)
* [semantic versioning](http://semver.org/)
### Step 2 - Install some Dependencies
* [Install RethinkDB Server](https://rethinkdb.com/docs/install/)
* Make sure you have Python 3.4+ (preferably in a virtualenv)
* [Install BigchaindB Server's OS-level dependencies](https://docs.bigchaindb.com/projects/server/en/latest/appendices/install-os-level-deps.html)
* [Make sure you have the latest Python 3 version of pip and setuptools](https://docs.bigchaindb.com/projects/server/en/latest/appendices/install-latest-pip.html)
### Step 3 - Fork bigchaindb on GitHub
In your web browser, go to [the BigchainDB repository on GitHub](https://github.com/bigchaindb/bigchaindb) and click the `Fork` button in the top right corner. This creates a new Git repository named `bigchaindb` in _your_ GitHub account.
### Step 4 - Clone Your Fork
(This only has to be done once.) In your local terminal, use Git to clone _your_ `bigchaindb` repository to your local computer. Also add the original GitHub bigchaindb/bigchaindb repository as a remote named `upstream` (a convention):
```text
git clone git@github.com:your-github-username/bigchaindb.git
cd bigchaindb
git remote add upstream git@github.com:bigchaindb/bigchaindb.git
```
### Step 5 - Fetch and Merge the Latest from `upstream/master`
Switch to the `master` branch locally, fetch all `upstream` branches, and merge the just-fetched `upstream/master` branch with the local `master` branch:
```text
git checkout master
git fetch upstream
git merge upstream/master
```
### Step 6 - Install the Python module and the CLI
In order to use and run the source you just cloned from your fork, you need to install BigchainDB on your computer.
The core of BigchainDB is a Python module you can install using the standard [Python packaging tools](http://python-packaging-user-guide.readthedocs.org/en/latest/).
We highly suggest you use `pip` and `virtualenv` to manage your local development.
If you need more information on how to do that, refer to the *Python Packaging User Guide* to [install `pip`](http://python-packaging-user-guide.readthedocs.org/en/latest/installing/#requirements-for-installing-packages) and to [create your first `virtualenv`](http://python-packaging-user-guide.readthedocs.org/en/latest/installing/#creating-virtual-environments).
Once you have `pip` installed and (optionally) you are in a virtualenv, go to the root of the repository (i.e. where the `setup.py` file is), and type:
```text
pip install -e .[dev]
```
This will install the BigchainDB Python module, the CLI, and all the dependencies useful for contributing to the development of BigchainDB.
How? Let's split the command down into its components:
- `pip` is the Python command to install packages
- `install` tells pip to use the *install* action
- `-e` installs a project in [editable mode](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs)
- `.` installs what's in the current directory
- `[dev]` adds some [extra requirements](https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies) to the installation. (If you are curious, open `setup.py` and look for `dev` in the `extras_require` section.)
Aside: An alternative to `pip install -e .[dev]` is `python setup.py develop`.
### Step 7 - Create a New Branch for Each Bug/Feature
If your new branch is to **fix a bug** identified in a specific GitHub Issue with number `ISSNO`, then name your new branch `bug/ISSNO/short-description-here`. For example, `bug/67/fix-leap-year-crash`.
If your new branch is to **add a feature** requested in a specific GitHub Issue with number `ISSNO`, then name your new branch `feat/ISSNO/short-description-here`. For example, `feat/135/blue-background-on-mondays`.
Otherwise, please give your new branch a short, descriptive, all-lowercase name.
```text
git checkout -b new-branch-name
```
### Step 8 - Make Edits, git add, git commit
With your new branch checked out locally, make changes or additions to the code or documentation. Remember to:
* follow [our Python Style Guide](PYTHON_STYLE_GUIDE.md).
* write and run tests for any new or changed code. There's a section in [our Python Style Guide](PYTHON_STYLE_GUIDE.md) about writing and running tests.
* add or update documentation as necessary. Follow [our documentation strategy](./docs/README.md).
As you go, git add and git commit your changes or additions, e.g.
```text
git add new-or-changed-file-1
git add new-or-changed-file-2
git commit -m "Short description of new or changed things"
```
You will want to merge changes from upstream (i.e. the original repository) into your new branch from time to time, using something like:
```text
git fetch upstream
git merge upstream/master
```
Once you're done commiting a set of new things and you're ready to submit them for inclusion, please be sure to run all the tests (as per the instructions at the end of our [Python Style Guide](PYTHON_STYLE_GUIDE.md)).
(When you submit your pull request [following the instructions below], we run all the tests automatically, so we will see if some are failing. If you don't know why some tests are failing, you can still submit your pull request, but be sure to note the failing tests and to ask for help with resolving them.)
### Step 9 - Push Your New Branch to origin
Make sure you've commited all the additions or changes you want to include in your pull request. Then push your new branch to origin (i.e. _your_ remote bigchaindb repository).
```text
git push origin new-branch-name
```
### Step 10 - Create a Pull Request
Go to the GitHub website and to _your_ remote bigchaindb repository (i.e. something like https://github.com/your-user-name/bigchaindb).
See [GitHub's documentation on how to initiate and send a pull request](https://help.github.com/articles/using-pull-requests/). Note that the destination repository should be `bigchaindb/bigchaindb` and the destination branch will be `master` (usually, and if it's not, then we can change that if necessary).
If this is the first time you've submitted a pull request to BigchainDB, then you must read and accept the Contributor License Agreement (CLA) before we can merge your contributions. That can be found at [https://www.bigchaindb.com/cla](https://www.bigchaindb.com/cla).
Once you accept and submit the CLA, we'll email you with further instructions. (We will send you a long random string to put in the comments section of your pull request, along with the text, "I have read and agree to the terms of the BigchainDB Contributor License Agreement.")
Someone will then merge your branch or suggest changes. If we suggest changes, you won't have to open a new pull request, you can just push new code to the same branch (on `origin`) as you did before creating the pull request.
## Quick Links
* [BigchainDB Community links](https://www.bigchaindb.com/community)
* [General GitHub Documentation](https://help.github.com/)
* [Code of Conduct](./CODE_OF_CONDUCT.md)
* [BigchainDB Licenses](./LICENSES.md)
* [Contributor License Agreement](https://www.bigchaindb.com/cla)
(Note: GitHub automatically links to CONTRIBUTING.md when a contributor creates an Issue or opens a Pull Request.)

View File

@ -1,36 +1,24 @@
FROM rethinkdb:2.3
# From http://stackoverflow.com/a/38553499
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-get -y install python3 python3-pip libffi-dev
RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools
FROM python:3.6
LABEL maintainer "contact@ipdb.global"
RUN mkdir -p /usr/src/app
COPY . /usr/src/app/
WORKDIR /usr/src/app
RUN apt-get -qq update \
&& apt-get -y upgrade \
&& apt-get install -y jq \
&& pip install . \
&& apt-get autoremove \
&& apt-get clean
RUN pip3 install --no-cache-dir -e .
WORKDIR /data
VOLUME ["/data", "/certs"]
ENV PYTHONUNBUFFERED 0
ENV BIGCHAINDB_CONFIG_PATH /data/.bigchaindb
ENV BIGCHAINDB_SERVER_BIND 0.0.0.0:9984
ENV BIGCHAINDB_API_ENDPOINT http://bigchaindb:9984/api/v1
ENTRYPOINT ["bigchaindb", "--dev-start-rethinkdb", "--dev-allow-temp-keypair"]
ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_ADVERTISED_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_PORT 9985
ENTRYPOINT ["bigchaindb"]
CMD ["start"]
EXPOSE 8080 9984 28015 29015

51
Dockerfile-all-in-one Normal file
View File

@ -0,0 +1,51 @@
FROM alpine:3.9
LABEL maintainer "contact@ipdb.global"
ARG TM_VERSION=v0.31.5
RUN mkdir -p /usr/src/app
ENV HOME /root
COPY . /usr/src/app/
WORKDIR /usr/src/app
RUN apk --update add sudo bash \
&& apk --update add python3 openssl ca-certificates git \
&& apk --update add --virtual build-dependencies python3-dev \
libffi-dev openssl-dev build-base jq \
&& apk add --no-cache libstdc++ dpkg gnupg \
&& pip3 install --upgrade pip cffi \
&& pip install -e . \
&& apk del build-dependencies \
&& rm -f /var/cache/apk/*
# Install mongodb and monit
RUN apk --update add mongodb monit
# Install Tendermint
RUN wget https://github.com/tendermint/tendermint/releases/download/${TM_VERSION}/tendermint_${TM_VERSION}_linux_amd64.zip \
&& unzip tendermint_${TM_VERSION}_linux_amd64.zip \
&& mv tendermint /usr/local/bin/ \
&& rm tendermint_${TM_VERSION}_linux_amd64.zip
ENV TMHOME=/tendermint
# Set permissions required for mongodb
RUN mkdir -p /data/db /data/configdb \
&& chown -R mongodb:mongodb /data/db /data/configdb
# BigchainDB enviroment variables
ENV BIGCHAINDB_DATABASE_PORT 27017
ENV BIGCHAINDB_DATABASE_BACKEND localmongodb
ENV BIGCHAINDB_SERVER_BIND 0.0.0.0:9984
ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_ADVERTISED_SCHEME ws
ENV BIGCHAINDB_TENDERMINT_PORT 26657
VOLUME /data/db /data/configdb /tendermint
EXPOSE 27017 28017 9984 9985 26656 26657 26658
WORKDIR $HOME
ENTRYPOINT ["/usr/src/app/pkg/scripts/all-in-one.bash"]

30
Dockerfile-alpine Normal file
View File

@ -0,0 +1,30 @@
FROM alpine:latest
LABEL maintainer "contact@ipdb.global"
RUN mkdir -p /usr/src/app
COPY . /usr/src/app/
WORKDIR /usr/src/app
RUN apk --update add sudo \
&& apk --update add python3 py-pip openssl ca-certificates git\
&& apk --update add --virtual build-dependencies python3-dev \
libffi-dev openssl-dev build-base \
&& apk add --no-cache libstdc++ \
&& pip3 install --upgrade pip cffi \
&& pip install -e . \
&& apk del build-dependencies \
&& rm -f /var/cache/apk/*
# When developing with Python in a docker container, we are using PYTHONBUFFERED
# to force stdin, stdout and stderr to be totally unbuffered and to capture logs/outputs
ENV PYTHONUNBUFFERED 0
ENV BIGCHAINDB_DATABASE_PORT 27017
ENV BIGCHAINDB_DATABASE_BACKEND $backend
ENV BIGCHAINDB_SERVER_BIND 0.0.0.0:9984
ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_ADVERTISED_SCHEME ws
ENV BIGCHAINDB_TENDERMINT_PORT 26657
ARG backend
RUN bigchaindb -y configure "$backend"

View File

@ -1,13 +1,35 @@
FROM python:3.5
ARG python_version=3.6
FROM python:${python_version}
LABEL maintainer "contact@ipdb.global"
RUN apt-get update
RUN apt-get update \
&& apt-get install -y git \
&& pip install -U pip \
&& apt-get autoremove \
&& apt-get clean
ARG backend
ARG abci_status
# When developing with Python in a docker container, we are using PYTHONBUFFERED
# to force stdin, stdout and stderr to be totally unbuffered and to capture logs/outputs
ENV PYTHONUNBUFFERED 0
ENV BIGCHAINDB_DATABASE_PORT 27017
ENV BIGCHAINDB_DATABASE_BACKEND $backend
ENV BIGCHAINDB_SERVER_BIND 0.0.0.0:9984
ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_SCHEME ws
ENV BIGCHAINDB_WSSERVER_ADVERTISED_HOST 0.0.0.0
ENV BIGCHAINDB_WSSERVER_ADVERTISED_SCHEME ws
ENV BIGCHAINDB_TENDERMINT_PORT 26657
ENV BIGCHAINDB_CI_ABCI ${abci_status}
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN pip install --upgrade pip
COPY . /usr/src/app/
RUN pip install --no-cache-dir -e .[dev]
WORKDIR /usr/src/app
RUN pip install -e .[dev]
RUN bigchaindb -y configure

View File

@ -1,53 +0,0 @@
# How to Handle Pull Requests
This document is for whoever has the ability to merge pull requests in the Git repositories associated with BigchainDB.
If the pull request is from an employee of ascribe GmbH, then you can ignore this document.
If the pull request is from someone who is _not_ an employee of ascribe, then:
* Have they agreed to the Individual Contributor Agreement in the past? (Troy, Greg, and others have a list.) If yes, then you can merge the PR and ignore the rest of this document.
* Do they belong to a company or organization which agreed to the Entity Contributor Agreement in the past, and will they be contributing on behalf of that company or organization? (Troy, Greg, and others have a list.) If yes, then you can merge the PR and ignore the rest of this document.
* Otherwise, go to the pull request in question and post a comment using this template:
Hi @nameofuser
Before we can merge this pull request, we need you or your organization to agree to one of our contributor agreements. One of the big concerns for people using and developing open source software is that someone who contributed to the code might claim the code infringes on their copyright or patent. To guard against this, we ask all our contributors to sign a Contributor License Agreement. This gives us the right to use the code contributed and any patents the contribution relies on. It also gives us and our users comfort that they won't be sued for using open source software. We know it's a hassle, but it makes the project more reliable in the long run. Thank you for your understanding and your contribution!
If you are contributing on behalf of yourself (and not on behalf of your employer or another organization you are part of) then you should:
1. Go to: https://www.bigchaindb.com/cla/
2. Read the Individual Contributor Agreement
3. Fill in the form "For Individuals"
4. Check the box to agree
5. Click the SEND button
If you're contributing as an employee, and/or you want all employees of your employing organization to be covered by our contributor agreement, then someone in your organization with the authority to enter agreements on behalf of all employees must do the following:
1. Go to: https://www.bigchaindb.com/cla/
2. Read the Entity Contributor Agreement
3. Fill in the form "For Organizations”
4. Check the box to agree
5. Click the SEND button
We will email you (or your employer) with further instructions.
(END OF COMMENT)
Once they click SEND, we (ascribe) will get an email with the information in the form. (Troy gets those emails for sure, I'm not sure who else.) The next step is to send an email to the email address submitted in the form, saying something like (where the stuff in [square brackets] should be replaced):
Hi [NAME],
The next step is for you to copy the following block of text into the comments of Pull Request #[NN] on GitHub:
BEGIN BLOCK
This is to confirm that I agreed to and accepted the BigchainDB [Entity/Individual] Contributor Agreement at https://www.bigchaindb.com/cla/ and to represent and warrant that I have authority to do so.
[Insert long random string here. One good source of those is https://www.grc.com/passwords.htm ]
END BLOCK
(END OF EMAIL)
The next step is to wait for them to copy that comment into the comments of the indicated pull request. Once they do so, it's safe to merge the pull request.

201
LICENSE Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,23 +1,24 @@
# Code Licenses
# Copyrights and Licenses
For all code in this repository, BigchainDB GmbH ("We") either:
## Copyrights
1. owns the copyright, or
2. owns the right to sublicense it (because all external contributors must agree to a Contributor License Agreement).
For all the code and documentation in this repository, the copyright is owned by one or more of the following:
Therefore We can choose how to license all the code in this repository. We can license it to Joe Xname under one license and Company Yname under a different license.
- BigchainDB GmbH
- A BigchainDB contributor who agreed to a BigchainDB Contributor License Agreement (CLA) with BigchainDB GmbH. (See [BEP-16](https://github.com/bigchaindb/BEPs/tree/master/16).)
- A BigchainDB contributor who signed off on the Developer Certificate of Origin (DCO) for all their contributions. (See [BEP-24](https://github.com/bigchaindb/BEPs/tree/master/24).)
- (Rarely, see the **Exceptions Section** below) A third pary who licensed the code in question under an open source license.
The two general options are:
## Code Licenses
1. You can get it under a commercial license for a fee. We can negotiate the terms of that license. It's not like we have some standard take-it-or-leave it commercial license. If you want to modify it and keep your modifications private, then that's certainly possible. Just ask.
2. You can get it under the AGPLv3 license for free. You don't even have to ask us. That's because all code in _this_ repository is licensed under the GNU Affero General Public License version 3 (AGPLv3), the full text of which can be found at [http://www.gnu.org/licenses/agpl.html](http://www.gnu.org/licenses/agpl.html).
All code in this repository, including short code snippets in the documentation, but not including the **Exceptions** noted below, is licensed under the Apache License, Version 2.0, the full text of which can be found at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
If you don't like the AGPL license, then just ignore it. It doesn't affect any other license.
For the licenses on all other BigchainDB-related code (i.e. in other repositories), see the LICENSE file in the associated repository.
All short code snippets embedded in the official BigchainDB _documentation_ are also licensed under the Apache License, Version 2.0, the full text of which can be found at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
## Documentation Licenses
For the licenses on all other BigchainDB-related code, see the LICENSE file in the associated repository.
The official BigchainDB documentation, _except for the short code snippets embedded within it_, is licensed under a Creative Commons Attribution 4.0 International license, the full text of which can be found at [http://creativecommons.org/licenses/by/4.0/legalcode](http://creativecommons.org/licenses/by/4.0/legalcode).
# Documentation Licenses
## Exceptions
The official BigchainDB documentation, _except for the short code snippets embedded within it_, is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license, the full text of which can be found at [http://creativecommons.org/licenses/by-sa/4.0/legalcode](http://creativecommons.org/licenses/by-sa/4.0/legalcode).
The contents of the `k8s/nginx-openresty/` directory are licensed as described in the `LICENSE.md` file in that directory.

142
Makefile Normal file
View File

@ -0,0 +1,142 @@
.PHONY: help run start stop logs test test-unit test-unit-watch test-acceptance cov doc doc-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test
.DEFAULT_GOAL := help
#############################
# Open a URL in the browser #
#############################
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
##################################
# Display help for this makefile #
##################################
define PRINT_HELP_PYSCRIPT
import re, sys
print("BigchainDB 2.0 developer toolbox")
print("--------------------------------")
print("Usage: make COMMAND")
print("")
print("Commands:")
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print(" %-16s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
##################
# Basic commands #
##################
DOCKER := docker
DC := docker-compose
BROWSER := python -c "$$BROWSER_PYSCRIPT"
HELP := python -c "$$PRINT_HELP_PYSCRIPT"
ECHO := /usr/bin/env echo
IS_DOCKER_COMPOSE_INSTALLED := $(shell command -v docker-compose 2> /dev/null)
################
# Main targets #
################
help: ## Show this help
@$(HELP) < $(MAKEFILE_LIST)
run: check-deps ## Run BigchainDB from source (stop it with ctrl+c)
# although bigchaindb has tendermint and mongodb in depends_on,
# launch them first otherwise tendermint will get stuck upon sending yet another log
# due to some docker-compose issue; does not happen when containers are run as daemons
@$(DC) up --no-deps mongodb tendermint bigchaindb
start: check-deps ## Run BigchainDB from source and daemonize it (stop with `make stop`)
@$(DC) up -d bigchaindb
stop: check-deps ## Stop BigchainDB
@$(DC) stop
logs: check-deps ## Attach to the logs
@$(DC) logs -f bigchaindb
test: check-deps test-unit test-acceptance ## Run unit and acceptance tests
test-unit: check-deps ## Run all tests once
@$(DC) up -d bdb
@$(DC) exec bigchaindb pytest
test-unit-watch: check-deps ## Run all tests and wait. Every time you change code, tests will be run again
@$(DC) run --rm --no-deps bigchaindb pytest -f
test-acceptance: check-deps ## Run all acceptance tests
@./run-acceptance-test.sh
cov: check-deps ## Check code coverage and open the result in the browser
@$(DC) run --rm bigchaindb pytest -v --cov=bigchaindb --cov-report html
$(BROWSER) htmlcov/index.html
doc: check-deps ## Generate HTML documentation and open it in the browser
@$(DC) run --rm --no-deps bdocs make -C docs/root html
$(BROWSER) docs/root/build/html/index.html
doc-acceptance: check-deps ## Create documentation for acceptance tests
@$(DC) run --rm python-acceptance pycco -i -s /src -d /docs
$(BROWSER) acceptance/python/docs/index.html
clean: clean-build clean-pyc clean-test ## Remove all build, test, coverage and Python artifacts
@$(ECHO) "Cleaning was successful."
reset: check-deps ## Stop and REMOVE all containers. WARNING: you will LOSE all data stored in BigchainDB.
@$(DC) down
release: dist ## package and upload a release
twine upload dist/*
dist: clean ## builds source (and not for now, wheel package)
python setup.py sdist
# python setup.py bdist_wheel
ls -l dist
###############
# Sub targets #
###############
check-deps:
ifndef IS_DOCKER_COMPOSE_INSTALLED
@$(ECHO) "Error: docker-compose is not installed"
@$(ECHO)
@$(ECHO) "You need docker-compose to run this command. Check out the official docs on how to install it in your system:"
@$(ECHO) "- https://docs.docker.com/compose/install/"
@$(ECHO)
@$(DC) # docker-compose is not installed, so we call it to generate an error and exit
endif
clean-build: # Remove build artifacts
@rm -fr build/
@rm -fr dist/
@rm -fr .eggs/
@find . -name '*.egg-info' -exec rm -fr {} +
@find . -name '*.egg' -exec rm -f {} +
clean-pyc: # Remove Python file artifacts
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
@find . -name '__pycache__' -exec rm -fr {} +
clean-test: # Remove test and coverage artifacts
@find . -name '.pytest_cache' -exec rm -fr {} +
@rm -fr .tox/
@rm -f .coverage
@rm -fr htmlcov/

View File

@ -1,3 +1,10 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Python Style Guide
This guide starts out with our general Python coding style guidelines and ends with a section on how we write & run (Python) tests.
@ -6,7 +13,10 @@ This guide starts out with our general Python coding style guidelines and ends w
Our starting point is [PEP8](https://www.python.org/dev/peps/pep-0008/), the standard "Style Guide for Python Code." Many Python IDEs will check your code against PEP8. (Note that PEP8 isn't frozen; it actually changes over time, but slowly.)
BigchainDB uses Python 3.4+, so you can ignore all PEP8 guidelines specific to Python 2.
BigchainDB uses Python 3.5+, so you can ignore all PEP8 guidelines specific to Python 2.
We use [pre-commit](http://pre-commit.com/) to check some of the rules below before every commit but not everything is realized yet.
The hooks we use can be found in the [.pre-commit-config.yaml](https://github.com/bigchaindb/bigchaindb/blob/master/.pre-commit-config.yaml) file.
### Python Docstrings
@ -47,8 +57,15 @@ It seems the preference is for slashes, but using parentheses is okay too. (Ther
If you need to `import` lots of names from a module or package, and they won't all fit in one line (without making the line too long), then use parentheses to spread the names across multiple lines, like so:
```python
from Tkinter import (
Tk, Frame, Button, Entry, Canvas, Text,
LEFT, DISABLED, NORMAL, RIDGE, END,
)
# Or
from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text,
LEFT, DISABLED, NORMAL, RIDGE, END)
LEFT, DISABLED, NORMAL, RIDGE, END)
```
For the rationale, see [PEP 328](https://www.python.org/dev/peps/pep-0328/#rationale-for-parentheses).
@ -65,7 +82,7 @@ x = 'name: {}; score: {}'.format(name, n)
we use the `format()` version. The [official Python documentation says](https://docs.python.org/2/library/stdtypes.html#str.format), "This method of string formatting is the new standard in Python 3, and should be preferred to the % formatting described in String Formatting Operations in new code."
## Runnng the Flake8 Style Checker
## Running the Flake8 Style Checker
We use [Flake8](http://flake8.pycqa.org/en/latest/index.html) to check our Python code style. Once you have it installed, you can run it using:
```text
@ -73,27 +90,8 @@ flake8 --max-line-length 119 bigchaindb/
```
## Writing and Running (Python) Unit Tests
## Writing and Running (Python) Tests
We write unit tests for our Python code using the [pytest](http://pytest.org/latest/) framework.
The content of this section was moved to [`bigchaindb/tests/README.md`](https://github.com/bigchaindb/bigchaindb/blob/master/tests/README.md).
All tests go in the `bigchaindb/tests` directory or one of its subdirectories. You can use the tests already in there as templates or examples.
You can run all unit tests using:
```text
py.test -v
```
or, if that doesn't work, try:
```text
python -m pytest -v
```
or:
```text
python setup.py test
```
If you want to learn about all the things you can do with pytest, see [the pytest documentation](http://pytest.org/latest/).
**Automated testing of pull requests.** We use [Travis CI](https://travis-ci.com/), so that whenever someone creates a new BigchainDB pull request on GitHub, Travis CI gets the new code and does _a bunch of stuff_. You can find out what we tell Travis CI to do in [the `.travis.yml` file](.travis.yml): it tells Travis CI how to install BigchainDB, how to run all the tests, and what to do "after success" (e.g. run `codecov`). (We use [Codecov](https://codecov.io/) to get a rough estimate of our test coverage.)
Note: We automatically run all tests on all pull requests (using Travis CI), so you should definitely run all tests locally before you submit a pull request. See the above-linked README file for instructions.

View File

@ -1,35 +1,70 @@
[![PyPI](https://img.shields.io/pypi/status/bigchaindb.svg?maxAge=2592000)](https://pypi.python.org/pypi/BigchainDB)
[![PyPI](https://img.shields.io/pypi/v/bigchaindb.svg)](https://pypi.python.org/pypi/BigchainDB)
[![Travis branch](https://img.shields.io/travis/bigchaindb/bigchaindb/master.svg)](https://travis-ci.org/bigchaindb/bigchaindb)
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
<!--- There is no shield to get the latest version
(including pre-release versions) from PyPI,
so show the latest GitHub release instead.
--->
[![Codecov branch](https://img.shields.io/codecov/c/github/bigchaindb/bigchaindb/master.svg)](https://codecov.io/github/bigchaindb/bigchaindb?branch=master)
[![Latest release](https://img.shields.io/github/release/bigchaindb/bigchaindb/all.svg)](https://github.com/bigchaindb/bigchaindb/releases)
[![Status on PyPI](https://img.shields.io/pypi/status/bigchaindb.svg)](https://pypi.org/project/BigchainDB/)
[![Travis branch](https://img.shields.io/travis/bigchaindb/bigchaindb/master.svg)](https://travis-ci.com/bigchaindb/bigchaindb)
[![Documentation Status](https://readthedocs.org/projects/bigchaindb-server/badge/?version=latest)](https://docs.bigchaindb.com/projects/server/en/latest/)
[![Join the chat at https://gitter.im/bigchaindb/bigchaindb](https://badges.gitter.im/bigchaindb/bigchaindb.svg)](https://gitter.im/bigchaindb/bigchaindb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# BigchainDB Server
BigchainDB is a scalable blockchain database. [The whitepaper](https://www.bigchaindb.com/whitepaper/) explains what that means.
BigchainDB is the blockchain database. This repository is for _BigchainDB Server_.
## Get Started with BigchainDB Server
## The Basics
### [Quickstart](https://docs.bigchaindb.com/projects/server/en/latest/quickstart.html)
### [Set Up & Run a Dev/Test Node](https://docs.bigchaindb.com/projects/server/en/latest/dev-and-test/setup-run-node.html)
### [Run BigchainDB Server with Docker](https://docs.bigchaindb.com/projects/server/en/latest/appendices/run-with-docker.html)
* [Try the Quickstart](https://docs.bigchaindb.com/projects/server/en/latest/quickstart.html)
* [Read the BigchainDB 2.0 whitepaper](https://www.bigchaindb.com/whitepaper/)
* [Check out the _Hitchiker's Guide to BigchainDB_](https://www.bigchaindb.com/developers/guide/)
## Run and Test BigchainDB Server from the `master` Branch
Running and testing the latest version of BigchainDB Server is easy. Make sure you have a recent version of [Docker Compose](https://docs.docker.com/compose/install/) installed. When you are ready, fire up a terminal and run:
```text
git clone https://github.com/bigchaindb/bigchaindb.git
cd bigchaindb
make run
```
BigchainDB should be reachable now on `http://localhost:9984/`.
There are also other commands you can execute:
* `make start`: Run BigchainDB from source and daemonize it (stop it with `make stop`).
* `make stop`: Stop BigchainDB.
* `make logs`: Attach to the logs.
* `make test`: Run all unit and acceptance tests.
* `make test-unit-watch`: Run all tests and wait. Every time you change code, tests will be run again.
* `make cov`: Check code coverage and open the result in the browser.
* `make doc`: Generate HTML documentation and open it in the browser.
* `make clean`: Remove all build, test, coverage and Python artifacts.
* `make reset`: Stop and REMOVE all containers. WARNING: you will LOSE all data stored in BigchainDB.
To view all commands available, run `make`.
## Links for Everyone
* [BigchainDB.com](https://www.bigchaindb.com/) - the main BigchainDB website, including newsletter signup
* [Whitepaper](https://www.bigchaindb.com/whitepaper/) - outlines the motivations, goals and core algorithms of BigchainDB
* [Roadmap](https://github.com/bigchaindb/org/blob/master/ROADMAP.md)
* [Blog](https://medium.com/the-bigchaindb-blog)
* [Twitter](https://twitter.com/BigchainDB)
* [Google Group](https://groups.google.com/forum/#!forum/bigchaindb)
## Links for Developers
* [All BigchainDB Documentation](https://docs.bigchaindb.com/en/latest/)
* [BigchainDB Server Documentation](https://docs.bigchaindb.com/projects/server/en/latest/index.html)
* [CONTRIBUTING.md](CONTRIBUTING.md) - how to contribute
* [CONTRIBUTING.md](.github/CONTRIBUTING.md) - how to contribute
* [Community guidelines](CODE_OF_CONDUCT.md)
* [Open issues](https://github.com/bigchaindb/bigchaindb/issues)
* [Open pull requests](https://github.com/bigchaindb/bigchaindb/pulls)

77
README_cn.md Normal file
View File

@ -0,0 +1,77 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
<!--- There is no shield to get the latest version
(including pre-release versions) from PyPI,
so show the latest GitHub release instead.
--->
[![Codecov branch](https://img.shields.io/codecov/c/github/bigchaindb/bigchaindb/master.svg)](https://codecov.io/github/bigchaindb/bigchaindb?branch=master)
[![Latest release](https://img.shields.io/github/release/bigchaindb/bigchaindb/all.svg)](https://github.com/bigchaindb/bigchaindb/releases)
[![Status on PyPI](https://img.shields.io/pypi/status/bigchaindb.svg)](https://pypi.org/project/BigchainDB/)
[![Travis branch](https://img.shields.io/travis/bigchaindb/bigchaindb/master.svg)](https://travis-ci.com/bigchaindb/bigchaindb)
[![Documentation Status](https://readthedocs.org/projects/bigchaindb-server/badge/?version=latest)](https://docs.bigchaindb.com/projects/server/en/latest/)
[![Join the chat at https://gitter.im/bigchaindb/bigchaindb](https://badges.gitter.im/bigchaindb/bigchaindb.svg)](https://gitter.im/bigchaindb/bigchaindb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# BigchainDB 服务器
BigchainDB 是区块链数据库. 这是 _BigchainDB 服务器_ 的仓库.
## 基础知识
* [尝试快速开始](https://docs.bigchaindb.com/projects/server/en/latest/quickstart.html)
* [阅读 BigchainDB 2.0 白皮书](https://www.bigchaindb.com/whitepaper/)
* [查阅漫游指南](https://www.bigchaindb.com/developers/guide/)
## 运行和测试 `master` 分支的 BigchainDB 服务器
运行和测试最新版本的 BigchainDB 服务器非常简单. 确认你有安装最新版本的 [Docker Compose](https://docs.docker.com/compose/install/). 当你准备好了, 打开一个终端并运行:
```text
git clone https://github.com/bigchaindb/bigchaindb.git
cd bigchaindb
make run
```
BigchainDB 应该可以通过 `http://localhost:9984/` 访问.
这里也有一些其他的命令你可以运行:
* `make start`: 通过源码和守护进程的方式运行 BigchainDB (通过 `make stop` 停止).
* `make stop`: 停止运行 BigchainDB.
* `make logs`: 附在日志上.
* `make test`: 运行所有单元和验收测试.
* `make test-unit-watch`: 运行所有测试并等待. 每次更改代码时都会再次运行测试.
* `make cov`: 检查代码覆盖率并在浏览器中打开结果.
* `make doc`: 生成 HTML 文档并在浏览器中打开它.
* `make clean`: 删除所有构建, 测试, 覆盖和 Python 生成物.
* `make reset`: 停止并移除所有容器. 警告: 您将丢失存储在 BigchainDB 中的所有数据.
查看所有可用命令, 请运行 `make`.
## 一般人员链接
* [BigchainDB.com](https://www.bigchaindb.com/) - BigchainDB 主网站, 包括新闻订阅
* [路线图](https://github.com/bigchaindb/org/blob/master/ROADMAP.md)
* [博客](https://medium.com/the-bigchaindb-blog)
* [推特](https://twitter.com/BigchainDB)
## 开发人员链接
* [所有的 BigchainDB 文档](https://docs.bigchaindb.com/en/latest/)
* [BigchainDB 服务器 文档](https://docs.bigchaindb.com/projects/server/en/latest/index.html)
* [CONTRIBUTING.md](.github/CONTRIBUTING.md) - how to contribute
* [社区指南](CODE_OF_CONDUCT.md)
* [公开问题](https://github.com/bigchaindb/bigchaindb/issues)
* [公开的 pull request](https://github.com/bigchaindb/bigchaindb/pulls)
* [Gitter 聊天室](https://gitter.im/bigchaindb/bigchaindb)
## 法律声明
* [许可](LICENSES.md) - 开源代码 & 开源内容
* [印记](https://www.bigchaindb.com/imprint/)
* [联系我们](https://www.bigchaindb.com/contact/)

65
README_kor.md Normal file
View File

@ -0,0 +1,65 @@
[![Codecov branch](https://img.shields.io/codecov/c/github/bigchaindb/bigchaindb/master.svg)](https://codecov.io/github/bigchaindb/bigchaindb?branch=master)
[![Latest release](https://img.shields.io/github/release/bigchaindb/bigchaindb/all.svg)](https://github.com/bigchaindb/bigchaindb/releases)
[![Status on PyPI](https://img.shields.io/pypi/status/bigchaindb.svg)](https://pypi.org/project/BigchainDB/)
[![Travis branch](https://img.shields.io/travis/bigchaindb/bigchaindb/master.svg)](https://travis-ci.org/bigchaindb/bigchaindb)
[![Documentation Status](https://readthedocs.org/projects/bigchaindb-server/badge/?version=latest)](https://docs.bigchaindb.com/projects/server/en/latest/)
[![Join the chat at https://gitter.im/bigchaindb/bigchaindb](https://badges.gitter.im/bigchaindb/bigchaindb.svg)](https://gitter.im/bigchaindb/bigchaindb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# BigchainDB 서버
BigchaingDB는 블록체인 데이터베이스입니다. 이 저장소는 _BigchaingDB 서버_를 위한 저장소입니다.
### 기본 사항
* [빠른 시작 사용해보기](https://docs.bigchaindb.com/projects/server/en/latest/quickstart.html)
* [BigchainDB 2.0 백서 읽기](https://www.bigchaindb.com/whitepaper/)
* [BigchainDB에 대한 _Hitchiker's Guide_를 확인십시오.](https://www.bigchaindb.com/developers/guide/)
### `master` Branch에서 BigchainDB 서버 실행 및 테스트
BigchaingDB 서버의 최신 버전을 실행하고 테스트하는 것은 어렵지 않습니다. [Docker Compose](https://docs.docker.com/compose/install/)의 최신 버전이 설치되어 있는지 확인하십시오. 준비가 되었다면, 터미널에서 다음을 실행하십시오.
```text
git clone https://github.com/bigchaindb/bigchaindb.git
cd bigchaindb
make run
```
이제 BigchainDB는 `http://localhost:9984/`에 연결되어야 합니다.
또한, 실행시키기 위한 다른 명령어들도 있습니다.
* `make start` : 소스로부터 BigchainDB를 실행하고 데몬화합니다. \(이는 `make stop` 을 하면 중지합니다.\)
* `make stop` : BigchainDB를 중지합니다.
* `make logs` : 로그에 첨부합니다.
* `make text` : 모든 유닛과 허가 테스트를 실행합니다.
* `make test-unit-watch` : 모든 테스트를 수행하고 기다립니다. 코드를 변경할 때마다 테스트는 다시 실행될 것입니다.
* `make cov` : 코드 커버리지를 확인하고 브라우저에서 결과를 엽니다.
* `make doc` : HTML 문서를 만들고, 브라우저에서 엽니다.
* `make clean` : 모든 빌드와 테스트, 커버리지 및 파이썬 아티팩트를 제거합니다.
* `make reset` : 모든 컨테이너들을 중지하고 제거합니다. 경고 : BigchainDB에 저장된 모든 데이터를 잃을 수 있습니다.
사용 가능한 모든 명령어를 보기 위해서는 `make` 를 실행하십시오.
### 모두를 위한 링크들
* [BigchainDB.com ](https://www.bigchaindb.com/)- 뉴스 레터 가입을 포함하는 BigchainDB 주요 웹 사이트
* [로드맵](https://github.com/bigchaindb/org/blob/master/ROADMAP.md)
* [블로그](https://medium.com/the-bigchaindb-blog)
* [트위터](https://twitter.com/BigchainDB)
### 개발자들을 위한 링크들
* [모든 BigchainDB 문서](https://docs.bigchaindb.com/en/latest/)
* [BigchainDB 서버 문서](https://docs.bigchaindb.com/projects/server/en/latest/index.html)
* [CONTRIBUTING.md](https://github.com/bigchaindb/bigchaindb/blob/master/.github/CONTRIBUTING.md) - 기여를 하는 방법
* [커뮤니티 가이드라인](https://github.com/bigchaindb/bigchaindb/blob/master/CODE_OF_CONDUCT.md)
* [이슈 작성](https://github.com/bigchaindb/bigchaindb/issues)
* [pull request 하기](https://github.com/bigchaindb/bigchaindb/pulls)
* [Gitter 채팅방](https://gitter.im/bigchaindb/bigchaindb)
### 합법
* [라이선스](https://github.com/bigchaindb/bigchaindb/blob/master/LICENSES.md) - 오픈 소스 & 오픈 콘텐츠
* [발행](https://www.bigchaindb.com/imprint/)
* [연락처](https://www.bigchaindb.com/contact/)

101
RELEASE_PROCESS.md Normal file
View File

@ -0,0 +1,101 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Our Release Process
## Notes
BigchainDB follows
[the Python form of Semantic Versioning](https://packaging.python.org/tutorials/distributing-packages/#choosing-a-versioning-scheme)
(i.e. MAJOR.MINOR.PATCH),
which is almost identical
to [regular semantic versioning](http://semver.org/), but there's no hyphen, e.g.
- `0.9.0` for a typical final release
- `4.5.2a1` not `4.5.2-a1` for the first Alpha release
- `3.4.5rc2` not `3.4.5-rc2` for Release Candidate 2
**Note 1:** For Git tags (which are used to identify releases on GitHub), we append a `v` in front. For example, the Git tag for version `2.0.0a1` was `v2.0.0a1`.
**Note 2:** For Docker image tags (e.g. on Docker Hub), we use longer version names for Alpha, Beta and Release Candidate releases. For example, the Docker image tag for version `2.0.0a2` was `2.0.0-alpha2`.
We use `0.9` and `0.9.0` as example version and short-version values below. You should replace those with the correct values for your new version.
We follow [BEP-1](https://github.com/bigchaindb/BEPs/tree/master/1), which is our variant of C4, the Collective Code Construction Contract, so a release is just a [tagged commit](https://git-scm.com/book/en/v2/Git-Basics-Tagging) on the `master` branch, i.e. a label for a particular Git commit.
The following steps are what we do to release a new version of _BigchainDB Server_. The steps to release the Python Driver are similar but not the same.
## Steps
1. Create a pull request where you make the following changes:
- Update `CHANGELOG.md`
- Update all Docker image tags in all Kubernetes YAML files (in the `k8s/` directory).
For example, in the files:
- `k8s/bigchaindb/bigchaindb-ss.yaml` and
- `k8s/dev-setup/bigchaindb.yaml`
find the line of the form `image: bigchaindb/bigchaindb:0.8.1` and change the version number to the new version number, e.g. `0.9.0`. (This is the Docker image that Kubernetes should pull from Docker Hub.)
Keep in mind that this is a _Docker image tag_ so our naming convention is
a bit different; see Note 2 in the **Notes** section above.
- In `bigchaindb/version.py`:
- update `__version__` to e.g. `0.9.0` (with no `.dev` on the end)
- update `__short_version__` to e.g. `0.9` (with no `.dev` on the end)
- In the docs about installing BigchainDB (and Tendermint), and in the associated scripts, recommend/install a version of Tendermint that _actually works_ with the soon-to-be-released version of BigchainDB. You can find all such references by doing a search for the previously-recommended version number, such as `0.31.5`.
- In `setup.py`, _maybe_ update the development status item in the `classifiers` list. For example, one allowed value is `"Development Status :: 5 - Production/Stable"`. The [allowed values are listed at pypi.python.org](https://pypi.python.org/pypi?%3Aaction=list_classifiers).
2. **Wait for all the tests to pass!**
3. Merge the pull request into the `master` branch.
4. Go to the [bigchaindb/bigchaindb Releases page on GitHub](https://github.com/bigchaindb/bigchaindb/releases)
and click the "Draft a new release" button.
5. Fill in the details:
- **Tag version:** version number preceded by `v`, e.g. `v0.9.1`
- **Target:** the last commit that was just merged. In other words, that commit will get a Git tag with the value given for tag version above.
- **Title:** Same as tag version above, e.g `v0.9.1`
- **Description:** The body of the changelog entry (Added, Changed, etc.)
6. Click "Publish release" to publish the release on GitHub.
7. On your local computer, make sure you're on the `master` branch and that it's up-to-date with the `master` branch in the bigchaindb/bigchaindb repository (e.g. `git pull upstream master`). We're going to use that to push a new `bigchaindb` package to PyPI.
8. Make sure you have a `~/.pypirc` file containing credentials for PyPI.
9. Do `make release` to build and publish the new `bigchaindb` package on PyPI. For this step you need to have `twine` installed. If you get an error like `Makefile:135: recipe for target 'clean-pyc' failed` then try doing
```text
sudo chown -R $(whoami):$(whoami) .
```
10. [Log in to readthedocs.org](https://readthedocs.org/accounts/login/) and go to the **BigchainDB Server** project, then:
- Click on "Builds", select "latest" from the drop-down menu, then click the "Build Version:" button.
- Wait for the build of "latest" to finish. This can take a few minutes.
- Go to Admin --> Advanced Settings
and make sure that "Default branch:" (i.e. what "latest" points to)
is set to the new release's tag, e.g. `v0.9.1`.
(It won't be an option if you didn't wait for the build of "latest" to finish.)
Then scroll to the bottom and click "Save".
- Go to Admin --> Versions
and under **Choose Active Versions**, do these things:
1. Make sure that the new version's tag is "Active" and "Public"
2. Make sure the **stable** branch is _not_ active.
3. Scroll to the bottom of the page and click "Save".
11. Go to [Docker Hub](https://hub.docker.com/) and sign in, then:
- Click on "Organizations"
- Click on "bigchaindb"
- Click on "bigchaindb/bigchaindb"
- Click on "Build Settings"
- Find the row where "Docker Tag Name" equals `latest`
and change the value of "Name" to the name (Git tag)
of the new release, e.g. `v0.9.0`.
- If the release is an Alpha, Beta or Release Candidate release,
then a new row must be added.
You can do that by clicking the green "+" (plus) icon.
The contents of the new row should be similar to the existing rows
of previous releases like that.
- Click on "Tags"
- Delete the "latest" tag (so we can rebuild it)
- Click on "Build Settings" again
- Click on the "Trigger" button for the "latest" tag and make sure it worked by clicking on "Tags" again
- If the release is an Alpha, Beta or Release Candidate release,
then click on the "Trigger" button for that tag as well.
Congratulations, you have released a new version of BigchainDB Server!

View File

@ -1,3 +1,10 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# BigchainDB Roadmap
We moved the BigchainDB Roadmap to the bigchaindb/org repository; see:

View File

@ -1,24 +0,0 @@
# Our Release Process
This is a summary of the steps we go through to release a new version of BigchainDB Server.
1. Run `python docs/server/generate_schema_documentation.py` and commit the changes in `docs/server/source/schema/`, if any.
1. Update the `CHANGELOG.md` file
1. Update the version numbers in `bigchaindb/version.py`. Note that we try to use [semantic versioning](http://semver.org/) (i.e. MAJOR.MINOR.PATCH)
1. Go to the [bigchaindb/bigchaindb Releases page on GitHub](https://github.com/bigchaindb/bigchaindb/releases)
and click the "Draft a new release" button
1. Name the tag something like v0.7.0
1. The target should be a specific commit: the one when the update of `bigchaindb/version.py` got merged into master
1. The release title should be something like v0.7.0
1. The description should be copied from the `CHANGELOG.md` file updated above
1. Generate and send the latest `bigchaindb` package to PyPI. Dimi and Sylvain can do this, maybe others
1. Login to readthedocs.org as a maintainer of the BigchainDB Server docs.
Go to Admin --> Versions and under **Choose Active Versions**, make sure that the new version's tag is
"Active" and "Public"
After the release:
1. Update `bigchaindb/version.py` again, to be something like 0.8.0.dev (with a dev on the end).
This is so people reading the latest docs will know that they're for the latest (master branch)
version of BigchainDB Server, not the docs at the time of the most recent release (which are also
available).

27
acceptance/README.md Normal file
View File

@ -0,0 +1,27 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Acceptance test suite
This directory contains the acceptance test suite for BigchainDB.
The suite uses Docker Compose to set up a single BigchainDB node, run all tests, and finally stop the node. In the future we will add support for a four node network setup.
## Running the tests
It should be as easy as `make test-acceptance`.
Note that `make test-acceptance` will take some time to start the node and shutting it down. If you are developing a test, or you wish to run a specific test in the acceptance test suite, first start the node with `make start`. After the node is running, you can run `pytest` inside the `python-acceptance` container with:
```bash
docker-compose run --rm python-acceptance pytest <use whatever option you need>
```
## Writing and documenting the tests
Tests are sometimes difficult to read. For acceptance tests, we try to be really explicit on what the test is doing, so please write code that is *simple* and easy to understand. We decided to use literate-programming documentation. To generate the documentation run:
```bash
make doc-acceptance
```

1
acceptance/python/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
docs

View File

@ -0,0 +1,9 @@
FROM python:3.6.3
RUN mkdir -p /src
RUN pip install --upgrade \
pycco \
websocket-client~=0.47.0 \
pytest~=3.0 \
bigchaindb-driver~=0.6.2 \
blns

View File

@ -0,0 +1,125 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Basic Acceptance Test
# Here we check that the primitives of the system behave as expected.
# As you will see, this script tests basic stuff like:
#
# - create a transaction
# - check if the transaction is stored
# - check for the outputs of a given public key
# - transfer the transaction to another key
#
# We run a series of checks for each steps, that is retrieving the transaction from
# the remote system, and also checking the `outputs` of a given public key.
#
# This acceptance test is a rip-off of our
# [tutorial](https://docs.bigchaindb.com/projects/py-driver/en/latest/usage.html).
# ## Imports
# We need some utils from the `os` package, we will interact with
# env variables.
import os
# For this test case we import and use the Python Driver.
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
def test_basic():
# ## Set up a connection to BigchainDB
# To use BighainDB we need a connection. Here we create one. By default we
# connect to localhost, but you can override this value using the env variable
# called `BIGCHAINDB_ENDPOINT`, a valid value must include the schema:
# `https://example.com:9984`
bdb = BigchainDB(os.environ.get('BIGCHAINDB_ENDPOINT'))
# ## Create keypairs
# This test requires the interaction between two actors with their own keypair.
# The two keypairs will be called—drum roll—Alice and Bob.
alice, bob = generate_keypair(), generate_keypair()
# ## Alice registers her bike in BigchainDB
# Alice has a nice bike, and here she creates the "digital twin"
# of her bike.
bike = {'data': {'bicycle': {'serial_number': 420420}}}
# She prepares a `CREATE` transaction...
prepared_creation_tx = bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
asset=bike)
# ... and she fulfills it with her private key.
fulfilled_creation_tx = bdb.transactions.fulfill(
prepared_creation_tx,
private_keys=alice.private_key)
# We will use the `id` of this transaction several time, so we store it in
# a variable with a short and easy name
bike_id = fulfilled_creation_tx['id']
# Now she is ready to send it to the BigchainDB Network.
sent_transfer_tx = bdb.transactions.send_commit(fulfilled_creation_tx)
# And just to be 100% sure, she also checks if she can retrieve
# it from the BigchainDB node.
assert bdb.transactions.retrieve(bike_id), 'Cannot find transaction {}'.format(bike_id)
# Alice is now the proud owner of one unspent asset.
assert len(bdb.outputs.get(alice.public_key, spent=False)) == 1
assert bdb.outputs.get(alice.public_key)[0]['transaction_id'] == bike_id
# ## Alice transfers her bike to Bob
# After registering her bike, Alice is ready to transfer it to Bob.
# She needs to create a new `TRANSFER` transaction.
# A `TRANSFER` transaction contains a pointer to the original asset. The original asset
# is identified by the `id` of the `CREATE` transaction that defined it.
transfer_asset = {'id': bike_id}
# Alice wants to spend the one and only output available, the one with index `0`.
output_index = 0
output = fulfilled_creation_tx['outputs'][output_index]
# Here, she defines the `input` of the `TRANSFER` transaction. The `input` contains
# several keys:
#
# - `fulfillment`, taken from the previous `CREATE` transaction.
# - `fulfills`, that specifies which condition she is fulfilling.
# - `owners_before`.
transfer_input = {'fulfillment': output['condition']['details'],
'fulfills': {'output_index': output_index,
'transaction_id': fulfilled_creation_tx['id']},
'owners_before': output['public_keys']}
# Now that all the elements are set, she creates the actual transaction...
prepared_transfer_tx = bdb.transactions.prepare(
operation='TRANSFER',
asset=transfer_asset,
inputs=transfer_input,
recipients=bob.public_key)
# ... and signs it with her private key.
fulfilled_transfer_tx = bdb.transactions.fulfill(
prepared_transfer_tx,
private_keys=alice.private_key)
# She finally sends the transaction to a BigchainDB node.
sent_transfer_tx = bdb.transactions.send_commit(fulfilled_transfer_tx)
# And just to be 100% sure, she also checks if she can retrieve
# it from the BigchainDB node.
assert bdb.transactions.retrieve(fulfilled_transfer_tx['id']) == sent_transfer_tx
# Now Alice has zero unspent transactions.
assert len(bdb.outputs.get(alice.public_key, spent=False)) == 0
# While Bob has one.
assert len(bdb.outputs.get(bob.public_key, spent=False)) == 1
# Bob double checks what he got was the actual bike.
bob_tx_id = bdb.outputs.get(bob.public_key, spent=False)[0]['transaction_id']
assert bdb.transactions.retrieve(bob_tx_id) == sent_transfer_tx

View File

@ -0,0 +1,181 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Divisible assets integration testing
# This test checks if we can successfully divide assets.
# The script tests various things like:
#
# - create a transaction with a divisible asset and issue them to someone
# - check if the transaction is stored and has the right amount of tokens
# - spend some tokens
# - try to spend more tokens than available
#
# We run a series of checks for each step, that is retrieving
# the transaction from the remote system, and also checking the `amount`
# of a given transaction.
#
# This integration test is a rip-off of our
# [tutorial](https://docs.bigchaindb.com/projects/py-driver/en/latest/usage.html).
# ## Imports
# We need some utils from the `os` package, we will interact with
# env variables.
# We need the `pytest` package to catch the `BadRequest` exception properly.
# And of course, we also need the `BadRequest`.
import os
import pytest
from bigchaindb_driver.exceptions import BadRequest
# For this test case we import and use the Python Driver.
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
def test_divisible_assets():
# ## Set up a connection to BigchainDB
# Check [test_basic.py](./test_basic.html) to get some more details
# about the endpoint.
bdb = BigchainDB(os.environ.get('BIGCHAINDB_ENDPOINT'))
# Oh look, it is Alice again and she brought her friend Bob along.
alice, bob = generate_keypair(), generate_keypair()
# ## Alice creates a time sharing token
# Alice wants to go on vacation, while Bobs bike just broke down.
# Alice decides to rent her bike to Bob while she is gone.
# So she prepares a `CREATE` transaction to issues 10 tokens.
# First, she prepares an asset for a time sharing token. As you can see in
# the description, Bob and Alice agree that each token can be used to ride
# the bike for one hour.
bike_token = {
'data': {
'token_for': {
'bike': {
'serial_number': 420420
}
},
'description': 'Time share token. Each token equals one hour of riding.',
},
}
# She prepares a `CREATE` transaction and issues 10 tokens.
# Here, Alice defines in a tuple that she wants to assign
# these 10 tokens to Bob.
prepared_token_tx = bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
recipients=[([bob.public_key], 10)],
asset=bike_token)
# She fulfills and sends the transaction.
fulfilled_token_tx = bdb.transactions.fulfill(
prepared_token_tx,
private_keys=alice.private_key)
bdb.transactions.send_commit(fulfilled_token_tx)
# We store the `id` of the transaction to use it later on.
bike_token_id = fulfilled_token_tx['id']
# Let's check if the transaction was successful.
assert bdb.transactions.retrieve(bike_token_id), \
'Cannot find transaction {}'.format(bike_token_id)
# Bob owns 10 tokens now.
assert bdb.transactions.retrieve(bike_token_id)['outputs'][0][
'amount'] == '10'
# ## Bob wants to use the bike
# Now that Bob got the tokens and the sun is shining, he wants to get out
# with the bike for three hours.
# To use the bike he has to send the tokens back to Alice.
# To learn about the details of transferring a transaction check out
# [test_basic.py](./test_basic.html)
transfer_asset = {'id': bike_token_id}
output_index = 0
output = fulfilled_token_tx['outputs'][output_index]
transfer_input = {'fulfillment': output['condition']['details'],
'fulfills': {'output_index': output_index,
'transaction_id': fulfilled_token_tx[
'id']},
'owners_before': output['public_keys']}
# To use the tokens Bob has to reassign 7 tokens to himself and the
# amount he wants to use to Alice.
prepared_transfer_tx = bdb.transactions.prepare(
operation='TRANSFER',
asset=transfer_asset,
inputs=transfer_input,
recipients=[([alice.public_key], 3), ([bob.public_key], 7)])
# He signs and sends the transaction.
fulfilled_transfer_tx = bdb.transactions.fulfill(
prepared_transfer_tx,
private_keys=bob.private_key)
sent_transfer_tx = bdb.transactions.send_commit(fulfilled_transfer_tx)
# First, Bob checks if the transaction was successful.
assert bdb.transactions.retrieve(
fulfilled_transfer_tx['id']) == sent_transfer_tx
# There are two outputs in the transaction now.
# The first output shows that Alice got back 3 tokens...
assert bdb.transactions.retrieve(
fulfilled_transfer_tx['id'])['outputs'][0]['amount'] == '3'
# ... while Bob still has 7 left.
assert bdb.transactions.retrieve(
fulfilled_transfer_tx['id'])['outputs'][1]['amount'] == '7'
# ## Bob wants to ride the bike again
# It's been a week and Bob wants to right the bike again.
# Now he wants to ride for 8 hours, that's a lot Bob!
# He prepares the transaction again.
transfer_asset = {'id': bike_token_id}
# This time we need an `output_index` of 1, since we have two outputs
# in the `fulfilled_transfer_tx` we created before. The first output with
# index 0 is for Alice and the second output is for Bob.
# Since Bob wants to spend more of his tokens he has to provide the
# correct output with the correct amount of tokens.
output_index = 1
output = fulfilled_transfer_tx['outputs'][output_index]
transfer_input = {'fulfillment': output['condition']['details'],
'fulfills': {'output_index': output_index,
'transaction_id': fulfilled_transfer_tx['id']},
'owners_before': output['public_keys']}
# This time Bob only provides Alice in the `recipients` because he wants
# to spend all his tokens
prepared_transfer_tx = bdb.transactions.prepare(
operation='TRANSFER',
asset=transfer_asset,
inputs=transfer_input,
recipients=[([alice.public_key], 8)])
fulfilled_transfer_tx = bdb.transactions.fulfill(
prepared_transfer_tx,
private_keys=bob.private_key)
# Oh Bob, what have you done?! You tried to spend more tokens than you had.
# Remember Bob, last time you spent 3 tokens already,
# so you only have 7 left.
with pytest.raises(BadRequest) as error:
bdb.transactions.send_commit(fulfilled_transfer_tx)
# Now Bob gets an error saying that the amount he wanted to spent is
# higher than the amount of tokens he has left.
assert error.value.args[0] == 400
message = 'Invalid transaction (AmountError): The amount used in the ' \
'inputs `7` needs to be same as the amount used in the ' \
'outputs `8`'
assert error.value.args[2]['message'] == message
# We have to stop this test now, I am sorry, but Bob is pretty upset
# about his mistake. See you next time :)

View File

@ -0,0 +1,48 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Double Spend testing
# This test challenge the system with double spends.
import os
from uuid import uuid4
from threading import Thread
import queue
import bigchaindb_driver.exceptions
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
def test_double_create():
bdb = BigchainDB(os.environ.get('BIGCHAINDB_ENDPOINT'))
alice = generate_keypair()
results = queue.Queue()
tx = bdb.transactions.fulfill(
bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
asset={'data': {'uuid': str(uuid4())}}),
private_keys=alice.private_key)
def send_and_queue(tx):
try:
bdb.transactions.send_commit(tx)
results.put('OK')
except bigchaindb_driver.exceptions.TransportError as e:
results.put('FAIL')
t1 = Thread(target=send_and_queue, args=(tx, ))
t2 = Thread(target=send_and_queue, args=(tx, ))
t1.start()
t2.start()
results = [results.get(timeout=2), results.get(timeout=2)]
assert results.count('OK') == 1
assert results.count('FAIL') == 1

View File

@ -0,0 +1,126 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Multiple owners integration testing
# This test checks if we can successfully create and transfer a transaction
# with multiple owners.
# The script tests various things like:
#
# - create a transaction with multiple owners
# - check if the transaction is stored and has the right amount of public keys
# - transfer the transaction to a third person
#
# We run a series of checks for each step, that is retrieving
# the transaction from the remote system, and also checking the public keys
# of a given transaction.
#
# This integration test is a rip-off of our
# [tutorial](https://docs.bigchaindb.com/projects/py-driver/en/latest/usage.html).
# ## Imports
# We need some utils from the `os` package, we will interact with
# env variables.
import os
# For this test case we import and use the Python Driver.
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
def test_multiple_owners():
# ## Set up a connection to BigchainDB
# Check [test_basic.py](./test_basic.html) to get some more details
# about the endpoint.
bdb = BigchainDB(os.environ.get('BIGCHAINDB_ENDPOINT'))
# Hey Alice and Bob, nice to see you again!
alice, bob = generate_keypair(), generate_keypair()
# ## Alice and Bob create a transaction
# Alice and Bob just moved into a shared flat, no one can afford these
# high rents anymore. Bob suggests to get a dish washer for the
# kitchen. Alice agrees and here they go, creating the asset for their
# dish washer.
dw_asset = {
'data': {
'dish washer': {
'serial_number': 1337
}
}
}
# They prepare a `CREATE` transaction. To have multiple owners, both
# Bob and Alice need to be the recipients.
prepared_dw_tx = bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
recipients=(alice.public_key, bob.public_key),
asset=dw_asset)
# Now they both sign the transaction by providing their private keys.
# And send it afterwards.
fulfilled_dw_tx = bdb.transactions.fulfill(
prepared_dw_tx,
private_keys=[alice.private_key, bob.private_key])
bdb.transactions.send_commit(fulfilled_dw_tx)
# We store the `id` of the transaction to use it later on.
dw_id = fulfilled_dw_tx['id']
# Let's check if the transaction was successful.
assert bdb.transactions.retrieve(dw_id), \
'Cannot find transaction {}'.format(dw_id)
# The transaction should have two public keys in the outputs.
assert len(
bdb.transactions.retrieve(dw_id)['outputs'][0]['public_keys']) == 2
# ## Alice and Bob transfer a transaction to Carol.
# Alice and Bob save a lot of money living together. They often go out
# for dinner and don't cook at home. But now they don't have any dishes to
# wash, so they decide to sell the dish washer to their friend Carol.
# Hey Carol, nice to meet you!
carol = generate_keypair()
# Alice and Bob prepare the transaction to transfer the dish washer to
# Carol.
transfer_asset = {'id': dw_id}
output_index = 0
output = fulfilled_dw_tx['outputs'][output_index]
transfer_input = {'fulfillment': output['condition']['details'],
'fulfills': {'output_index': output_index,
'transaction_id': fulfilled_dw_tx[
'id']},
'owners_before': output['public_keys']}
# Now they create the transaction...
prepared_transfer_tx = bdb.transactions.prepare(
operation='TRANSFER',
asset=transfer_asset,
inputs=transfer_input,
recipients=carol.public_key)
# ... and sign it with their private keys, then send it.
fulfilled_transfer_tx = bdb.transactions.fulfill(
prepared_transfer_tx,
private_keys=[alice.private_key, bob.private_key])
sent_transfer_tx = bdb.transactions.send_commit(fulfilled_transfer_tx)
# They check if the transaction was successful.
assert bdb.transactions.retrieve(
fulfilled_transfer_tx['id']) == sent_transfer_tx
# The owners before should include both Alice and Bob.
assert len(
bdb.transactions.retrieve(fulfilled_transfer_tx['id'])['inputs'][0][
'owners_before']) == 2
# While the new owner is Carol.
assert bdb.transactions.retrieve(fulfilled_transfer_tx['id'])[
'outputs'][0]['public_keys'][0] == carol.public_key

View File

@ -0,0 +1,101 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# ## Testing potentially hazardous strings
# This test uses a library of `naughty` strings (code injections, weird unicode chars., etc.) as both keys and values.
# We look for either a successful tx, or in the case that we use a naughty string as a key, and it violates some key
# constraints, we expect to receive a well formatted error message.
# ## Imports
# We need some utils from the `os` package, we will interact with
# env variables.
import os
# Since the naughty strings get encoded and decoded in odd ways,
# we'll use a regex to sweep those details under the rug.
import re
# We'll use a nice library of naughty strings...
from blns import blns
# And parameterize our test so each one is treated as a separate test case
import pytest
# For this test case we import and use the Python Driver.
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
from bigchaindb_driver.exceptions import BadRequest
naughty_strings = blns.all()
# This is our base test case, but we'll reuse it to send naughty strings as both keys and values.
def send_naughty_tx(asset, metadata):
# ## Set up a connection to BigchainDB
# Check [test_basic.py](./test_basic.html) to get some more details
# about the endpoint.
bdb = BigchainDB(os.environ.get('BIGCHAINDB_ENDPOINT'))
# Here's Alice.
alice = generate_keypair()
# Alice is in a naughty mood today, so she creates a tx with some naughty strings
prepared_transaction = bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
asset=asset,
metadata=metadata)
# She fulfills the transaction
fulfilled_transaction = bdb.transactions.fulfill(
prepared_transaction,
private_keys=alice.private_key)
# The fulfilled tx gets sent to the BDB network
try:
sent_transaction = bdb.transactions.send_commit(fulfilled_transaction)
except BadRequest as e:
sent_transaction = e
# If her key contained a '.', began with a '$', or contained a NUL character
regex = '.*\..*|\$.*|.*\x00.*'
key = next(iter(metadata))
if re.match(regex, key):
# Then she expects a nicely formatted error code
status_code = sent_transaction.status_code
error = sent_transaction.error
regex = (
r'\{\s*\n*'
r'\s*"message":\s*"Invalid transaction \(ValidationError\):\s*'
r'Invalid key name.*The key name cannot contain characters.*\n*'
r'\s*"status":\s*400\n*'
r'\s*\}\n*')
assert status_code == 400
assert re.fullmatch(regex, error), sent_transaction
# Otherwise, she expects to see her transaction in the database
elif 'id' in sent_transaction.keys():
tx_id = sent_transaction['id']
assert bdb.transactions.retrieve(tx_id)
# If neither condition was true, then something weird happened...
else:
raise TypeError(sent_transaction)
@pytest.mark.parametrize("naughty_string", naughty_strings, ids=naughty_strings)
def test_naughty_keys(naughty_string):
asset = {'data': {naughty_string: 'nice_value'}}
metadata = {naughty_string: 'nice_value'}
send_naughty_tx(asset, metadata)
@pytest.mark.parametrize("naughty_string", naughty_strings, ids=naughty_strings)
def test_naughty_values(naughty_string):
asset = {'data': {'nice_key': naughty_string}}
metadata = {'nice_key': naughty_string}
send_naughty_tx(asset, metadata)

View File

@ -0,0 +1,132 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Stream Acceptance Test
# This test checks if the event stream works correctly. The basic idea of this
# test is to generate some random **valid** transaction, send them to a
# BigchainDB node, and expect those transactions to be returned by the valid
# transactions Stream API. During this test, two threads work together,
# sharing a queue to exchange events.
#
# - The *main thread* first creates and sends the transactions to BigchainDB;
# then it run through all events in the shared queue to check if all
# transactions sent have been validated by BigchainDB.
# - The *listen thread* listens to the events coming from BigchainDB and puts
# them in a queue shared with the main thread.
import os
import queue
import json
from threading import Thread, Event
from uuid import uuid4
# For this script, we need to set up a websocket connection, that's the reason
# we import the
# [websocket](https://github.com/websocket-client/websocket-client) module
from websocket import create_connection
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
def test_stream():
# ## Set up the test
# We use the env variable `BICHAINDB_ENDPOINT` to know where to connect.
# Check [test_basic.py](./test_basic.html) for more information.
BDB_ENDPOINT = os.environ.get('BIGCHAINDB_ENDPOINT')
# *That's pretty bad, but let's do like this for now.*
WS_ENDPOINT = 'ws://{}:9985/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
bdb = BigchainDB(BDB_ENDPOINT)
# Hello to Alice again, she is pretty active in those tests, good job
# Alice!
alice = generate_keypair()
# We need few variables to keep the state, specifically we need `sent` to
# keep track of all transactions Alice sent to BigchainDB, while `received`
# are the transactions BigchainDB validated and sent back to her.
sent = []
received = queue.Queue()
# In this test we use a websocket. The websocket must be started **before**
# sending transactions to BigchainDB, otherwise we might lose some
# transactions. The `ws_ready` event is used to synchronize the main thread
# with the listen thread.
ws_ready = Event()
# ## Listening to events
# This is the function run by the complementary thread.
def listen():
# First we connect to the remote endpoint using the WebSocket protocol.
ws = create_connection(WS_ENDPOINT)
# After the connection has been set up, we can signal the main thread
# to proceed (continue reading, it should make sense in a second.)
ws_ready.set()
# It's time to consume all events coming from the BigchainDB stream API.
# Every time a new event is received, it is put in the queue shared
# with the main thread.
while True:
result = ws.recv()
received.put(result)
# Put `listen` in a thread, and start it. Note that `listen` is a local
# function and it can access all variables in the enclosing function.
t = Thread(target=listen, daemon=True)
t.start()
# ## Pushing the transactions to BigchainDB
# After starting the listen thread, we wait for it to connect, and then we
# proceed.
ws_ready.wait()
# Here we prepare, sign, and send ten different `CREATE` transactions. To
# make sure each transaction is different from the other, we generate a
# random `uuid`.
for _ in range(10):
tx = bdb.transactions.fulfill(
bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
asset={'data': {'uuid': str(uuid4())}}),
private_keys=alice.private_key)
# We don't want to wait for each transaction to be in a block. By using
# `async` mode, we make sure that the driver returns as soon as the
# transaction is pushed to the BigchainDB API. Remember: we expect all
# transactions to be in the shared queue: this is a two phase test,
# first we send a bunch of transactions, then we check if they are
# valid (and, in this case, they should).
bdb.transactions.send_async(tx)
# The `id` of every sent transaction is then stored in a list.
sent.append(tx['id'])
# ## Check the valid transactions coming from BigchainDB
# Now we are ready to check if BigchainDB did its job. A simple way to
# check if all sent transactions have been processed is to **remove** from
# `sent` the transactions we get from the *listen thread*. At one point in
# time, `sent` should be empty, and we exit the test.
while sent:
# To avoid waiting forever, we have an arbitrary timeout of 5
# seconds: it should be enough time for BigchainDB to create
# blocks, in fact a new block is created every second. If we hit
# the timeout, then game over ¯\\\_(ツ)\_/¯
try:
event = received.get(timeout=5)
txid = json.loads(event)['transaction_id']
except queue.Empty:
assert False, 'Did not receive all expected transactions'
# Last thing is to try to remove the `txid` from the set of sent
# transactions. If this test is running in parallel with others, we
# might get a transaction id of another test, and `remove` can fail.
# It's OK if this happens.
try:
sent.remove(txid)
except ValueError:
pass

View File

@ -1,3 +0,0 @@
# Benchmarking tests
This folder contains util files and test case folders to benchmark the performance of a BigchainDB federation.

View File

@ -1,152 +0,0 @@
import multiprocessing as mp
import uuid
import json
import argparse
import csv
import time
import logging
import rethinkdb as r
from os.path import expanduser
from bigchaindb.common.transaction import Transaction
from bigchaindb import Bigchain
from bigchaindb.util import ProcessGroup
from bigchaindb.commands import utils
SIZE_OF_FILLER = {'minimal': 0,
'small': 10**3,
'medium': 10**4,
'large': 10**5}
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def create_write_transaction(tx_left, payload_filler):
b = Bigchain()
payload_dict = {}
if payload_filler:
payload_dict['filler'] = payload_filler
while tx_left > 0:
# Include a random uuid string in the payload to prevent duplicate
# transactions (i.e. transactions with the same hash)
payload_dict['msg'] = str(uuid.uuid4())
tx = Transaction.create([b.me], [b.me], payload=payload_dict)
tx = tx.sign([b.me_private])
b.write_transaction(tx)
tx_left -= 1
def run_add_backlog(args):
tx_left = args.num_transactions // mp.cpu_count()
payload_filler = 'x' * SIZE_OF_FILLER[args.payload_size]
workers = ProcessGroup(target=create_write_transaction,
args=(tx_left, payload_filler))
workers.start()
def run_set_statsd_host(args):
with open(expanduser('~') + '/.bigchaindb', 'r') as f:
conf = json.load(f)
conf['statsd']['host'] = args.statsd_host
with open(expanduser('~') + '/.bigchaindb', 'w') as f:
json.dump(conf, f)
def run_gather_metrics(args):
# setup a rethinkdb connection
conn = r.connect(args.bigchaindb_host, 28015, 'bigchain')
# setup csv writer
csv_file = open(args.csvfile, 'w')
csv_writer = csv.writer(csv_file)
# query for the number of transactions on the backlog
num_transactions = r.table('backlog').count().run(conn)
num_transactions_received = 0
initial_time = None
logger.info('Starting gathering metrics. {} transasctions in the backlog'.format(num_transactions))
logger.info('This process should exit automatically. '
'If this does not happen you can exit at any time using Ctrl-C'
' saving all the metrics gathered up to this point.')
logger.info('\t{:<20} {:<20} {:<20} {:<20}'.format('timestamp', 'tx in block',
'tx/s', '% complete'))
# listen to the changefeed
try:
for change in r.table('bigchain').changes().run(conn):
# check only for new blocks
if change['old_val'] is None:
block_num_transactions = len(change['new_val']['block']['transactions'])
time_now = time.time()
csv_writer.writerow([str(time_now), str(block_num_transactions)])
# log statistics
if initial_time is None:
initial_time = time_now
num_transactions_received += block_num_transactions
elapsed_time = time_now - initial_time
percent_complete = round((num_transactions_received / num_transactions) * 100)
if elapsed_time != 0:
transactions_per_second = round(num_transactions_received / elapsed_time)
else:
transactions_per_second = float('nan')
logger.info('\t{:<20} {:<20} {:<20} {:<20}'.format(time_now, block_num_transactions,
transactions_per_second, percent_complete))
if (num_transactions - num_transactions_received) == 0:
break
except KeyboardInterrupt:
logger.info('Interrupted. Exiting early...')
finally:
# close files
csv_file.close()
def main():
parser = argparse.ArgumentParser(description='BigchainDB benchmarking utils')
subparsers = parser.add_subparsers(title='Commands', dest='command')
# add transactions to backlog
backlog_parser = subparsers.add_parser('add-backlog',
help='Add transactions to the backlog')
backlog_parser.add_argument('num_transactions', metavar='num_transactions',
type=int, default=0,
help='Number of transactions to add to the backlog')
backlog_parser.add_argument('-s', '--payload-size',
choices=SIZE_OF_FILLER.keys(),
default='minimal',
help='Payload size')
# set statsd host
statsd_parser = subparsers.add_parser('set-statsd-host',
help='Set statsd host')
statsd_parser.add_argument('statsd_host', metavar='statsd_host', default='localhost',
help='Hostname of the statsd server')
# metrics
metrics_parser = subparsers.add_parser('gather-metrics',
help='Gather metrics to a csv file')
metrics_parser.add_argument('-b', '--bigchaindb-host',
required=True,
help='Bigchaindb node hostname to connect to gather cluster metrics')
metrics_parser.add_argument('-c', '--csvfile',
required=True,
help='Filename to save the metrics')
utils.start(parser, globals())
if __name__ == '__main__':
main()

View File

@ -1,54 +0,0 @@
from __future__ import with_statement, unicode_literals
from fabric.api import sudo, env, hosts
from fabric.api import task, parallel
from fabric.contrib.files import sed
from fabric.operations import run, put
from fabric.context_managers import settings
from hostlist import public_dns_names
from ssh_key import ssh_key_path
# Ignore known_hosts
# http://docs.fabfile.org/en/1.10/usage/env.html#disable-known-hosts
env.disable_known_hosts = True
# What remote servers should Fabric connect to? With what usernames?
env.user = 'ubuntu'
env.hosts = public_dns_names
# SSH key files to try when connecting:
# http://docs.fabfile.org/en/1.10/usage/env.html#key-filename
env.key_filename = ssh_key_path
@task
@parallel
def put_benchmark_utils():
put('benchmark_utils.py')
@task
@parallel
def set_statsd_host(statsd_host='localhost'):
run('python3 benchmark_utils.py set-statsd-host {}'.format(statsd_host))
print('update configuration')
run('bigchaindb show-config')
@task
@parallel
def prepare_backlog(num_transactions=10000):
run('python3 benchmark_utils.py add-backlog {}'.format(num_transactions))
@task
@parallel
def start_bigchaindb():
run('screen -d -m bigchaindb start &', pty=False)
@task
@parallel
def kill_bigchaindb():
run('killall bigchaindb')

View File

@ -1,21 +0,0 @@
# Transactions per second
Measure how many blocks per second are created on the _bigchain_ with a pre filled backlog.
1. Deploy an aws cluster https://docs.bigchaindb.com/projects/server/en/latest/clusters-feds/aws-testing-cluster.html
2. Make a symbolic link to hostlist.py: `ln -s ../deploy-cluster-aws/hostlist.py .`
3. Make a symbolic link to bigchaindb.pem:
```bash
mkdir pem
cd pem
ln -s ../deploy-cluster-aws/pem/bigchaindb.pem .
```
Then:
```bash
fab put_benchmark_utils
fab set_statsd_host:<hostname of the statsd server>
fab prepare_backlog:<num txs per node> # wait for process to finish
fab start_bigchaindb
```

View File

@ -1,22 +1,27 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Overview
A high-level description of the files and subdirectories of BigchainDB.
There are three database tables which underpin BigchainDB: `backlog`, where incoming transactions are held temporarily until they can be consumed; `bigchain`, where blocks of transactions are written permanently; and `votes`, where votes are written permanently. It is the votes in the `votes` table which must be queried to determine block validity and order. For more in-depth explanation, see [the whitepaper](https://www.bigchaindb.com/whitepaper/).
## Files
### [`core.py`](./core.py)
### [`lib.py`](lib.py)
The `Bigchain` class is defined here. Most operations outlined in the [whitepaper](https://www.bigchaindb.com/whitepaper/) as well as database interactions are found in this file. This is the place to start if you are interested in implementing a server API, since many of these class methods concern BigchainDB interacting with the outside world.
The `BigchainDB` class is defined here. Most node-level operations and database interactions are found in this file. This is the place to start if you are interested in implementing a server API, since many of these class methods concern BigchainDB interacting with the outside world.
### [`models.py`](./models.py)
`Block`, `Transaction`, and `Asset` classes are defined here. The classes mirror the block and transaction structure from the [documentation](https://docs.bigchaindb.com/projects/server/en/latest/topic-guides/models.html), but also include methods for validation and signing.
`Block`, `Transaction`, and `Asset` classes are defined here. The classes mirror the block and transaction structure from the [documentation](https://docs.bigchaindb.com/projects/server/en/latest/data-models/index.html), but also include methods for validation and signing.
### [`consensus.py`](./config_utils.py)
### [`validation.py`](./validation.py)
Base class for consensus methods (verification of votes, blocks, and transactions). The actual logic is mostly found in `transaction` and `block` models, defined in [`models.py`](./models.py).
Base class for validation methods (verification of votes, blocks, and transactions). The actual logic is mostly found in `transaction` and `block` models, defined in [`models.py`](./models.py).
### [`processes.py`](./processes.py)
@ -26,16 +31,8 @@ Entry point for the BigchainDB process, after initialization. All subprocesses
Methods for managing the configuration, including loading configuration files, automatically generating the configuration, and keeping the configuration consistent across BigchainDB instances.
### [`monitor.py`](./monitor.py)
Code for monitoring speed of various processes in BigchainDB via `statsd` and Grafana. [See documentation.](https://docs.bigchaindb.com/projects/server/en/latest/clusters-feds/monitoring.html)
## Folders
### [`pipelines`](./pipelines)
Structure and implementation of various subprocesses started in [`processes.py`](./processes.py).
### [`commands`](./commands)
Contains code for the [CLI](https://docs.bigchaindb.com/projects/server/en/latest/server-reference/bigchaindb-cli.html) for BigchainDB.

View File

@ -1,41 +1,106 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import copy
import os
import logging
from bigchaindb.log import DEFAULT_LOGGING_CONFIG as log_config
from bigchaindb.lib import BigchainDB # noqa
from bigchaindb.migrations.chain_migration_election import ChainMigrationElection
from bigchaindb.version import __version__ # noqa
from bigchaindb.core import App # noqa
# from functools import reduce
# PORT_NUMBER = reduce(lambda x, y: x * y, map(ord, 'BigchainDB')) % 2**16
# basically, the port number is 9984
# The following variable is used by `bigchaindb configure` to
# prompt the user for database values. We cannot rely on
# _base_database_localmongodb.keys() because dicts are unordered.
# I tried to configure
_database_keys_map = {
'localmongodb': ('host', 'port', 'name'),
}
_base_database_localmongodb = {
'host': 'localhost',
'port': 27017,
'name': 'bigchain',
'replicaset': None,
'login': None,
'password': None,
}
_database_localmongodb = {
'backend': 'localmongodb',
'connection_timeout': 5000,
'max_tries': 3,
'ssl': False,
'ca_cert': None,
'certfile': None,
'keyfile': None,
'keyfile_passphrase': None,
'crlfile': None,
}
_database_localmongodb.update(_base_database_localmongodb)
_database_map = {
'localmongodb': _database_localmongodb,
}
config = {
'server': {
# Note: this section supports all the Gunicorn settings:
# - http://docs.gunicorn.org/en/stable/settings.html
'bind': os.environ.get('BIGCHAINDB_SERVER_BIND') or 'localhost:9984',
'workers': None, # if none, the value will be cpu_count * 2 + 1
'threads': None, # if none, the value will be cpu_count * 2 + 1
'bind': 'localhost:9984',
'loglevel': logging.getLevelName(
log_config['handlers']['console']['level']).lower(),
'workers': None, # if None, the value will be cpu_count * 2 + 1
},
'database': {
'host': os.environ.get('BIGCHAINDB_DATABASE_HOST', 'localhost'),
'port': 28015,
'name': 'bigchain',
},
'keypair': {
'public': None,
'private': None,
},
'keyring': [],
'statsd': {
'wsserver': {
'scheme': 'ws',
'host': 'localhost',
'port': 8125,
'rate': 0.01,
'port': 9985,
'advertised_scheme': 'ws',
'advertised_host': 'localhost',
'advertised_port': 9985,
},
'tendermint': {
'host': 'localhost',
'port': 26657,
'version': 'v0.31.5', # look for __tm_supported_versions__
},
# FIXME: hardcoding to localmongodb for now
'database': _database_map['localmongodb'],
'log': {
'file': log_config['handlers']['file']['filename'],
'error_file': log_config['handlers']['errors']['filename'],
'level_console': logging.getLevelName(
log_config['handlers']['console']['level']).lower(),
'level_logfile': logging.getLevelName(
log_config['handlers']['file']['level']).lower(),
'datefmt_console': log_config['formatters']['console']['datefmt'],
'datefmt_logfile': log_config['formatters']['file']['datefmt'],
'fmt_console': log_config['formatters']['console']['format'],
'fmt_logfile': log_config['formatters']['file']['format'],
'granular_levels': {},
},
'api_endpoint': os.environ.get('BIGCHAINDB_API_ENDPOINT') or 'http://localhost:9984/api/v1',
'backlog_reassign_delay': 120
}
# We need to maintain a backup copy of the original config dict in case
# the user wants to reconfigure the node. Check ``bigchaindb.config_utils``
# for more info.
_config = copy.deepcopy(config)
from bigchaindb.core import Bigchain # noqa
from bigchaindb.version import __version__ # noqa
from bigchaindb.common.transaction import Transaction # noqa
from bigchaindb import models # noqa
from bigchaindb.upsert_validator import ValidatorElection # noqa
from bigchaindb.elections.vote import Vote # noqa
Transaction.register_type(Transaction.CREATE, models.Transaction)
Transaction.register_type(Transaction.TRANSFER, models.Transaction)
Transaction.register_type(ValidatorElection.OPERATION, ValidatorElection)
Transaction.register_type(ChainMigrationElection.OPERATION, ChainMigrationElection)
Transaction.register_type(Vote.OPERATION, Vote)

View File

@ -0,0 +1,51 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Backend Interfaces
## Structure
- [`connection.py`](./connection.py): Database connection-related interfaces
- [`query.py`](./query.py): Database query-related interfaces, dispatched through single-dispatch
- [`schema.py`](./schema.py): Database setup and schema-related interfaces, dispatched through
single-dispatch
Built-in implementations (e.g. [MongoDB's](./localmongodb)) are provided in sub-directories and
have their connection type's location exposed as `BACKENDS` in [`connection.py`](./connection.py).
## Single-Dispatched Interfaces
The architecture of this module is based heavily upon Python's newly-introduced [single-dispatch
generic functions](https://www.python.org/dev/peps/pep-0443/). Single-dispatch is convenient,
because it allows Python, rather than something we design ourselves, to manage the dispatching of
generic functions based on certain conditions being met (e.g. the database backend to use).
To see what this looks like in BigchainDB, first note that our backend interfaces have been
configured to dispatch based on a backend's **connection type**.
Call `bigchaindb.backend.connect()` to create an instance of a `Connection`:
```python
from bigchaindb.backend import connect
connection = connect() # By default, uses the current configuration for backend, host, port, etc.
```
Then, we can call a backend function by directly calling its interface:
```python
from bigchaindb.backend import query
query.write_transaction(connection, ...)
```
Notice that we don't need to care about which backend implementation to use or how to access it.
Code can simply call the base interface function with a `Connection` instance, and single-dispatch
will handle routing the call to the actual implementation.
BigchainDB will load and register the configured backend's implementation automatically (see
`bigchaindb.backend.connect()`), so you should always just be able to call an interface function if
you have a `Connection` instance. A few helper utilities (see [`backend/utils.py`](./utils.py)) are
also provided to make registering new backend implementations easier.

View File

@ -0,0 +1,17 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Generic backend database interfaces expected by BigchainDB.
The interfaces in this module allow BigchainDB to be agnostic about its
database backend. One can configure BigchainDB to use different databases as
its data store by setting the ``database.backend`` property in the
configuration or the ``BIGCHAINDB_DATABASE_BACKEND`` environment variable.
"""
# Include the backend interfaces
from bigchaindb.backend import schema, query # noqa
from bigchaindb.backend.connection import connect # noqa

View File

@ -0,0 +1,170 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import logging
from importlib import import_module
from itertools import repeat
import bigchaindb
from bigchaindb.backend.exceptions import ConnectionError
from bigchaindb.backend.utils import get_bigchaindb_config_value, get_bigchaindb_config_value_or_key_error
from bigchaindb.common.exceptions import ConfigurationError
BACKENDS = {
'localmongodb': 'bigchaindb.backend.localmongodb.connection.LocalMongoDBConnection',
}
logger = logging.getLogger(__name__)
def connect(backend=None, host=None, port=None, name=None, max_tries=None,
connection_timeout=None, replicaset=None, ssl=None, login=None, password=None,
ca_cert=None, certfile=None, keyfile=None, keyfile_passphrase=None,
crlfile=None):
"""Create a new connection to the database backend.
All arguments default to the current configuration's values if not
given.
Args:
backend (str): the name of the backend to use.
host (str): the host to connect to.
port (int): the port to connect to.
name (str): the name of the database to use.
replicaset (str): the name of the replica set (only relevant for
MongoDB connections).
Returns:
An instance of :class:`~bigchaindb.backend.connection.Connection`
based on the given (or defaulted) :attr:`backend`.
Raises:
:exc:`~ConnectionError`: If the connection to the database fails.
:exc:`~ConfigurationError`: If the given (or defaulted) :attr:`backend`
is not supported or could not be loaded.
:exc:`~AuthenticationError`: If there is a OperationFailure due to
Authentication failure after connecting to the database.
"""
backend = backend or get_bigchaindb_config_value_or_key_error('backend')
host = host or get_bigchaindb_config_value_or_key_error('host')
port = port or get_bigchaindb_config_value_or_key_error('port')
dbname = name or get_bigchaindb_config_value_or_key_error('name')
# Not sure how to handle this here. This setting is only relevant for
# mongodb.
# I added **kwargs for both RethinkDBConnection and MongoDBConnection
# to handle these these additional args. In case of RethinkDBConnection
# it just does not do anything with it.
#
# UPD: RethinkDBConnection is not here anymore cause we no longer support RethinkDB.
# The problem described above might be reconsidered next time we introduce a backend,
# if it ever happens.
replicaset = replicaset or get_bigchaindb_config_value('replicaset')
ssl = ssl if ssl is not None else get_bigchaindb_config_value('ssl', False)
login = login or get_bigchaindb_config_value('login')
password = password or get_bigchaindb_config_value('password')
ca_cert = ca_cert or get_bigchaindb_config_value('ca_cert')
certfile = certfile or get_bigchaindb_config_value('certfile')
keyfile = keyfile or get_bigchaindb_config_value('keyfile')
keyfile_passphrase = keyfile_passphrase or get_bigchaindb_config_value('keyfile_passphrase', None)
crlfile = crlfile or get_bigchaindb_config_value('crlfile')
try:
module_name, _, class_name = BACKENDS[backend].rpartition('.')
Class = getattr(import_module(module_name), class_name)
except KeyError:
raise ConfigurationError('Backend `{}` is not supported. '
'BigchainDB currently supports {}'.format(backend, BACKENDS.keys()))
except (ImportError, AttributeError) as exc:
raise ConfigurationError('Error loading backend `{}`'.format(backend)) from exc
logger.debug('Connection: {}'.format(Class))
return Class(host=host, port=port, dbname=dbname,
max_tries=max_tries, connection_timeout=connection_timeout,
replicaset=replicaset, ssl=ssl, login=login, password=password,
ca_cert=ca_cert, certfile=certfile, keyfile=keyfile,
keyfile_passphrase=keyfile_passphrase, crlfile=crlfile)
class Connection:
"""Connection class interface.
All backend implementations should provide a connection class that inherits
from and implements this class.
"""
def __init__(self, host=None, port=None, dbname=None,
connection_timeout=None, max_tries=None,
**kwargs):
"""Create a new :class:`~.Connection` instance.
Args:
host (str): the host to connect to.
port (int): the port to connect to.
dbname (str): the name of the database to use.
connection_timeout (int, optional): the milliseconds to wait
until timing out the database connection attempt.
Defaults to 5000ms.
max_tries (int, optional): how many tries before giving up,
if 0 then try forever. Defaults to 3.
**kwargs: arbitrary keyword arguments provided by the
configuration's ``database`` settings
"""
dbconf = bigchaindb.config['database']
self.host = host or dbconf['host']
self.port = port or dbconf['port']
self.dbname = dbname or dbconf['name']
self.connection_timeout = connection_timeout if connection_timeout is not None \
else dbconf['connection_timeout']
self.max_tries = max_tries if max_tries is not None else dbconf['max_tries']
self.max_tries_counter = range(self.max_tries) if self.max_tries != 0 else repeat(0)
self._conn = None
@property
def conn(self):
if self._conn is None:
self.connect()
return self._conn
def run(self, query):
"""Run a query.
Args:
query: the query to run
Raises:
:exc:`~DuplicateKeyError`: If the query fails because of a
duplicate key constraint.
:exc:`~OperationFailure`: If the query fails for any other
reason.
:exc:`~ConnectionError`: If the connection to the database
fails.
"""
raise NotImplementedError()
def connect(self):
"""Try to connect to the database.
Raises:
:exc:`~ConnectionError`: If the connection to the database
fails.
"""
attempt = 0
for i in self.max_tries_counter:
attempt += 1
try:
self._conn = self._connect()
except ConnectionError as exc:
logger.warning('Attempt %s/%s. Connection to %s:%s failed after %sms.',
attempt, self.max_tries if self.max_tries != 0 else '',
self.host, self.port, self.connection_timeout)
if attempt == self.max_tries:
logger.critical('Cannot connect to the Database. Giving up.')
raise ConnectionError() from exc
else:
break

View File

@ -0,0 +1,22 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from bigchaindb.exceptions import BigchainDBError
class BackendError(BigchainDBError):
"""Top level exception for any backend exception."""
class ConnectionError(BackendError):
"""Exception raised when the connection to the backend fails."""
class OperationError(BackendError):
"""Exception raised when a backend operation fails."""
class DuplicateKeyError(OperationError):
"""Exception raised when an insert fails because the key is not unique"""

View File

@ -0,0 +1,28 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""MongoDB backend implementation.
Contains a MongoDB-specific implementation of the
:mod:`~bigchaindb.backend.schema` and :mod:`~bigchaindb.backend.query` interfaces.
You can specify BigchainDB to use MongoDB as its database backend by either
setting ``database.backend`` to ``'localmongodb'`` in your configuration file, or
setting the ``BIGCHAINDB_DATABASE_BACKEND`` environment variable to
``'localmongodb'``.
MongoDB is the default database backend for BigchainDB.
If configured to use MongoDB, BigchainDB will automatically return instances
of :class:`~bigchaindb.backend.localmongodb.LocalMongoDBConnection` for
:func:`~bigchaindb.backend.connection.connect` and dispatch calls of the
generic backend interfaces to the implementations in this module.
"""
# Register the single dispatched modules on import.
from bigchaindb.backend.localmongodb import schema, query # noqa
# MongoDBConnection should always be accessed via
# ``bigchaindb.backend.connect()``.

View File

@ -0,0 +1,136 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import logging
from ssl import CERT_REQUIRED
import pymongo
from bigchaindb.backend.connection import Connection
from bigchaindb.backend.exceptions import (DuplicateKeyError,
OperationError,
ConnectionError)
from bigchaindb.backend.utils import get_bigchaindb_config_value
from bigchaindb.common.exceptions import ConfigurationError
from bigchaindb.utils import Lazy
logger = logging.getLogger(__name__)
class LocalMongoDBConnection(Connection):
def __init__(self, replicaset=None, ssl=None, login=None, password=None,
ca_cert=None, certfile=None, keyfile=None,
keyfile_passphrase=None, crlfile=None, **kwargs):
"""Create a new Connection instance.
Args:
replicaset (str, optional): the name of the replica set to
connect to.
**kwargs: arbitrary keyword arguments provided by the
configuration's ``database`` settings
"""
super().__init__(**kwargs)
self.replicaset = replicaset or get_bigchaindb_config_value('replicaset')
self.ssl = ssl if ssl is not None else get_bigchaindb_config_value('ssl', False)
self.login = login or get_bigchaindb_config_value('login')
self.password = password or get_bigchaindb_config_value('password')
self.ca_cert = ca_cert or get_bigchaindb_config_value('ca_cert')
self.certfile = certfile or get_bigchaindb_config_value('certfile')
self.keyfile = keyfile or get_bigchaindb_config_value('keyfile')
self.keyfile_passphrase = keyfile_passphrase or get_bigchaindb_config_value('keyfile_passphrase')
self.crlfile = crlfile or get_bigchaindb_config_value('crlfile')
@property
def db(self):
return self.conn[self.dbname]
def query(self):
return Lazy()
def collection(self, name):
"""Return a lazy object that can be used to compose a query.
Args:
name (str): the name of the collection to query.
"""
return self.query()[self.dbname][name]
def run(self, query):
try:
try:
return query.run(self.conn)
except pymongo.errors.AutoReconnect:
logger.warning('Lost connection to the database, '
'retrying query.')
return query.run(self.conn)
except pymongo.errors.AutoReconnect as exc:
raise ConnectionError from exc
except pymongo.errors.DuplicateKeyError as exc:
raise DuplicateKeyError from exc
except pymongo.errors.OperationFailure as exc:
print(f'DETAILS: {exc.details}')
raise OperationError from exc
def _connect(self):
"""Try to connect to the database.
Raises:
:exc:`~ConnectionError`: If the connection to the database
fails.
:exc:`~AuthenticationError`: If there is a OperationFailure due to
Authentication failure after connecting to the database.
:exc:`~ConfigurationError`: If there is a ConfigurationError while
connecting to the database.
"""
try:
# FYI: the connection process might raise a
# `ServerSelectionTimeoutError`, that is a subclass of
# `ConnectionFailure`.
# The presence of ca_cert, certfile, keyfile, crlfile implies the
# use of certificates for TLS connectivity.
if self.ca_cert is None or self.certfile is None or \
self.keyfile is None or self.crlfile is None:
client = pymongo.MongoClient(self.host,
self.port,
replicaset=self.replicaset,
serverselectiontimeoutms=self.connection_timeout,
ssl=self.ssl,
**MONGO_OPTS)
if self.login is not None and self.password is not None:
client[self.dbname].authenticate(self.login, self.password)
else:
logger.info('Connecting to MongoDB over TLS/SSL...')
client = pymongo.MongoClient(self.host,
self.port,
replicaset=self.replicaset,
serverselectiontimeoutms=self.connection_timeout,
ssl=self.ssl,
ssl_ca_certs=self.ca_cert,
ssl_certfile=self.certfile,
ssl_keyfile=self.keyfile,
ssl_pem_passphrase=self.keyfile_passphrase,
ssl_crlfile=self.crlfile,
ssl_cert_reqs=CERT_REQUIRED,
**MONGO_OPTS)
if self.login is not None:
client[self.dbname].authenticate(self.login,
mechanism='MONGODB-X509')
return client
except (pymongo.errors.ConnectionFailure,
pymongo.errors.OperationFailure) as exc:
logger.info('Exception in _connect(): {}'.format(exc))
raise ConnectionError(str(exc)) from exc
except pymongo.errors.ConfigurationError as exc:
raise ConfigurationError from exc
MONGO_OPTS = {
'socketTimeoutMS': 20000,
}

View File

@ -0,0 +1,377 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Query implementation for MongoDB"""
from pymongo import DESCENDING
from bigchaindb import backend
from bigchaindb.backend.exceptions import DuplicateKeyError
from bigchaindb.backend.utils import module_dispatch_registrar
from bigchaindb.backend.localmongodb.connection import LocalMongoDBConnection
from bigchaindb.common.transaction import Transaction
register_query = module_dispatch_registrar(backend.query)
@register_query(LocalMongoDBConnection)
def store_transactions(conn, signed_transactions):
return conn.run(conn.collection('transactions')
.insert_many(signed_transactions))
@register_query(LocalMongoDBConnection)
def get_transaction(conn, transaction_id):
return conn.run(
conn.collection('transactions')
.find_one({'id': transaction_id}, {'_id': 0}))
@register_query(LocalMongoDBConnection)
def get_transactions(conn, transaction_ids):
try:
return conn.run(
conn.collection('transactions')
.find({'id': {'$in': transaction_ids}},
projection={'_id': False}))
except IndexError:
pass
@register_query(LocalMongoDBConnection)
def store_metadatas(conn, metadata):
return conn.run(
conn.collection('metadata')
.insert_many(metadata, ordered=False))
@register_query(LocalMongoDBConnection)
def get_metadata(conn, transaction_ids):
return conn.run(
conn.collection('metadata')
.find({'id': {'$in': transaction_ids}},
projection={'_id': False}))
@register_query(LocalMongoDBConnection)
def store_asset(conn, asset):
try:
return conn.run(
conn.collection('assets')
.insert_one(asset))
except DuplicateKeyError:
pass
@register_query(LocalMongoDBConnection)
def store_assets(conn, assets):
return conn.run(
conn.collection('assets')
.insert_many(assets, ordered=False))
@register_query(LocalMongoDBConnection)
def get_asset(conn, asset_id):
try:
return conn.run(
conn.collection('assets')
.find_one({'id': asset_id}, {'_id': 0, 'id': 0}))
except IndexError:
pass
@register_query(LocalMongoDBConnection)
def get_assets(conn, asset_ids):
return conn.run(
conn.collection('assets')
.find({'id': {'$in': asset_ids}},
projection={'_id': False}))
@register_query(LocalMongoDBConnection)
def get_spent(conn, transaction_id, output):
query = {'inputs':
{'$elemMatch':
{'$and': [{'fulfills.transaction_id': transaction_id},
{'fulfills.output_index': output}]}}}
return conn.run(
conn.collection('transactions')
.find(query, {'_id': 0}))
@register_query(LocalMongoDBConnection)
def get_latest_block(conn):
return conn.run(
conn.collection('blocks')
.find_one(projection={'_id': False},
sort=[('height', DESCENDING)]))
@register_query(LocalMongoDBConnection)
def store_block(conn, block):
try:
return conn.run(
conn.collection('blocks')
.insert_one(block))
except DuplicateKeyError:
pass
@register_query(LocalMongoDBConnection)
def get_txids_filtered(conn, asset_id, operation=None, last_tx=None):
match = {
Transaction.CREATE: {'operation': 'CREATE', 'id': asset_id},
Transaction.TRANSFER: {'operation': 'TRANSFER', 'asset.id': asset_id},
None: {'$or': [{'asset.id': asset_id}, {'id': asset_id}]},
}[operation]
cursor = conn.run(conn.collection('transactions').find(match))
if last_tx:
cursor = cursor.sort([('$natural', DESCENDING)]).limit(1)
return (elem['id'] for elem in cursor)
@register_query(LocalMongoDBConnection)
def text_search(conn, search, *, language='english', case_sensitive=False,
diacritic_sensitive=False, text_score=False, limit=0, table='assets'):
cursor = conn.run(
conn.collection(table)
.find({'$text': {
'$search': search,
'$language': language,
'$caseSensitive': case_sensitive,
'$diacriticSensitive': diacritic_sensitive}},
{'score': {'$meta': 'textScore'}, '_id': False})
.sort([('score', {'$meta': 'textScore'})])
.limit(limit))
if text_score:
return cursor
return (_remove_text_score(obj) for obj in cursor)
def _remove_text_score(asset):
asset.pop('score', None)
return asset
@register_query(LocalMongoDBConnection)
def get_owned_ids(conn, owner):
cursor = conn.run(
conn.collection('transactions').aggregate([
{'$match': {'outputs.public_keys': owner}},
{'$project': {'_id': False}}
]))
return cursor
@register_query(LocalMongoDBConnection)
def get_spending_transactions(conn, inputs):
transaction_ids = [i['transaction_id'] for i in inputs]
output_indexes = [i['output_index'] for i in inputs]
query = {'inputs':
{'$elemMatch':
{'$and':
[
{'fulfills.transaction_id': {'$in': transaction_ids}},
{'fulfills.output_index': {'$in': output_indexes}}
]}}}
cursor = conn.run(
conn.collection('transactions').find(query, {'_id': False}))
return cursor
@register_query(LocalMongoDBConnection)
def get_block(conn, block_id):
return conn.run(
conn.collection('blocks')
.find_one({'height': block_id},
projection={'_id': False}))
@register_query(LocalMongoDBConnection)
def get_block_with_transaction(conn, txid):
return conn.run(
conn.collection('blocks')
.find({'transactions': txid},
projection={'_id': False, 'height': True}))
@register_query(LocalMongoDBConnection)
def delete_transactions(conn, txn_ids):
conn.run(conn.collection('assets').delete_many({'id': {'$in': txn_ids}}))
conn.run(conn.collection('metadata').delete_many({'id': {'$in': txn_ids}}))
conn.run(conn.collection('transactions').delete_many({'id': {'$in': txn_ids}}))
@register_query(LocalMongoDBConnection)
def store_unspent_outputs(conn, *unspent_outputs):
if unspent_outputs:
try:
return conn.run(
conn.collection('utxos').insert_many(
unspent_outputs,
ordered=False,
)
)
except DuplicateKeyError:
# TODO log warning at least
pass
@register_query(LocalMongoDBConnection)
def delete_unspent_outputs(conn, *unspent_outputs):
if unspent_outputs:
return conn.run(
conn.collection('utxos').delete_many({
'$or': [{
'$and': [
{'transaction_id': unspent_output['transaction_id']},
{'output_index': unspent_output['output_index']},
],
} for unspent_output in unspent_outputs]
})
)
@register_query(LocalMongoDBConnection)
def get_unspent_outputs(conn, *, query=None):
if query is None:
query = {}
return conn.run(conn.collection('utxos').find(query,
projection={'_id': False}))
@register_query(LocalMongoDBConnection)
def store_pre_commit_state(conn, state):
return conn.run(
conn.collection('pre_commit')
.replace_one({}, state, upsert=True)
)
@register_query(LocalMongoDBConnection)
def get_pre_commit_state(conn):
return conn.run(conn.collection('pre_commit').find_one())
@register_query(LocalMongoDBConnection)
def store_validator_set(conn, validators_update):
height = validators_update['height']
return conn.run(
conn.collection('validators').replace_one(
{'height': height},
validators_update,
upsert=True
)
)
@register_query(LocalMongoDBConnection)
def delete_validator_set(conn, height):
return conn.run(
conn.collection('validators').delete_many({'height': height})
)
@register_query(LocalMongoDBConnection)
def store_election(conn, election_id, height, is_concluded):
return conn.run(
conn.collection('elections').replace_one(
{'election_id': election_id,
'height': height},
{'election_id': election_id,
'height': height,
'is_concluded': is_concluded},
upsert=True,
)
)
@register_query(LocalMongoDBConnection)
def store_elections(conn, elections):
return conn.run(
conn.collection('elections').insert_many(elections)
)
@register_query(LocalMongoDBConnection)
def delete_elections(conn, height):
return conn.run(
conn.collection('elections').delete_many({'height': height})
)
@register_query(LocalMongoDBConnection)
def get_validator_set(conn, height=None):
query = {}
if height is not None:
query = {'height': {'$lte': height}}
cursor = conn.run(
conn.collection('validators')
.find(query, projection={'_id': False})
.sort([('height', DESCENDING)])
.limit(1)
)
return next(cursor, None)
@register_query(LocalMongoDBConnection)
def get_election(conn, election_id):
query = {'election_id': election_id}
return conn.run(
conn.collection('elections')
.find_one(query, projection={'_id': False},
sort=[('height', DESCENDING)])
)
@register_query(LocalMongoDBConnection)
def get_asset_tokens_for_public_key(conn, asset_id, public_key):
query = {'outputs.public_keys': [public_key],
'asset.id': asset_id}
cursor = conn.run(
conn.collection('transactions').aggregate([
{'$match': query},
{'$project': {'_id': False}}
]))
return cursor
@register_query(LocalMongoDBConnection)
def store_abci_chain(conn, height, chain_id, is_synced=True):
return conn.run(
conn.collection('abci_chains').replace_one(
{'height': height},
{'height': height, 'chain_id': chain_id,
'is_synced': is_synced},
upsert=True,
)
)
@register_query(LocalMongoDBConnection)
def delete_abci_chain(conn, height):
return conn.run(
conn.collection('abci_chains').delete_many({'height': height})
)
@register_query(LocalMongoDBConnection)
def get_latest_abci_chain(conn):
return conn.run(
conn.collection('abci_chains')
.find_one(projection={'_id': False}, sort=[('height', DESCENDING)])
)

View File

@ -0,0 +1,90 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Utils to initialize and drop the database."""
import logging
from pymongo import ASCENDING, DESCENDING, TEXT
from pymongo.errors import CollectionInvalid
from bigchaindb import backend
from bigchaindb.backend.utils import module_dispatch_registrar
from bigchaindb.backend.localmongodb.connection import LocalMongoDBConnection
logger = logging.getLogger(__name__)
register_schema = module_dispatch_registrar(backend.schema)
INDEXES = {
'transactions': [
('id', dict(unique=True, name='transaction_id')),
('asset.id', dict(name='asset_id')),
('outputs.public_keys', dict(name='outputs')),
([('inputs.fulfills.transaction_id', ASCENDING),
('inputs.fulfills.output_index', ASCENDING)], dict(name='inputs')),
],
'assets': [
('id', dict(name='asset_id', unique=True)),
([('$**', TEXT)], dict(name='text')),
],
'blocks': [
([('height', DESCENDING)], dict(name='height', unique=True)),
],
'metadata': [
('id', dict(name='transaction_id', unique=True)),
([('$**', TEXT)], dict(name='text')),
],
'utxos': [
([('transaction_id', ASCENDING),
('output_index', ASCENDING)], dict(name='utxo', unique=True)),
],
'pre_commit': [
('height', dict(name='height', unique=True)),
],
'elections': [
([('height', DESCENDING), ('election_id', ASCENDING)],
dict(name='election_id_height', unique=True)),
],
'validators': [
('height', dict(name='height', unique=True)),
],
'abci_chains': [
('height', dict(name='height', unique=True)),
('chain_id', dict(name='chain_id', unique=True)),
],
}
@register_schema(LocalMongoDBConnection)
def create_database(conn, dbname):
logger.info('Create database `%s`.', dbname)
# TODO: read and write concerns can be declared here
conn.conn.get_database(dbname)
@register_schema(LocalMongoDBConnection)
def create_tables(conn, dbname):
for table_name in backend.schema.TABLES:
# create the table
# TODO: read and write concerns can be declared here
try:
logger.info(f'Create `{table_name}` table.')
conn.conn[dbname].create_collection(table_name)
except CollectionInvalid:
logger.info(f'Collection {table_name} already exists.')
create_indexes(conn, dbname, table_name, INDEXES[table_name])
def create_indexes(conn, dbname, collection, indexes):
logger.info(f'Ensure secondary indexes for `{collection}`.')
for fields, kwargs in indexes:
conn.conn[dbname][collection].create_index(fields, **kwargs)
@register_schema(LocalMongoDBConnection)
def drop_database(conn, dbname):
conn.conn.drop_database(dbname)

430
bigchaindb/backend/query.py Normal file
View File

@ -0,0 +1,430 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Query interfaces for backends."""
from functools import singledispatch
from bigchaindb.backend.exceptions import OperationError
@singledispatch
def store_asset(connection, asset):
"""Write an asset to the asset table.
Args:
asset (dict): the asset.
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def store_assets(connection, assets):
"""Write a list of assets to the assets table.
Args:
assets (list): a list of assets to write.
Returns:
The database response.
"""
raise NotImplementedError
@singledispatch
def store_metadatas(connection, metadata):
"""Write a list of metadata to metadata table.
Args:
metadata (list): list of metadata.
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def store_transactions(connection, signed_transactions):
"""Store the list of transactions."""
raise NotImplementedError
@singledispatch
def get_transaction(connection, transaction_id):
"""Get a transaction from the transactions table.
Args:
transaction_id (str): the id of the transaction.
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def get_transactions(connection, transaction_ids):
"""Get transactions from the transactions table.
Args:
transaction_ids (list): list of transaction ids to fetch
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def get_asset(connection, asset_id):
"""Get a transaction from the transactions table.
Args:
asset_id (str): the id of the asset
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def get_spent(connection, transaction_id, condition_id):
"""Check if a `txid` was already used as an input.
A transaction can be used as an input for another transaction. Bigchain
needs to make sure that a given `txid` is only used once.
Args:
transaction_id (str): The id of the transaction.
condition_id (int): The index of the condition in the respective
transaction.
Returns:
The transaction that used the `txid` as an input else `None`
"""
raise NotImplementedError
@singledispatch
def get_spending_transactions(connection, inputs):
"""Return transactions which spend given inputs
Args:
inputs (list): list of {txid, output}
Returns:
Iterator of (block_ids, transaction) for transactions that
spend given inputs.
"""
raise NotImplementedError
@singledispatch
def get_owned_ids(connection, owner):
"""Retrieve a list of `txids` that can we used has inputs.
Args:
owner (str): base58 encoded public key.
Returns:
Iterator of (block_id, transaction) for transactions
that list given owner in conditions.
"""
raise NotImplementedError
@singledispatch
def get_block(connection, block_id):
"""Get a block from the bigchain table.
Args:
block_id (str): block id of the block to get
Returns:
block (dict): the block or `None`
"""
raise NotImplementedError
@singledispatch
def get_block_with_transaction(connection, txid):
"""Get a block containing transaction id `txid`
Args:
txid (str): id of transaction to be searched.
Returns:
block_id (int): the block id or `None`
"""
raise NotImplementedError
@singledispatch
def get_metadata(connection, transaction_ids):
"""Get a list of metadata from the metadata table.
Args:
transaction_ids (list): a list of ids for the metadata to be retrieved from
the database.
Returns:
metadata (list): the list of returned metadata.
"""
raise NotImplementedError
@singledispatch
def get_assets(connection, asset_ids):
"""Get a list of assets from the assets table.
Args:
asset_ids (list): a list of ids for the assets to be retrieved from
the database.
Returns:
assets (list): the list of returned assets.
"""
raise NotImplementedError
@singledispatch
def get_txids_filtered(connection, asset_id, operation=None):
"""Return all transactions for a particular asset id and optional operation.
Args:
asset_id (str): ID of transaction that defined the asset
operation (str) (optional): Operation to filter on
"""
raise NotImplementedError
@singledispatch
def text_search(conn, search, *, language='english', case_sensitive=False,
diacritic_sensitive=False, text_score=False, limit=0, table=None):
"""Return all the assets that match the text search.
The results are sorted by text score.
For more information about the behavior of text search on MongoDB see
https://docs.mongodb.com/manual/reference/operator/query/text/#behavior
Args:
search (str): Text search string to query the text index
language (str, optional): The language for the search and the rules for
stemmer and tokenizer. If the language is ``None`` text search uses
simple tokenization and no stemming.
case_sensitive (bool, optional): Enable or disable case sensitive
search.
diacritic_sensitive (bool, optional): Enable or disable case sensitive
diacritic search.
text_score (bool, optional): If ``True`` returns the text score with
each document.
limit (int, optional): Limit the number of returned documents.
Returns:
:obj:`list` of :obj:`dict`: a list of assets
Raises:
OperationError: If the backend does not support text search
"""
raise OperationError('This query is only supported when running '
'BigchainDB with MongoDB as the backend.')
@singledispatch
def get_latest_block(conn):
"""Get the latest commited block i.e. block with largest height"""
raise NotImplementedError
@singledispatch
def store_block(conn, block):
"""Write a new block to the `blocks` table
Args:
block (dict): block with current height and block hash.
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def store_unspent_outputs(connection, unspent_outputs):
"""Store unspent outputs in ``utxo_set`` table."""
raise NotImplementedError
@singledispatch
def delete_unspent_outputs(connection, unspent_outputs):
"""Delete unspent outputs in ``utxo_set`` table."""
raise NotImplementedError
@singledispatch
def delete_transactions(conn, txn_ids):
"""Delete transactions from database
Args:
txn_ids (list): list of transaction ids
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def get_unspent_outputs(connection, *, query=None):
"""Retrieves unspent outputs.
Args:
query (dict): An optional parameter to filter the result set.
Defaults to ``None``, which means that all UTXO records
will be returned.
Returns:
Generator yielding unspent outputs (UTXO set) according to the
given query.
"""
raise NotImplementedError
@singledispatch
def store_pre_commit_state(connection, state):
"""Store pre-commit state.
Args:
state (dict): pre-commit state.
Returns:
The result of the operation.
"""
raise NotImplementedError
@singledispatch
def get_pre_commit_state(connection):
"""Get pre-commit state.
Returns:
Document representing the pre-commit state.
"""
raise NotImplementedError
@singledispatch
def store_validator_set(conn, validator_update):
"""Store updated validator set"""
raise NotImplementedError
@singledispatch
def delete_validator_set(conn, height):
"""Delete the validator set at the given height."""
raise NotImplementedError
@singledispatch
def store_election(conn, election_id, height, is_concluded):
"""Store election record"""
raise NotImplementedError
@singledispatch
def store_elections(conn, elections):
"""Store election records in bulk"""
raise NotImplementedError
@singledispatch
def delete_elections(conn, height):
"""Delete all election records at the given height"""
raise NotImplementedError
@singledispatch
def get_validator_set(conn, height):
"""Get validator set for a given `height`, if `height` is not specified
then return the latest validator set
"""
raise NotImplementedError
@singledispatch
def get_election(conn, election_id):
"""Return the election record
"""
raise NotImplementedError
@singledispatch
def get_asset_tokens_for_public_key(connection, asset_id, public_key):
"""Retrieve a list of tokens of type `asset_id` that are owned by the `public_key`.
Args:
asset_id (str): Id of the token.
public_key (str): base58 encoded public key
Returns:
Iterator of transaction that list given owner in conditions.
"""
raise NotImplementedError
@singledispatch
def store_abci_chain(conn, height, chain_id, is_synced=True):
"""Create or update an ABCI chain at the given height.
Usually invoked in the beginning of the ABCI communications (height=0)
or when ABCI client (like Tendermint) is migrated (any height).
Args:
is_synced: True if the chain is known by both ABCI client and server
"""
raise NotImplementedError
@singledispatch
def delete_abci_chain(conn, height):
"""Delete the ABCI chain at the given height."""
raise NotImplementedError
@singledispatch
def get_latest_abci_chain(conn):
"""Returns the ABCI chain stored at the biggest height, if any,
None otherwise.
"""
raise NotImplementedError

View File

@ -0,0 +1,128 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Database creation and schema-providing interfaces for backends."""
from functools import singledispatch
import logging
import bigchaindb
from bigchaindb.backend.connection import connect
from bigchaindb.common.exceptions import ValidationError
from bigchaindb.common.utils import validate_all_values_for_key_in_obj, validate_all_values_for_key_in_list
logger = logging.getLogger(__name__)
# Tables/collections that every backend database must create
TABLES = ('transactions', 'blocks', 'assets', 'metadata',
'validators', 'elections', 'pre_commit', 'utxos', 'abci_chains')
VALID_LANGUAGES = ('danish', 'dutch', 'english', 'finnish', 'french', 'german',
'hungarian', 'italian', 'norwegian', 'portuguese', 'romanian',
'russian', 'spanish', 'swedish', 'turkish', 'none',
'da', 'nl', 'en', 'fi', 'fr', 'de', 'hu', 'it', 'nb', 'pt',
'ro', 'ru', 'es', 'sv', 'tr')
@singledispatch
def create_database(connection, dbname):
"""Create database to be used by BigchainDB.
Args:
dbname (str): the name of the database to create.
"""
raise NotImplementedError
@singledispatch
def create_tables(connection, dbname):
"""Create the tables to be used by BigchainDB.
Args:
dbname (str): the name of the database to create tables for.
"""
raise NotImplementedError
@singledispatch
def drop_database(connection, dbname):
"""Drop the database used by BigchainDB.
Args:
dbname (str): the name of the database to drop.
Raises:
:exc:`~DatabaseDoesNotExist`: If the given :attr:`dbname` does not
exist as a database.
"""
raise NotImplementedError
def init_database(connection=None, dbname=None):
"""Initialize the configured backend for use with BigchainDB.
Creates a database with :attr:`dbname` with any required tables
and supporting indexes.
Args:
connection (:class:`~bigchaindb.backend.connection.Connection`): an
existing connection to use to initialize the database.
Creates one if not given.
dbname (str): the name of the database to create.
Defaults to the database name given in the BigchainDB
configuration.
"""
connection = connection or connect()
dbname = dbname or bigchaindb.config['database']['name']
create_database(connection, dbname)
create_tables(connection, dbname)
def validate_language_key(obj, key):
"""Validate all nested "language" key in `obj`.
Args:
obj (dict): dictionary whose "language" key is to be validated.
Returns:
None: validation successful
Raises:
ValidationError: will raise exception in case language is not valid.
"""
backend = bigchaindb.config['database']['backend']
if backend == 'localmongodb':
data = obj.get(key, {})
if isinstance(data, dict):
validate_all_values_for_key_in_obj(data, 'language', validate_language)
elif isinstance(data, list):
validate_all_values_for_key_in_list(data, 'language', validate_language)
def validate_language(value):
"""Check if `value` is a valid language.
https://docs.mongodb.com/manual/reference/text-search-languages/
Args:
value (str): language to validated
Returns:
None: validation successful
Raises:
ValidationError: will raise exception in case language is not valid.
"""
if value not in VALID_LANGUAGES:
error_str = ('MongoDB does not support text search for the '
'language "{}". If you do not understand this error '
'message then please rename key/field "language" to '
'something else like "lang".').format(value)
raise ValidationError(error_str)

View File

@ -0,0 +1,39 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import bigchaindb
class ModuleDispatchRegistrationError(Exception):
"""Raised when there is a problem registering dispatched functions for a
module
"""
def module_dispatch_registrar(module):
def dispatch_wrapper(obj_type):
def wrapper(func):
func_name = func.__name__
try:
dispatch_registrar = getattr(module, func_name)
return dispatch_registrar.register(obj_type)(func)
except AttributeError as ex:
raise ModuleDispatchRegistrationError(
('`{module}` does not contain a single-dispatchable '
'function named `{func}`. The module being registered '
'was not implemented correctly!').format(
func=func_name, module=module.__name__)) from ex
return wrapper
return dispatch_wrapper
def get_bigchaindb_config_value(key, default_value=None):
return bigchaindb.config['database'].get(key, default_value)
def get_bigchaindb_config_value_or_key_error(key):
return bigchaindb.config['database'][key]

View File

@ -1,329 +0,0 @@
"""Implementation of the `bigchaindb` command,
the command-line interface (CLI) for BigchainDB Server.
"""
import os
import sys
import logging
import argparse
import copy
import json
import builtins
import logstats
from bigchaindb.common import crypto
from bigchaindb.common.exceptions import (StartupError,
DatabaseAlreadyExists,
KeypairNotFoundException)
import rethinkdb as r
import bigchaindb
import bigchaindb.config_utils
from bigchaindb.models import Transaction
from bigchaindb.util import ProcessGroup
from bigchaindb import db
from bigchaindb.commands import utils
from bigchaindb import processes
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# We need this because `input` always prints on stdout, while it should print
# to stderr. It's a very old bug, check it out here:
# - https://bugs.python.org/issue1927
def input(prompt):
print(prompt, end='', file=sys.stderr)
return builtins.input()
def run_show_config(args):
"""Show the current configuration"""
# TODO Proposal: remove the "hidden" configuration. Only show config. If
# the system needs to be configured, then display information on how to
# configure the system.
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
config = copy.deepcopy(bigchaindb.config)
del config['CONFIGURED']
private_key = config['keypair']['private']
config['keypair']['private'] = 'x' * 45 if private_key else None
print(json.dumps(config, indent=4, sort_keys=True))
def run_configure(args, skip_if_exists=False):
"""Run a script to configure the current node.
Args:
skip_if_exists (bool): skip the function if a config file already exists
"""
config_path = args.config or bigchaindb.config_utils.CONFIG_DEFAULT_PATH
config_file_exists = False
# if the config path is `-` then it's stdout
if config_path != '-':
config_file_exists = os.path.exists(config_path)
if config_file_exists and skip_if_exists:
return
if config_file_exists and not args.yes:
want = input('Config file `{}` exists, do you want to override it? '
'(cannot be undone) [y/N]: '.format(config_path))
if want != 'y':
return
conf = copy.deepcopy(bigchaindb.config)
# Patch the default configuration with the new values
conf = bigchaindb.config_utils.update(
conf,
bigchaindb.config_utils.env_config(bigchaindb.config))
print('Generating keypair', file=sys.stderr)
conf['keypair']['private'], conf['keypair']['public'] = \
crypto.generate_key_pair()
if not args.yes:
for key in ('bind', ):
val = conf['server'][key]
conf['server'][key] = \
input('API Server {}? (default `{}`): '.format(key, val)) \
or val
for key in ('host', 'port', 'name'):
val = conf['database'][key]
conf['database'][key] = \
input('Database {}? (default `{}`): '.format(key, val)) \
or val
for key in ('host', 'port', 'rate'):
val = conf['statsd'][key]
conf['statsd'][key] = \
input('Statsd {}? (default `{}`): '.format(key, val)) \
or val
val = conf['backlog_reassign_delay']
conf['backlog_reassign_delay'] = \
input('Stale transaction reassignment delay (in seconds)? (default `{}`): '.format(val)) \
or val
if config_path != '-':
bigchaindb.config_utils.write_config(conf, config_path)
else:
print(json.dumps(conf, indent=4, sort_keys=True))
print('Configuration written to {}'.format(config_path), file=sys.stderr)
print('Ready to go!', file=sys.stderr)
def run_export_my_pubkey(args):
"""Export this node's public key to standard output
"""
logger.debug('bigchaindb args = {}'.format(args))
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
pubkey = bigchaindb.config['keypair']['public']
if pubkey is not None:
print(pubkey)
else:
sys.exit("This node's public key wasn't set anywhere "
"so it can't be exported")
# raises SystemExit exception
# message is sent to stderr
# exits with exit code 1 (signals tha an error happened)
def run_init(args):
"""Initialize the database"""
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
# TODO Provide mechanism to:
# 1. prompt the user to inquire whether they wish to drop the db
# 2. force the init, (e.g., via -f flag)
try:
db.init()
except DatabaseAlreadyExists:
print('The database already exists.', file=sys.stderr)
print('If you wish to re-initialize it, first drop it.', file=sys.stderr)
def run_drop(args):
"""Drop the database"""
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
db.drop(assume_yes=args.yes)
def run_start(args):
"""Start the processes to run the node"""
logger.info('BigchainDB Version {}'.format(bigchaindb.__version__))
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
if args.allow_temp_keypair:
if not (bigchaindb.config['keypair']['private'] or
bigchaindb.config['keypair']['public']):
private_key, public_key = crypto.generate_key_pair()
bigchaindb.config['keypair']['private'] = private_key
bigchaindb.config['keypair']['public'] = public_key
else:
logger.warning('Keypair found, no need to create one on the fly.')
if args.start_rethinkdb:
try:
proc = utils.start_rethinkdb()
except StartupError as e:
sys.exit('Error starting RethinkDB, reason is: {}'.format(e))
logger.info('RethinkDB started with PID %s' % proc.pid)
try:
db.init()
except DatabaseAlreadyExists:
pass
except KeypairNotFoundException:
sys.exit("Can't start BigchainDB, no keypair found. "
'Did you run `bigchaindb configure`?')
logger.info('Starting BigchainDB main process with public key %s',
bigchaindb.config['keypair']['public'])
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
def run_load(args):
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
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()
def run_set_shards(args):
for table in ['bigchain', 'backlog', 'votes']:
# See https://www.rethinkdb.com/api/python/config/
table_config = r.table(table).config().run(db.get_conn())
num_replicas = len(table_config['shards'][0]['replicas'])
try:
r.table(table).reconfigure(shards=args.num_shards, replicas=num_replicas).run(db.get_conn())
except r.ReqlOpFailedError as e:
logger.warn(e)
def run_set_replicas(args):
for table in ['bigchain', 'backlog', 'votes']:
# See https://www.rethinkdb.com/api/python/config/
table_config = r.table(table).config().run(db.get_conn())
num_shards = len(table_config['shards'])
try:
r.table(table).reconfigure(shards=num_shards, replicas=args.num_replicas).run(db.get_conn())
except r.ReqlOpFailedError as e:
logger.warn(e)
def create_parser():
parser = argparse.ArgumentParser(
description='Control your BigchainDB node.',
parents=[utils.base_parser])
parser.add_argument('--dev-start-rethinkdb',
dest='start_rethinkdb',
action='store_true',
help='Run RethinkDB on start')
parser.add_argument('--dev-allow-temp-keypair',
dest='allow_temp_keypair',
action='store_true',
help='Generate a random keypair on start')
# all the commands are contained in the subparsers object,
# the command selected by the user will be stored in `args.command`
# that is used by the `main` function to select which other
# function to call.
subparsers = parser.add_subparsers(title='Commands',
dest='command')
# parser for writing a config file
subparsers.add_parser('configure',
help='Prepare the config file '
'and create the node keypair')
# parsers for showing/exporting config values
subparsers.add_parser('show-config',
help='Show the current configuration')
subparsers.add_parser('export-my-pubkey',
help="Export this node's public key")
# parser for database-level commands
subparsers.add_parser('init',
help='Init the database')
subparsers.add_parser('drop',
help='Drop the database')
# parser for starting BigchainDB
subparsers.add_parser('start',
help='Start BigchainDB')
# parser for configuring the number of shards
sharding_parser = subparsers.add_parser('set-shards',
help='Configure number of shards')
sharding_parser.add_argument('num_shards', metavar='num_shards',
type=int, default=1,
help='Number of shards')
# parser for configuring the number of replicas
replicas_parser = subparsers.add_parser('set-replicas',
help='Configure number of replicas')
replicas_parser.add_argument('num_replicas', metavar='num_replicas',
type=int, default=1,
help='Number of replicas (i.e. the replication factor)')
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
def main():
utils.start(create_parser(), sys.argv[1:], globals())

View File

@ -0,0 +1,398 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Implementation of the `bigchaindb` command,
the command-line interface (CLI) for BigchainDB Server.
"""
import os
import logging
import argparse
import copy
import json
import sys
from bigchaindb.core import rollback
from bigchaindb.migrations.chain_migration_election import ChainMigrationElection
from bigchaindb.utils import load_node_key
from bigchaindb.common.transaction_mode_types import BROADCAST_TX_COMMIT
from bigchaindb.common.exceptions import (DatabaseDoesNotExist,
ValidationError)
from bigchaindb.elections.vote import Vote
import bigchaindb
from bigchaindb import (backend, ValidatorElection,
BigchainDB)
from bigchaindb.backend import schema
from bigchaindb.commands import utils
from bigchaindb.commands.utils import (configure_bigchaindb,
input_on_stderr)
from bigchaindb.log import setup_logging
from bigchaindb.tendermint_utils import public_key_from_base64
from bigchaindb.commands.election_types import elections
from bigchaindb.version import __tm_supported_versions__
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Note about printing:
# We try to print to stdout for results of a command that may be useful to
# someone (or another program). Strictly informational text, or errors,
# should be printed to stderr.
@configure_bigchaindb
def run_show_config(args):
"""Show the current configuration"""
# TODO Proposal: remove the "hidden" configuration. Only show config. If
# the system needs to be configured, then display information on how to
# configure the system.
config = copy.deepcopy(bigchaindb.config)
del config['CONFIGURED']
print(json.dumps(config, indent=4, sort_keys=True))
@configure_bigchaindb
def run_configure(args):
"""Run a script to configure the current node."""
config_path = args.config or bigchaindb.config_utils.CONFIG_DEFAULT_PATH
config_file_exists = False
# if the config path is `-` then it's stdout
if config_path != '-':
config_file_exists = os.path.exists(config_path)
if config_file_exists and not args.yes:
want = input_on_stderr('Config file `{}` exists, do you want to '
'override it? (cannot be undone) [y/N]: '.format(config_path))
if want != 'y':
return
conf = copy.deepcopy(bigchaindb.config)
# select the correct config defaults based on the backend
print('Generating default configuration for backend {}'
.format(args.backend), file=sys.stderr)
database_keys = bigchaindb._database_keys_map[args.backend]
conf['database'] = bigchaindb._database_map[args.backend]
if not args.yes:
for key in ('bind', ):
val = conf['server'][key]
conf['server'][key] = input_on_stderr('API Server {}? (default `{}`): '.format(key, val), val)
for key in ('scheme', 'host', 'port'):
val = conf['wsserver'][key]
conf['wsserver'][key] = input_on_stderr('WebSocket Server {}? (default `{}`): '.format(key, val), val)
for key in database_keys:
val = conf['database'][key]
conf['database'][key] = input_on_stderr('Database {}? (default `{}`): '.format(key, val), val)
for key in ('host', 'port'):
val = conf['tendermint'][key]
conf['tendermint'][key] = input_on_stderr('Tendermint {}? (default `{}`)'.format(key, val), val)
if config_path != '-':
bigchaindb.config_utils.write_config(conf, config_path)
else:
print(json.dumps(conf, indent=4, sort_keys=True))
print('Configuration written to {}'.format(config_path), file=sys.stderr)
print('Ready to go!', file=sys.stderr)
@configure_bigchaindb
def run_election(args):
"""Initiate and manage elections"""
b = BigchainDB()
# Call the function specified by args.action, as defined above
globals()[f'run_election_{args.action}'](args, b)
def run_election_new(args, bigchain):
election_type = args.election_type.replace('-', '_')
globals()[f'run_election_new_{election_type}'](args, bigchain)
def create_new_election(sk, bigchain, election_class, data):
try:
key = load_node_key(sk)
voters = election_class.recipients(bigchain)
election = election_class.generate([key.public_key],
voters,
data, None).sign([key.private_key])
election.validate(bigchain)
except ValidationError as e:
logger.error(e)
return False
except FileNotFoundError as fd_404:
logger.error(fd_404)
return False
resp = bigchain.write_transaction(election, BROADCAST_TX_COMMIT)
if resp == (202, ''):
logger.info('[SUCCESS] Submitted proposal with id: {}'.format(election.id))
return election.id
else:
logger.error('Failed to commit election proposal')
return False
def run_election_new_upsert_validator(args, bigchain):
"""Initiates an election to add/update/remove a validator to an existing BigchainDB network
:param args: dict
args = {
'public_key': the public key of the proposed peer, (str)
'power': the proposed validator power for the new peer, (str)
'node_id': the node_id of the new peer (str)
'sk': the path to the private key of the node calling the election (str)
}
:param bigchain: an instance of BigchainDB
:return: election_id or `False` in case of failure
"""
new_validator = {
'public_key': {'value': public_key_from_base64(args.public_key),
'type': 'ed25519-base16'},
'power': args.power,
'node_id': args.node_id
}
return create_new_election(args.sk, bigchain, ValidatorElection, new_validator)
def run_election_new_chain_migration(args, bigchain):
"""Initiates an election to halt block production
:param args: dict
args = {
'sk': the path to the private key of the node calling the election (str)
}
:param bigchain: an instance of BigchainDB
:return: election_id or `False` in case of failure
"""
return create_new_election(args.sk, bigchain, ChainMigrationElection, {})
def run_election_approve(args, bigchain):
"""Approve an election
:param args: dict
args = {
'election_id': the election_id of the election (str)
'sk': the path to the private key of the signer (str)
}
:param bigchain: an instance of BigchainDB
:return: success log message or `False` in case of error
"""
key = load_node_key(args.sk)
tx = bigchain.get_transaction(args.election_id)
voting_powers = [v.amount for v in tx.outputs if key.public_key in v.public_keys]
if len(voting_powers) > 0:
voting_power = voting_powers[0]
else:
logger.error('The key you provided does not match any of the eligible voters in this election.')
return False
inputs = [i for i in tx.to_inputs() if key.public_key in i.owners_before]
election_pub_key = ValidatorElection.to_public_key(tx.id)
approval = Vote.generate(inputs,
[([election_pub_key], voting_power)],
tx.id).sign([key.private_key])
approval.validate(bigchain)
resp = bigchain.write_transaction(approval, BROADCAST_TX_COMMIT)
if resp == (202, ''):
logger.info('[SUCCESS] Your vote has been submitted')
return approval.id
else:
logger.error('Failed to commit vote')
return False
def run_election_show(args, bigchain):
"""Retrieves information about an election
:param args: dict
args = {
'election_id': the transaction_id for an election (str)
}
:param bigchain: an instance of BigchainDB
"""
election = bigchain.get_transaction(args.election_id)
if not election:
logger.error(f'No election found with election_id {args.election_id}')
return
response = election.show_election(bigchain)
logger.info(response)
return response
def _run_init():
bdb = bigchaindb.BigchainDB()
schema.init_database(connection=bdb.connection)
@configure_bigchaindb
def run_init(args):
"""Initialize the database"""
_run_init()
@configure_bigchaindb
def run_drop(args):
"""Drop the database"""
dbname = bigchaindb.config['database']['name']
if not args.yes:
response = input_on_stderr('Do you want to drop `{}` database? [y/n]: '.format(dbname))
if response != 'y':
return
conn = backend.connect()
try:
schema.drop_database(conn, dbname)
except DatabaseDoesNotExist:
print("Cannot drop '{name}'. The database does not exist.".format(name=dbname), file=sys.stderr)
def run_recover(b):
rollback(b)
@configure_bigchaindb
def run_start(args):
"""Start the processes to run the node"""
# Configure Logging
setup_logging()
logger.info('BigchainDB Version %s', bigchaindb.__version__)
run_recover(bigchaindb.lib.BigchainDB())
if not args.skip_initialize_database:
logger.info('Initializing database')
_run_init()
logger.info('Starting BigchainDB main process.')
from bigchaindb.start import start
start(args)
def run_tendermint_version(args):
"""Show the supported Tendermint version(s)"""
supported_tm_ver = {
'description': 'BigchainDB supports the following Tendermint version(s)',
'tendermint': __tm_supported_versions__,
}
print(json.dumps(supported_tm_ver, indent=4, sort_keys=True))
def create_parser():
parser = argparse.ArgumentParser(
description='Control your BigchainDB node.',
parents=[utils.base_parser])
# all the commands are contained in the subparsers object,
# the command selected by the user will be stored in `args.command`
# that is used by the `main` function to select which other
# function to call.
subparsers = parser.add_subparsers(title='Commands',
dest='command')
# parser for writing a config file
config_parser = subparsers.add_parser('configure',
help='Prepare the config file.')
config_parser.add_argument('backend',
choices=['localmongodb'],
default='localmongodb',
const='localmongodb',
nargs='?',
help='The backend to use. It can only be '
'"localmongodb", currently.')
# parser for managing elections
election_parser = subparsers.add_parser('election',
help='Manage elections.')
election_subparser = election_parser.add_subparsers(title='Action',
dest='action')
new_election_parser = election_subparser.add_parser('new',
help='Calls a new election.')
new_election_subparser = new_election_parser.add_subparsers(title='Election_Type',
dest='election_type')
# Parser factory for each type of new election, so we get a bunch of commands that look like this:
# election new <some_election_type> <args>...
for name, data in elections.items():
args = data['args']
generic_parser = new_election_subparser.add_parser(name, help=data['help'])
for arg, kwargs in args.items():
generic_parser.add_argument(arg, **kwargs)
approve_election_parser = election_subparser.add_parser('approve',
help='Approve the election.')
approve_election_parser.add_argument('election_id',
help='The election_id of the election.')
approve_election_parser.add_argument('--private-key',
dest='sk',
required=True,
help='Path to the private key of the election initiator.')
show_election_parser = election_subparser.add_parser('show',
help='Provides information about an election.')
show_election_parser.add_argument('election_id',
help='The transaction id of the election you wish to query.')
# parsers for showing/exporting config values
subparsers.add_parser('show-config',
help='Show the current configuration')
# parser for database-level commands
subparsers.add_parser('init',
help='Init the database')
subparsers.add_parser('drop',
help='Drop the database')
# parser for starting BigchainDB
start_parser = subparsers.add_parser('start',
help='Start BigchainDB')
start_parser.add_argument('--no-init',
dest='skip_initialize_database',
default=False,
action='store_true',
help='Skip database initialization')
subparsers.add_parser('tendermint-version',
help='Show the Tendermint supported versions')
start_parser.add_argument('--experimental-parallel-validation',
dest='experimental_parallel_validation',
default=False,
action='store_true',
help='💀 EXPERIMENTAL: parallelize validation for better throughput 💀')
return parser
def main():
utils.start(create_parser(), sys.argv[1:], globals())

View File

@ -0,0 +1,31 @@
elections = {
'upsert-validator': {
'help': 'Propose a change to the validator set',
'args': {
'public_key': {
'help': 'Public key of the validator to be added/updated/removed.'
},
'power': {
'type': int,
'help': 'The proposed power for the validator. Setting to 0 will remove the validator.'},
'node_id': {
'help': 'The node_id of the validator.'
},
'--private-key': {
'dest': 'sk',
'required': True,
'help': 'Path to the private key of the election initiator.'
}
}
},
'chain-migration': {
'help': 'Call for a halt to block production to allow for a version change across breaking changes.',
'args': {
'--private-key': {
'dest': 'sk',
'required': True,
'help': 'Path to the private key of the election initiator.'
}
}
}
}

View File

@ -1,57 +1,100 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Utility functions and basic common arguments
for ``argparse.ArgumentParser``.
"""
import argparse
from bigchaindb.common.exceptions import StartupError
import builtins
import functools
import multiprocessing as mp
import subprocess
import rethinkdb as r
import sys
import bigchaindb
from bigchaindb import db
import bigchaindb.config_utils
from bigchaindb.version import __version__
def start_rethinkdb():
"""Start RethinkDB as a child process and wait for it to be
available.
def configure_bigchaindb(command):
"""Decorator to be used by command line functions, such that the
configuration of bigchaindb is performed before the execution of
the command.
Raises:
:class:`~bigchaindb.common.exceptions.StartupError` if
RethinkDB cannot be started.
Args:
command: The command to decorate.
Returns:
The command wrapper function.
"""
@functools.wraps(command)
def configure(args):
config_from_cmdline = None
try:
if args.log_level is not None:
config_from_cmdline = {
'log': {
'level_console': args.log_level,
'level_logfile': args.log_level,
},
'server': {'loglevel': args.log_level},
}
except AttributeError:
pass
bigchaindb.config_utils.autoconfigure(
filename=args.config, config=config_from_cmdline, force=True)
command(args)
return configure
def _convert(value, default=None, convert=None):
def convert_bool(value):
if value.lower() in ('true', 't', 'yes', 'y'):
return True
if value.lower() in ('false', 'f', 'no', 'n'):
return False
raise ValueError('{} cannot be converted to bool'.format(value))
if value == '':
value = None
if convert is None:
if default is not None:
convert = type(default)
else:
convert = str
if convert == bool:
convert = convert_bool
if value is None:
return default
else:
return convert(value)
# We need this because `input` always prints on stdout, while it should print
# to stderr. It's a very old bug, check it out here:
# - https://bugs.python.org/issue1927
def input_on_stderr(prompt='', default=None, convert=None):
"""Output a string to stderr and wait for input.
Args:
prompt (str): the message to display.
default: the default value to return if the user
leaves the field empty
convert (callable): a callable to be used to convert
the value the user inserted. If None, the type of
``default`` will be used.
"""
proc = subprocess.Popen(['rethinkdb', '--bind', 'all'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True)
dbname = bigchaindb.config['database']['name']
line = ''
for line in proc.stdout:
if line.startswith('Server ready'):
# FIXME: seems like tables are not ready when the server is ready,
# that's why we need to query RethinkDB to know the state
# of the database. This code assumes the tables are ready
# when the database is ready. This seems a valid assumption.
try:
conn = db.get_conn()
# Before checking if the db is ready, we need to query
# the server to check if it contains that db
if r.db_list().contains(dbname).run(conn):
r.db(dbname).wait().run(conn)
except (r.ReqlOpFailedError, r.ReqlDriverError) as exc:
raise StartupError('Error waiting for the database `{}` '
'to be ready'.format(dbname)) from exc
return proc
# We are here when we exhaust the stdout of the process.
# The last `line` contains info about the error.
raise StartupError(line)
print(prompt, end='', file=sys.stderr)
value = builtins.input()
return _convert(value, default, convert)
def start(parser, argv, scope):
@ -101,6 +144,13 @@ base_parser.add_argument('-c', '--config',
help='Specify the location of the configuration file '
'(use "-" for stdout)')
# NOTE: this flag should not have any default value because that will override
# the environment variables provided to configure the logger.
base_parser.add_argument('-l', '--log-level',
type=str.upper, # convert to uppercase for comparison to choices
choices=['DEBUG', 'BENCHMARK', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
help='Log level')
base_parser.add_argument('-y', '--yes', '--yes-please',
action='store_true',
help='Assume "yes" as answer to all prompts and run '

View File

@ -1,19 +1,55 @@
# Separate all crypto code so that we can easily test several implementations
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# Separate all crypto code so that we can easily test several implementations
from collections import namedtuple
try:
from hashlib import sha3_256
except ImportError:
from sha3 import sha3_256
import sha3
from cryptoconditions import crypto
CryptoKeypair = namedtuple('CryptoKeypair', ('private_key', 'public_key'))
def hash_data(data):
"""Hash the provided data using SHA3-256"""
return sha3.sha3_256(data.encode()).hexdigest()
return sha3_256(data.encode()).hexdigest()
def generate_key_pair():
"""Generates a cryptographic key pair.
Returns:
:class:`~bigchaindb.common.crypto.CryptoKeypair`: A
:obj:`collections.namedtuple` with named fields
:attr:`~bigchaindb.common.crypto.CryptoKeypair.private_key` and
:attr:`~bigchaindb.common.crypto.CryptoKeypair.public_key`.
"""
# TODO FOR CC: Adjust interface so that this function becomes unnecessary
private_key, public_key = crypto.ed25519_generate_key_pair()
return private_key.decode(), public_key.decode()
return CryptoKeypair(
*(k.decode() for k in crypto.ed25519_generate_key_pair()))
PrivateKey = crypto.Ed25519SigningKey
PublicKey = crypto.Ed25519VerifyingKey
def key_pair_from_ed25519_key(hex_private_key):
"""Generate base58 encode public-private key pair from a hex encoded private key"""
priv_key = crypto.Ed25519SigningKey(bytes.fromhex(hex_private_key)[:32], encoding='bytes')
public_key = priv_key.get_verifying_key()
return CryptoKeypair(private_key=priv_key.encode(encoding='base58').decode('utf-8'),
public_key=public_key.encode(encoding='base58').decode('utf-8'))
def public_key_from_ed25519_key(hex_public_key):
"""Generate base58 public key from hex encoded public key"""
public_key = crypto.Ed25519VerifyingKey(bytes.fromhex(hex_public_key), encoding='bytes')
return public_key.encode(encoding='base58').decode('utf-8')

View File

@ -1,90 +1,115 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Custom exceptions used in the `bigchaindb` package.
"""
from bigchaindb.exceptions import BigchainDBError
class ConfigurationError(Exception):
class ConfigurationError(BigchainDBError):
"""Raised when there is a problem with server configuration"""
class OperationError(Exception):
class DatabaseDoesNotExist(BigchainDBError):
"""Raised when trying to delete the database but the db is not there"""
class StartupError(BigchainDBError):
"""Raised when there is an error starting up the system"""
class CyclicBlockchainError(BigchainDBError):
"""Raised when there is a cycle in the blockchain"""
class KeypairMismatchException(BigchainDBError):
"""Raised if the private key(s) provided for signing don't match any of the
current owner(s)
"""
class OperationError(BigchainDBError):
"""Raised when an operation cannot go through"""
class TransactionDoesNotExist(Exception):
"""Raised if the transaction is not in the database"""
################################################################################
# Validation errors
#
# All validation errors (which are handleable errors, not faults) should
# subclass ValidationError. However, where possible they should also have their
# own distinct type to differentiate them from other validation errors,
# especially for the purposes of testing.
class TransactionOwnerError(Exception):
"""Raised if a user tries to transfer a transaction they don't own"""
class DoubleSpend(Exception):
"""Raised if a double spend is found"""
class ValidationError(Exception):
class ValidationError(BigchainDBError):
"""Raised if there was an error in validation"""
class DoubleSpend(ValidationError):
"""Raised if a double spend is found"""
class InvalidHash(ValidationError):
"""Raised if there was an error checking the hash for a particular
operation"""
operation
"""
class SchemaValidationError(ValidationError):
"""Raised if there was any error validating an object's schema"""
class InvalidSignature(Exception):
class InvalidSignature(ValidationError):
"""Raised if there was an error checking the signature for a particular
operation"""
operation
"""
class DatabaseAlreadyExists(Exception):
"""Raised when trying to create the database but the db is already there"""
class DatabaseDoesNotExist(Exception):
"""Raised when trying to delete the database but the db is not there"""
class KeypairNotFoundException(Exception):
"""Raised if operation cannot proceed because the keypair was not given"""
class KeypairMismatchException(Exception):
"""Raised if the private key(s) provided for signing don't match any of the
current owner(s)"""
class StartupError(Exception):
"""Raised when there is an error starting up the system"""
class ImproperVoteError(Exception):
"""Raised if a vote is not constructed correctly, or signed incorrectly"""
class MultipleVotesError(Exception):
"""Raised if a voter has voted more than once"""
class GenesisBlockAlreadyExistsError(Exception):
"""Raised when trying to create the already existing genesis block"""
class CyclicBlockchainError(Exception):
"""Raised when there is a cycle in the blockchain"""
class TransactionNotInValidBlock(Exception):
"""Raised when a transfer transaction is attempting to fulfill the
conditions of a transaction that is in an invalid or undecided block"""
class AssetIdMismatch(Exception):
class AssetIdMismatch(ValidationError):
"""Raised when multiple transaction inputs related to different assets"""
class AmountError(Exception):
"""Raised when the amount of a non-divisible asset is different then 1"""
class AmountError(ValidationError):
"""Raised when there is a problem with a transaction's output amounts"""
class InputDoesNotExist(ValidationError):
"""Raised if a transaction input does not exist"""
class TransactionOwnerError(ValidationError):
"""Raised if a user tries to transfer a transaction they don't own"""
class DuplicateTransaction(ValidationError):
"""Raised if a duplicated transaction is found"""
class ThresholdTooDeep(ValidationError):
"""Raised if threshold condition is too deep"""
class MultipleValidatorOperationError(ValidationError):
"""Raised when a validator update pending but new request is submited"""
class MultipleInputsError(ValidationError):
"""Raised if there were multiple inputs when only one was expected"""
class InvalidProposer(ValidationError):
"""Raised if the public key is not a part of the validator set"""
class UnequalValidatorSet(ValidationError):
"""Raised if the validator sets differ"""
class InvalidPowerChange(ValidationError):
"""Raised if proposed power change in validator set is >=1/3 total power"""
class InvalidPublicKey(ValidationError):
"""Raised if public key doesn't match the encoding type"""

View File

@ -0,0 +1,58 @@
import functools
import codecs
from functools import lru_cache
class HDict(dict):
def __hash__(self):
return hash(codecs.decode(self['id'], 'hex'))
@lru_cache(maxsize=16384)
def from_dict(func, *args, **kwargs):
return func(*args, **kwargs)
def memoize_from_dict(func):
@functools.wraps(func)
def memoized_func(*args, **kwargs):
if args[1].get('id', None):
args = list(args)
args[1] = HDict(args[1])
new_args = tuple(args)
return from_dict(func, *new_args, **kwargs)
else:
return func(*args, **kwargs)
return memoized_func
class ToDictWrapper():
def __init__(self, tx):
self.tx = tx
def __eq__(self, other):
return self.tx.id == other.tx.id
def __hash__(self):
return hash(self.tx.id)
@lru_cache(maxsize=16384)
def to_dict(func, tx_wrapped):
return func(tx_wrapped.tx)
def memoize_to_dict(func):
@functools.wraps(func)
def memoized_func(*args, **kwargs):
if args[0].id:
return to_dict(func, ToDictWrapper(args[0]))
else:
return func(*args, **kwargs)
return memoized_func

View File

@ -1,13 +1,37 @@
<!---
Copyright © 2020 Interplanetary Database Association e.V.,
BigchainDB and IPDB software contributors.
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Introduction
This directory contains the schemas for the different JSON documents BigchainDB uses.
The aim is to provide:
- a strict definition/documentation of the data structures used in BigchainDB
- a language independent tool to validate the structure of incoming/outcoming
data (there are several ready to use
[implementations](http://json-schema.org/implementations.html) written in
different languages)
- a strict definition of the data structures used in BigchainDB,
- a language-independent tool to validate the structure of incoming/outcoming
data. (There are several ready to use
[implementations](http://json-schema.org/implementations.html) written in
different languages.)
## Sources
The files defining the JSON Schema for transactions (`transaction_*.yaml`)
are based on the [BigchainDB Transactions Specs](https://github.com/bigchaindb/BEPs/tree/master/tx-specs).
If you want to add a new transaction version,
you must write a spec for it first.
(You can't change the JSON Schema files for old versions.
Those were used to validate old transactions
and are needed to re-check those transactions.)
There used to be a file defining the JSON Schema for votes, named `vote.yaml`.
It was used by BigchainDB version 1.3.0 and earlier.
If you want a copy of the latest `vote.yaml` file,
then you can get it from the version 1.3.0 release on GitHub, at
[https://github.com/bigchaindb/bigchaindb/blob/v1.3.0/bigchaindb/common/schema/vote.yaml](https://github.com/bigchaindb/bigchaindb/blob/v1.3.0/bigchaindb/common/schema/vote.yaml).
## Learn about JSON Schema

View File

@ -1,24 +1,82 @@
""" Schema validation related functions and data """
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Schema validation related functions and data"""
import os.path
import logging
import jsonschema
import yaml
import rapidjson
from bigchaindb.common.exceptions import SchemaValidationError
TX_SCHEMA_PATH = os.path.join(os.path.dirname(__file__), 'transaction.yaml')
with open(TX_SCHEMA_PATH) as handle:
TX_SCHEMA_YAML = handle.read()
TX_SCHEMA = yaml.safe_load(TX_SCHEMA_YAML)
logger = logging.getLogger(__name__)
def validate_transaction_schema(tx_body):
""" Validate a transaction dict against a schema """
def _load_schema(name, path=__file__):
"""Load a schema from disk"""
path = os.path.join(os.path.dirname(path), name + '.yaml')
with open(path) as handle:
schema = yaml.safe_load(handle)
fast_schema = rapidjson.Validator(rapidjson.dumps(schema))
return path, (schema, fast_schema)
TX_SCHEMA_VERSION = 'v2.0'
TX_SCHEMA_PATH, TX_SCHEMA_COMMON = _load_schema('transaction_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_CREATE = _load_schema('transaction_create_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_TRANSFER = _load_schema('transaction_transfer_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_VALIDATOR_ELECTION = _load_schema('transaction_validator_election_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_CHAIN_MIGRATION_ELECTION = _load_schema('transaction_chain_migration_election_' +
TX_SCHEMA_VERSION)
_, TX_SCHEMA_VOTE = _load_schema('transaction_vote_' + TX_SCHEMA_VERSION)
def _validate_schema(schema, body):
"""Validate data against a schema"""
# Note
#
# Schema validation is currently the major CPU bottleneck of
# BigchainDB. the `jsonschema` library validates python data structures
# directly and produces nice error messages, but validation takes 4+ ms
# per transaction which is pretty slow. The rapidjson library validates
# much faster at 1.5ms, however it produces _very_ poor error messages.
# For this reason we use both, rapidjson as an optimistic pathway and
# jsonschema as a fallback in case there is a failure, so we can produce
# a helpful error message.
try:
jsonschema.validate(tx_body, TX_SCHEMA)
except jsonschema.ValidationError as exc:
raise SchemaValidationError(str(exc))
schema[1](rapidjson.dumps(body))
except ValueError as exc:
try:
jsonschema.validate(body, schema[0])
except jsonschema.ValidationError as exc2:
raise SchemaValidationError(str(exc2)) from exc2
logger.warning('code problem: jsonschema did not raise an exception, wheras rapidjson raised %s', exc)
raise SchemaValidationError(str(exc)) from exc
__all__ = ['TX_SCHEMA', 'TX_SCHEMA_YAML', 'validate_transaction_schema']
def validate_transaction_schema(tx):
"""Validate a transaction dict.
TX_SCHEMA_COMMON contains properties that are common to all types of
transaction. TX_SCHEMA_[TRANSFER|CREATE] add additional constraints on top.
"""
_validate_schema(TX_SCHEMA_COMMON, tx)
if tx['operation'] == 'TRANSFER':
_validate_schema(TX_SCHEMA_TRANSFER, tx)
else:
_validate_schema(TX_SCHEMA_CREATE, tx)

View File

@ -1,261 +0,0 @@
---
"$schema": "http://json-schema.org/draft-04/schema#"
id: "http://www.bigchaindb.com/schema/transaction.json"
type: object
additionalProperties: false
title: Transaction Schema
description: |
This is the outer transaction wrapper. It contains the ID, version and the body of the transaction, which is also called ``transaction``.
required:
- id
- transaction
- version
properties:
id:
"$ref": "#/definitions/sha3_hexdigest"
description: |
A sha3 digest of the transaction. The ID is calculated by removing all
derived hashes and signatures from the transaction, serializing it to
JSON with keys in sorted order and then hashing the resulting string
with sha3.
transaction:
type: object
title: transaction
description: |
See: `Transaction Body`_.
additionalProperties: false
required:
- fulfillments
- conditions
- operation
- metadata
- asset
properties:
operation:
"$ref": "#/definitions/operation"
asset:
"$ref": "#/definitions/asset"
description: |
Description of the asset being transacted.
See: `Asset`_.
fulfillments:
type: array
title: "Fulfillments list"
description: |
Array of the fulfillments (inputs) of a transaction.
See: Fulfillment_.
items:
"$ref": "#/definitions/fulfillment"
conditions:
type: array
description: |
Array of conditions (outputs) provided by this transaction.
See: Condition_.
items:
"$ref": "#/definitions/condition"
metadata:
"$ref": "#/definitions/metadata"
description: |
User provided transaction metadata. This field may be ``null`` or may
contain an id and an object with freeform metadata.
See: `Metadata`_.
version:
type: integer
minimum: 1
maximum: 1
description: |
BigchainDB transaction schema version.
definitions:
offset:
type: integer
minimum: 0
base58:
pattern: "[1-9a-zA-Z^OIl]{43,44}"
type: string
owners_list:
anyOf:
- type: array
items:
"$ref": "#/definitions/base58"
- type: 'null'
sha3_hexdigest:
pattern: "[0-9a-f]{64}"
type: string
uuid4:
pattern: "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}"
type: string
description: |
A `UUID <https://tools.ietf.org/html/rfc4122.html>`_
of type 4 (random).
operation:
type: string
description: |
Type of the transaction:
A ``CREATE`` transaction creates an asset in BigchainDB. This
transaction has outputs (conditions) but no inputs (fulfillments),
so a dummy fulfillment is used.
A ``TRANSFER`` transaction transfers ownership of an asset, by providing
fulfillments to conditions of earlier transactions.
A ``GENESIS`` transaction is a special case transaction used as the
sole member of the first block in a BigchainDB ledger.
enum:
- CREATE
- TRANSFER
- GENESIS
asset:
type: object
description: |
Description of the asset being transacted. In the case of a ``TRANSFER``
transaction, this field contains only the ID of asset. In the case
of a ``CREATE`` transaction, this field may contain properties:
additionalProperties: false
required:
- id
properties:
id:
"$ref": "#/definitions/uuid4"
divisible:
type: boolean
description: |
Whether or not the asset has a quantity that may be partially spent.
updatable:
type: boolean
description: |
Whether or not the description of the asset may be updated. Defaults to false.
refillable:
type: boolean
description: |
Whether the amount of the asset can change after its creation. Defaults to false.
data:
description: |
User provided metadata associated with the asset. May also be ``null``.
anyOf:
- type: object
additionalProperties: true
- type: 'null'
condition:
type: object
description: |
An output of a transaction. A condition describes a quantity of an asset
and what conditions must be met in order for it to be fulfilled. See also:
fulfillment_.
additionalProperties: false
required:
- owners_after
- condition
- amount
properties:
cid:
"$ref": "#/definitions/offset"
description: |
Index of this condition's appearance in the `Transaction.conditions`_
array. In a transaction with 2 conditions, the ``cid``s will be 0 and 1.
condition:
description: |
Body of the condition. Has the properties:
- **details**: Details of the condition.
- **uri**: Condition encoded as an ASCII string.
type: object
additionalProperties: false
required:
- details
- uri
properties:
details:
type: object
additionalProperties: true
uri:
type: string
pattern: "^cc:([1-9a-f][0-9a-f]{0,3}|0):[1-9a-f][0-9a-f]{0,15}:[a-zA-Z0-9_-]{0,86}:([1-9][0-9]{0,17}|0)$"
owners_after:
"$ref": "#/definitions/owners_list"
description: |
List of public keys associated with asset ownership at the time
of the transaction.
amount:
type: integer
description: |
Integral amount of the asset represented by this condition.
In the case of a non divisible asset, this will always be 1.
fulfillment:
type: "object"
description:
A fulfillment is an input to a transaction, named as such because it
fulfills a condition of a previous transaction. In the case of a
``CREATE`` transaction, a fulfillment may provide no ``input``.
additionalProperties: false
required:
- owners_before
- input
- fulfillment
properties:
fid:
"$ref": "#/definitions/offset"
description: |
The offset of the fulfillment within the fulfillents array.
owners_before:
"$ref": "#/definitions/owners_list"
description: |
List of public keys of the previous owners of the asset.
fulfillment:
anyOf:
- type: object
additionalProperties: false
properties:
bitmask:
type: integer
public_key:
type: string
type:
type: string
signature:
anyOf:
- type: string
- type: 'null'
type_id:
type: integer
description: |
Fulfillment of a condition_, or put a different way, this is a
payload that satisfies a condition in order to spend the associated
asset.
- type: string
pattern: "^cf:([1-9a-f][0-9a-f]{0,3}|0):[a-zA-Z0-9_-]*$"
input:
anyOf:
- type: 'object'
description: |
Reference to a condition of a previous transaction
additionalProperties: false
properties:
cid:
"$ref": "#/definitions/offset"
txid:
"$ref": "#/definitions/sha3_hexdigest"
- type: 'null'
metadata:
anyOf:
- type: object
description: |
User provided transaction metadata. This field may be ``null`` or may
contain an id and an object with freeform metadata.
additionalProperties: false
required:
- id
- data
properties:
id:
"$ref": "#/definitions/uuid4"
data:
type: object
description: |
User provided transaction metadata.
additionalProperties: true
- type: 'null'

View File

@ -0,0 +1,45 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Chain Migration Election Schema - Propose a halt in block production to allow for a version change
required:
- operation
- asset
- outputs
properties:
operation:
type: string
value: "CHAIN_MIGRATION_ELECTION"
asset:
additionalProperties: false
properties:
data:
additionalProperties: false
properties:
seed:
type: string
required:
- data
outputs:
type: array
items:
"$ref": "#/definitions/output"
definitions:
output:
type: object
properties:
condition:
type: object
required:
- uri
properties:
uri:
type: string
pattern: "^ni:///sha-256;([a-zA-Z0-9_-]{0,86})[?]\
(fpt=ed25519-sha-256(&)?|cost=[0-9]+(&)?|\
subtypes=ed25519-sha-256(&)?){2,3}$"

View File

@ -0,0 +1,35 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Transaction Schema - CREATE/GENESIS specific constraints
required:
- asset
- inputs
properties:
asset:
additionalProperties: false
properties:
data:
anyOf:
- type: object
additionalProperties: true
- type: 'null'
required:
- data
inputs:
type: array
title: "Transaction inputs"
maxItems: 1
minItems: 1
items:
type: "object"
required:
- fulfills
properties:
fulfills:
type: "null"

View File

@ -0,0 +1,35 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Transaction Schema - CREATE specific constraints
required:
- asset
- inputs
properties:
asset:
additionalProperties: false
properties:
data:
anyOf:
- type: object
additionalProperties: true
- type: 'null'
required:
- data
inputs:
type: array
title: "Transaction inputs"
maxItems: 1
minItems: 1
items:
type: "object"
required:
- fulfills
properties:
fulfills:
type: "null"

View File

@ -0,0 +1,34 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Transaction Schema - TRANSFER specific properties
required:
- asset
properties:
asset:
additionalProperties: false
properties:
id:
"$ref": "#/definitions/sha3_hexdigest"
required:
- id
inputs:
type: array
title: "Transaction inputs"
minItems: 1
items:
type: "object"
required:
- fulfills
properties:
fulfills:
type: "object"
definitions:
sha3_hexdigest:
pattern: "[0-9a-f]{64}"
type: string

View File

@ -0,0 +1,34 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Transaction Schema - TRANSFER specific properties
required:
- asset
properties:
asset:
additionalProperties: false
properties:
id:
"$ref": "#/definitions/sha3_hexdigest"
required:
- id
inputs:
type: array
title: "Transaction inputs"
minItems: 1
items:
type: "object"
required:
- fulfills
properties:
fulfills:
type: "object"
definitions:
sha3_hexdigest:
pattern: "[0-9a-f]{64}"
type: string

View File

@ -0,0 +1,168 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
additionalProperties: false
title: Transaction Schema
required:
- id
- inputs
- outputs
- operation
- metadata
- asset
- version
properties:
id:
anyOf:
- "$ref": "#/definitions/sha3_hexdigest"
- type: 'null'
operation:
"$ref": "#/definitions/operation"
asset:
"$ref": "#/definitions/asset"
inputs:
type: array
title: "Transaction inputs"
items:
"$ref": "#/definitions/input"
outputs:
type: array
items:
"$ref": "#/definitions/output"
metadata:
"$ref": "#/definitions/metadata"
version:
type: string
pattern: "^1\\.0$"
definitions:
offset:
type: integer
minimum: 0
base58:
pattern: "[1-9a-zA-Z^OIl]{43,44}"
type: string
public_keys:
anyOf:
- type: array
items:
"$ref": "#/definitions/base58"
- type: 'null'
sha3_hexdigest:
pattern: "[0-9a-f]{64}"
type: string
uuid4:
pattern: "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}"
type: string
operation:
type: string
enum:
- CREATE
- TRANSFER
- GENESIS
asset:
type: object
additionalProperties: false
properties:
id:
"$ref": "#/definitions/sha3_hexdigest"
data:
anyOf:
- type: object
additionalProperties: true
- type: 'null'
output:
type: object
additionalProperties: false
required:
- amount
- condition
- public_keys
properties:
amount:
type: string
pattern: "^[0-9]{1,20}$"
condition:
type: object
additionalProperties: false
required:
- details
- uri
properties:
details:
"$ref": "#/definitions/condition_details"
uri:
type: string
pattern: "^ni:///sha-256;([a-zA-Z0-9_-]{0,86})[?]\
(fpt=(ed25519|threshold)-sha-256(&)?|cost=[0-9]+(&)?|\
subtypes=ed25519-sha-256(&)?){2,3}$"
public_keys:
"$ref": "#/definitions/public_keys"
input:
type: "object"
additionalProperties: false
required:
- owners_before
- fulfillment
properties:
owners_before:
"$ref": "#/definitions/public_keys"
fulfillment:
anyOf:
- type: string
pattern: "^[a-zA-Z0-9_-]*$"
- "$ref": "#/definitions/condition_details"
fulfills:
anyOf:
- type: 'object'
additionalProperties: false
required:
- output_index
- transaction_id
properties:
output_index:
"$ref": "#/definitions/offset"
transaction_id:
"$ref": "#/definitions/sha3_hexdigest"
- type: 'null'
metadata:
anyOf:
- type: object
additionalProperties: true
minProperties: 1
- type: 'null'
condition_details:
anyOf:
- type: object
additionalProperties: false
required:
- type
- public_key
properties:
type:
type: string
pattern: "^ed25519-sha-256$"
public_key:
"$ref": "#/definitions/base58"
- type: object
additionalProperties: false
required:
- type
- threshold
- subconditions
properties:
type:
type: "string"
pattern: "^threshold-sha-256$"
threshold:
type: integer
minimum: 1
maximum: 100
subconditions:
type: array
items:
"$ref": "#/definitions/condition_details"

View File

@ -0,0 +1,170 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
additionalProperties: false
title: Transaction Schema
required:
- id
- inputs
- outputs
- operation
- metadata
- asset
- version
properties:
id:
anyOf:
- "$ref": "#/definitions/sha3_hexdigest"
- type: 'null'
operation:
"$ref": "#/definitions/operation"
asset:
"$ref": "#/definitions/asset"
inputs:
type: array
title: "Transaction inputs"
items:
"$ref": "#/definitions/input"
outputs:
type: array
items:
"$ref": "#/definitions/output"
metadata:
"$ref": "#/definitions/metadata"
version:
type: string
pattern: "^2\\.0$"
definitions:
offset:
type: integer
minimum: 0
base58:
pattern: "[1-9a-zA-Z^OIl]{43,44}"
type: string
public_keys:
anyOf:
- type: array
items:
"$ref": "#/definitions/base58"
- type: 'null'
sha3_hexdigest:
pattern: "[0-9a-f]{64}"
type: string
uuid4:
pattern: "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}"
type: string
operation:
type: string
enum:
- CREATE
- TRANSFER
- VALIDATOR_ELECTION
- CHAIN_MIGRATION_ELECTION
- VOTE
asset:
type: object
additionalProperties: false
properties:
id:
"$ref": "#/definitions/sha3_hexdigest"
data:
anyOf:
- type: object
additionalProperties: true
- type: 'null'
output:
type: object
additionalProperties: false
required:
- amount
- condition
- public_keys
properties:
amount:
type: string
pattern: "^[0-9]{1,20}$"
condition:
type: object
additionalProperties: false
required:
- details
- uri
properties:
details:
"$ref": "#/definitions/condition_details"
uri:
type: string
pattern: "^ni:///sha-256;([a-zA-Z0-9_-]{0,86})[?]\
(fpt=(ed25519|threshold)-sha-256(&)?|cost=[0-9]+(&)?|\
subtypes=ed25519-sha-256(&)?){2,3}$"
public_keys:
"$ref": "#/definitions/public_keys"
input:
type: "object"
additionalProperties: false
required:
- owners_before
- fulfillment
properties:
owners_before:
"$ref": "#/definitions/public_keys"
fulfillment:
anyOf:
- type: string
pattern: "^[a-zA-Z0-9_-]*$"
- "$ref": "#/definitions/condition_details"
fulfills:
anyOf:
- type: 'object'
additionalProperties: false
required:
- output_index
- transaction_id
properties:
output_index:
"$ref": "#/definitions/offset"
transaction_id:
"$ref": "#/definitions/sha3_hexdigest"
- type: 'null'
metadata:
anyOf:
- type: object
additionalProperties: true
minProperties: 1
- type: 'null'
condition_details:
anyOf:
- type: object
additionalProperties: false
required:
- type
- public_key
properties:
type:
type: string
pattern: "^ed25519-sha-256$"
public_key:
"$ref": "#/definitions/base58"
- type: object
additionalProperties: false
required:
- type
- threshold
- subconditions
properties:
type:
type: "string"
pattern: "^threshold-sha-256$"
threshold:
type: integer
minimum: 1
maximum: 100
subconditions:
type: array
items:
"$ref": "#/definitions/condition_details"

View File

@ -0,0 +1,68 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Validator Election Schema - Propose a change to validator set
required:
- operation
- asset
- outputs
properties:
operation:
type: string
value: "VALIDATOR_ELECTION"
asset:
additionalProperties: false
properties:
data:
additionalProperties: false
properties:
node_id:
type: string
seed:
type: string
public_key:
type: object
additionalProperties: false
required:
- value
- type
properties:
value:
type: string
type:
type: string
enum:
- ed25519-base16
- ed25519-base32
- ed25519-base64
power:
"$ref": "#/definitions/positiveInteger"
required:
- node_id
- public_key
- power
required:
- data
outputs:
type: array
items:
"$ref": "#/definitions/output"
definitions:
output:
type: object
properties:
condition:
type: object
required:
- uri
properties:
uri:
type: string
pattern: "^ni:///sha-256;([a-zA-Z0-9_-]{0,86})[?]\
(fpt=ed25519-sha-256(&)?|cost=[0-9]+(&)?|\
subtypes=ed25519-sha-256(&)?){2,3}$"

View File

@ -0,0 +1,34 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
"$schema": "http://json-schema.org/draft-04/schema#"
type: object
title: Vote Schema - Vote on an election
required:
- operation
- outputs
properties:
operation:
type: string
value: "VOTE"
outputs:
type: array
items:
"$ref": "#/definitions/output"
definitions:
output:
type: object
properties:
condition:
type: object
required:
- uri
properties:
uri:
type: string
pattern: "^ni:///sha-256;([a-zA-Z0-9_-]{0,86})[?]\
(fpt=ed25519-sha-256(&)?|cost=[0-9]+(&)?|\
subtypes=ed25519-sha-256(&)?){2,3}$"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
BROADCAST_TX_COMMIT = 'broadcast_tx_commit'
BROADCAST_TX_ASYNC = 'broadcast_tx_async'
BROADCAST_TX_SYNC = 'broadcast_tx_sync'

View File

@ -1,48 +0,0 @@
import time
import rapidjson
def gen_timestamp():
"""The Unix time, rounded to the nearest second.
See https://en.wikipedia.org/wiki/Unix_time
Returns:
str: the Unix time
"""
return str(round(time.time()))
def serialize(data):
"""Serialize a dict into a JSON formatted string.
This function enforces rules like the separator and order of keys.
This ensures that all dicts are serialized in the same way.
This is specially important for hashing data. We need to make sure that
everyone serializes their data in the same way so that we do not have
hash mismatches for the same structure due to serialization
differences.
Args:
data (dict): dict to serialize
Returns:
str: JSON formatted string
"""
return rapidjson.dumps(data, skipkeys=False, ensure_ascii=False,
sort_keys=True)
def deserialize(data):
"""Deserialize a JSON formatted string into a dict.
Args:
data (str): JSON formatted string.
Returns:
dict: dict resulting from the serialization of a JSON formatted
string.
"""
return rapidjson.loads(data)

165
bigchaindb/common/utils.py Normal file
View File

@ -0,0 +1,165 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import time
import re
import rapidjson
import bigchaindb
from bigchaindb.common.exceptions import ValidationError
def gen_timestamp():
"""The Unix time, rounded to the nearest second.
See https://en.wikipedia.org/wiki/Unix_time
Returns:
str: the Unix time
"""
return str(round(time.time()))
def serialize(data):
"""Serialize a dict into a JSON formatted string.
This function enforces rules like the separator and order of keys.
This ensures that all dicts are serialized in the same way.
This is specially important for hashing data. We need to make sure that
everyone serializes their data in the same way so that we do not have
hash mismatches for the same structure due to serialization
differences.
Args:
data (dict): dict to serialize
Returns:
str: JSON formatted string
"""
return rapidjson.dumps(data, skipkeys=False, ensure_ascii=False,
sort_keys=True)
def deserialize(data):
"""Deserialize a JSON formatted string into a dict.
Args:
data (str): JSON formatted string.
Returns:
dict: dict resulting from the serialization of a JSON formatted
string.
"""
return rapidjson.loads(data)
def validate_txn_obj(obj_name, obj, key, validation_fun):
"""Validate value of `key` in `obj` using `validation_fun`.
Args:
obj_name (str): name for `obj` being validated.
obj (dict): dictionary object.
key (str): key to be validated in `obj`.
validation_fun (function): function used to validate the value
of `key`.
Returns:
None: indicates validation successful
Raises:
ValidationError: `validation_fun` will raise exception on failure
"""
backend = bigchaindb.config['database']['backend']
if backend == 'localmongodb':
data = obj.get(key, {})
if isinstance(data, dict):
validate_all_keys_in_obj(obj_name, data, validation_fun)
elif isinstance(data, list):
validate_all_items_in_list(obj_name, data, validation_fun)
def validate_all_items_in_list(obj_name, data, validation_fun):
for item in data:
if isinstance(item, dict):
validate_all_keys_in_obj(obj_name, item, validation_fun)
elif isinstance(item, list):
validate_all_items_in_list(obj_name, item, validation_fun)
def validate_all_keys_in_obj(obj_name, obj, validation_fun):
"""Validate all (nested) keys in `obj` by using `validation_fun`.
Args:
obj_name (str): name for `obj` being validated.
obj (dict): dictionary object.
validation_fun (function): function used to validate the value
of `key`.
Returns:
None: indicates validation successful
Raises:
ValidationError: `validation_fun` will raise this error on failure
"""
for key, value in obj.items():
validation_fun(obj_name, key)
if isinstance(value, dict):
validate_all_keys_in_obj(obj_name, value, validation_fun)
elif isinstance(value, list):
validate_all_items_in_list(obj_name, value, validation_fun)
def validate_all_values_for_key_in_obj(obj, key, validation_fun):
"""Validate value for all (nested) occurrence of `key` in `obj`
using `validation_fun`.
Args:
obj (dict): dictionary object.
key (str): key whose value is to be validated.
validation_fun (function): function used to validate the value
of `key`.
Raises:
ValidationError: `validation_fun` will raise this error on failure
"""
for vkey, value in obj.items():
if vkey == key:
validation_fun(value)
elif isinstance(value, dict):
validate_all_values_for_key_in_obj(value, key, validation_fun)
elif isinstance(value, list):
validate_all_values_for_key_in_list(value, key, validation_fun)
def validate_all_values_for_key_in_list(input_list, key, validation_fun):
for item in input_list:
if isinstance(item, dict):
validate_all_values_for_key_in_obj(item, key, validation_fun)
elif isinstance(item, list):
validate_all_values_for_key_in_list(item, key, validation_fun)
def validate_key(obj_name, key):
"""Check if `key` contains ".", "$" or null characters.
https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names
Args:
obj_name (str): object name to use when raising exception
key (str): key to validated
Returns:
None: validation successful
Raises:
ValidationError: will raise exception in case of regex match.
"""
if re.search(r'^[$]|\.|\x00', key):
error_str = ('Invalid key name "{}" in {} object. The '
'key name cannot contain characters '
'".", "$" or null characters').format(key, obj_name)
raise ValidationError(error_str)

View File

@ -1,3 +1,8 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Utils for reading and setting configuration settings.
The value of each BigchainDB Server configuration setting is
@ -15,12 +20,16 @@ import os
import copy
import json
import logging
import collections
import collections.abc
from functools import lru_cache
from pkg_resources import iter_entry_points, ResolutionError
from bigchaindb.common import exceptions
import bigchaindb
from bigchaindb.validation import BaseValidationRules
# TODO: move this to a proper configuration file for logging
logging.getLogger('requests').setLevel(logging.WARNING)
@ -43,7 +52,7 @@ def map_leafs(func, mapping):
path = []
for key, val in mapping.items():
if isinstance(val, collections.Mapping):
if isinstance(val, collections.abc.Mapping):
_inner(val, path + [key])
else:
mapping[key] = func(val, path=path+[key])
@ -71,7 +80,7 @@ def update(d, u):
mapping: An updated version of d (updated by u).
"""
for k, v in u.items():
if isinstance(v, collections.Mapping):
if isinstance(v, collections.abc.Mapping):
r = update(d.get(k, {}), v)
d[k] = r
else:
@ -104,7 +113,7 @@ def file_config(filename=None):
'Failed to parse the JSON configuration from `{}`, {}'.format(filename, err)
)
logger.info('Configuration loaded from `{}`'.format(filename))
logger.info('Configuration loaded from `{}`'.format(filename))
return config
@ -124,6 +133,7 @@ def env_config(config):
def load_from_env(value, path):
var_name = CONFIG_SEP.join([CONFIG_PREFIX] + list(map(lambda s: s.upper(), path)))
return os.environ.get(var_name, value)
return map_leafs(load_from_env, config)
@ -131,7 +141,8 @@ def env_config(config):
def update_types(config, reference, list_sep=':'):
"""Return a new configuration where all the values types
are aligned with the ones in the default configuration"""
are aligned with the ones in the default configuration
"""
def _coerce(current, value):
# Coerce a value to the `current` type.
@ -216,11 +227,15 @@ def write_config(config, filename=None):
json.dump(config, f, indent=4)
def is_configured():
return bool(bigchaindb.config.get('CONFIGURED'))
def autoconfigure(filename=None, config=None, force=False):
"""Run ``file_config`` and ``env_config`` if the module has not
been initialized."""
if not force and bigchaindb.config.get('CONFIGURED'):
been initialized.
"""
if not force and is_configured():
logger.debug('System already configured, skipping autoconfiguration')
return
@ -231,12 +246,63 @@ def autoconfigure(filename=None, config=None, force=False):
try:
newconfig = update(newconfig, file_config(filename=filename))
except FileNotFoundError as e:
logger.warning('Cannot find config file `%s`.' % e.filename)
if filename:
raise
else:
logger.info('Cannot find config file `%s`.' % e.filename)
# override configuration with env variables
newconfig = env_config(newconfig)
if config:
newconfig = update(newconfig, config)
set_config(newconfig) # sets bigchaindb.config
@lru_cache()
def load_validation_plugin(name=None):
"""Find and load the chosen validation plugin.
Args:
name (string): the name of the entry_point, as advertised in the
setup.py of the providing package.
Returns:
an uninstantiated subclass of ``bigchaindb.validation.AbstractValidationRules``
"""
if not name:
return BaseValidationRules
# TODO: This will return the first plugin with group `bigchaindb.validation`
# and name `name` in the active WorkingSet.
# We should probably support Requirements specs in the config, e.g.
# validation_plugin: 'my-plugin-package==0.0.1;default'
plugin = None
for entry_point in iter_entry_points('bigchaindb.validation', name):
plugin = entry_point.load()
# No matching entry_point found
if not plugin:
raise ResolutionError(
'No plugin found in group `bigchaindb.validation` with name `{}`'.
format(name))
# Is this strictness desireable?
# It will probably reduce developer headaches in the wild.
if not issubclass(plugin, (BaseValidationRules,)):
raise TypeError('object of type "{}" does not implement `bigchaindb.'
'validation.BaseValidationRules`'.format(type(plugin)))
return plugin
def load_events_plugins(names=None):
plugins = []
if names is None:
return plugins
for name in names:
for entry_point in iter_entry_points('bigchaindb.events', name):
plugins.append((name, entry_point.load()))
return plugins

View File

@ -1,28 +0,0 @@
from bigchaindb.util import verify_vote_signature
class BaseConsensusRules():
"""Base consensus rules for Bigchain.
"""
@staticmethod
def validate_transaction(bigchain, transaction):
"""See :meth:`bigchaindb.models.Transaction.validate`
for documentation.
"""
return transaction.validate(bigchain)
@staticmethod
def validate_block(bigchain, block):
"""See :meth:`bigchaindb.models.Block.validate` for documentation."""
return block.validate(bigchain)
@staticmethod
def verify_vote_signature(voters, signed_vote):
"""Verify the signature of a vote.
Refer to the documentation of
:func:`bigchaindb.util.verify_signature`.
"""
return verify_vote_signature(voters, signed_vote)

View File

@ -1,720 +1,271 @@
import random
import math
import collections
from time import time
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from itertools import compress
from bigchaindb.common import crypto, exceptions
from bigchaindb.common.util import gen_timestamp, serialize
from bigchaindb.common.transaction import TransactionLink, Asset
"""This module contains all the goodness to integrate BigchainDB
with Tendermint.
"""
import logging
import sys
import bigchaindb
from abci.application import BaseApplication
from abci import CodeTypeOk
from bigchaindb.db.utils import Connection, get_backend
from bigchaindb import config_utils, util
from bigchaindb.consensus import BaseConsensusRules
from bigchaindb.models import Block, Transaction
from bigchaindb import BigchainDB
from bigchaindb.elections.election import Election
from bigchaindb.version import __tm_supported_versions__
from bigchaindb.utils import tendermint_version_is_compatible
from bigchaindb.tendermint_utils import (decode_transaction,
calculate_hash)
from bigchaindb.lib import Block
import bigchaindb.upsert_validator.validator_utils as vutils
from bigchaindb.events import EventTypes, Event
class Bigchain(object):
"""Bigchain API
CodeTypeError = 1
logger = logging.getLogger(__name__)
Create, read, sign, write transactions to the database
class App(BaseApplication):
"""Bridge between BigchainDB and Tendermint.
The role of this class is to expose the BigchainDB
transaction logic to Tendermint Core.
"""
# return if a block has been voted invalid
BLOCK_INVALID = 'invalid'
# return if a block is valid, or tx is in valid block
BLOCK_VALID = TX_VALID = 'valid'
# return if block is undecided, or tx is in undecided block
BLOCK_UNDECIDED = TX_UNDECIDED = 'undecided'
# return if transaction is in backlog
TX_IN_BACKLOG = 'backlog'
def __init__(self, abci, bigchaindb=None, events_queue=None,):
super().__init__(abci)
self.events_queue = events_queue
self.bigchaindb = bigchaindb or BigchainDB()
self.block_txn_ids = []
self.block_txn_hash = ''
self.block_transactions = []
self.validators = None
self.new_height = None
self.chain = self.bigchaindb.get_latest_abci_chain()
def __init__(self, host=None, port=None, dbname=None, backend=None,
public_key=None, private_key=None, keyring=[],
backlog_reassign_delay=None):
"""Initialize the Bigchain instance
def log_abci_migration_error(self, chain_id, validators):
logger.error('An ABCI chain migration is in process. '
'Download the new ABCI client and configure it with '
f'chain_id={chain_id} and validators={validators}.')
A Bigchain instance has several configuration parameters (e.g. host).
If a parameter value is passed as an argument to the Bigchain
__init__ method, then that is the value it will have.
Otherwise, the parameter value will come from an environment variable.
If that environment variable isn't set, then the value
will come from the local configuration file. And if that variable
isn't in the local configuration file, then the parameter will have
its default value (defined in bigchaindb.__init__).
def abort_if_abci_chain_is_not_synced(self):
if self.chain is None or self.chain['is_synced']:
return
Args:
host (str): hostname where RethinkDB is running.
port (int): port in which RethinkDB is running (usually 28015).
dbname (str): the name of the database to connect to (usually bigchain).
backend (:class:`~bigchaindb.db.backends.rethinkdb.RehinkDBBackend`):
the database backend to use.
public_key (str): the base58 encoded public key for the ED25519 curve.
private_key (str): the base58 encoded private key for the ED25519 curve.
keyring (list[str]): list of base58 encoded public keys of the federation nodes.
"""
validators = self.bigchaindb.get_validators()
self.log_abci_migration_error(self.chain['chain_id'], validators)
sys.exit(1)
config_utils.autoconfigure()
self.host = host or bigchaindb.config['database']['host']
self.port = port or bigchaindb.config['database']['port']
self.dbname = dbname or bigchaindb.config['database']['name']
self.backend = backend or get_backend(host, port, dbname)
self.me = public_key or bigchaindb.config['keypair']['public']
self.me_private = private_key or bigchaindb.config['keypair']['private']
self.nodes_except_me = keyring or bigchaindb.config['keyring']
self.backlog_reassign_delay = backlog_reassign_delay or bigchaindb.config['backlog_reassign_delay']
self.consensus = BaseConsensusRules
# change RethinkDB read mode to majority. This ensures consistency in query results
self.read_mode = 'majority'
def init_chain(self, genesis):
"""Initialize chain upon genesis or a migration"""
if not self.me or not self.me_private:
raise exceptions.KeypairNotFoundException()
app_hash = ''
height = 0
self.connection = Connection(host=self.host, port=self.port, db=self.dbname)
known_chain = self.bigchaindb.get_latest_abci_chain()
if known_chain is not None:
chain_id = known_chain['chain_id']
def write_transaction(self, signed_transaction, durability='soft'):
"""Write the transaction to bigchain.
if known_chain['is_synced']:
msg = (f'Got invalid InitChain ABCI request ({genesis}) - '
f'the chain {chain_id} is already synced.')
logger.error(msg)
sys.exit(1)
When first writing a transaction to the bigchain the transaction will be kept in a backlog until
it has been validated by the nodes of the federation.
if chain_id != genesis.chain_id:
validators = self.bigchaindb.get_validators()
self.log_abci_migration_error(chain_id, validators)
sys.exit(1)
Args:
signed_transaction (Transaction): transaction with the `signature` included.
# set migration values for app hash and height
block = self.bigchaindb.get_latest_block()
app_hash = '' if block is None else block['app_hash']
height = 0 if block is None else block['height'] + 1
Returns:
dict: database response
"""
signed_transaction = signed_transaction.to_dict()
known_validators = self.bigchaindb.get_validators()
validator_set = [vutils.decode_validator(v)
for v in genesis.validators]
# we will assign this transaction to `one` node. This way we make sure that there are no duplicate
# transactions on the bigchain
if self.nodes_except_me:
assignee = random.choice(self.nodes_except_me)
if known_validators and known_validators != validator_set:
self.log_abci_migration_error(known_chain['chain_id'],
known_validators)
sys.exit(1)
block = Block(app_hash=app_hash, height=height, transactions=[])
self.bigchaindb.store_block(block._asdict())
self.bigchaindb.store_validator_set(height + 1, validator_set)
abci_chain_height = 0 if known_chain is None else known_chain['height']
self.bigchaindb.store_abci_chain(abci_chain_height,
genesis.chain_id, True)
self.chain = {'height': abci_chain_height, 'is_synced': True,
'chain_id': genesis.chain_id}
return self.abci.ResponseInitChain()
def info(self, request):
"""Return height of the latest committed block."""
self.abort_if_abci_chain_is_not_synced()
# Check if BigchainDB supports the Tendermint version
if not (hasattr(request, 'version') and tendermint_version_is_compatible(request.version)):
logger.error(f'Unsupported Tendermint version: {getattr(request, "version", "no version")}.'
f' Currently, BigchainDB only supports {__tm_supported_versions__}. Exiting!')
sys.exit(1)
logger.info(f"Tendermint version: {request.version}")
r = self.abci.ResponseInfo()
block = self.bigchaindb.get_latest_block()
if block:
chain_shift = 0 if self.chain is None else self.chain['height']
r.last_block_height = block['height'] - chain_shift
r.last_block_app_hash = block['app_hash'].encode('utf-8')
else:
# I am the only node
assignee = self.me
r.last_block_height = 0
r.last_block_app_hash = b''
return r
signed_transaction.update({'assignee': assignee})
signed_transaction.update({'assignment_timestamp': time()})
# write to the backlog
return self.backend.write_transaction(signed_transaction)
def reassign_transaction(self, transaction):
"""Assign a transaction to a new node
def check_tx(self, raw_transaction):
"""Validate the transaction before entry into
the mempool.
Args:
transaction (dict): assigned transaction
Returns:
dict: database response or None if no reassignment is possible
raw_tx: a raw string (in bytes) transaction.
"""
if self.nodes_except_me:
try:
federation_nodes = self.nodes_except_me + [self.me]
index_current_assignee = federation_nodes.index(transaction['assignee'])
new_assignee = random.choice(federation_nodes[:index_current_assignee] +
federation_nodes[index_current_assignee + 1:])
except ValueError:
# current assignee not in federation
new_assignee = random.choice(self.nodes_except_me)
self.abort_if_abci_chain_is_not_synced()
logger.debug('check_tx: %s', raw_transaction)
transaction = decode_transaction(raw_transaction)
if self.bigchaindb.is_valid_transaction(transaction):
logger.debug('check_tx: VALID')
return self.abci.ResponseCheckTx(code=CodeTypeOk)
else:
# There is no other node to assign to
new_assignee = self.me
logger.debug('check_tx: INVALID')
return self.abci.ResponseCheckTx(code=CodeTypeError)
return self.backend.update_transaction(
transaction['id'],
{'assignee': new_assignee, 'assignment_timestamp': time()})
def begin_block(self, req_begin_block):
"""Initialize list of transaction.
Args:
req_begin_block: block object which contains block header
and block hash.
"""
self.abort_if_abci_chain_is_not_synced()
def delete_transaction(self, *transaction_id):
"""Delete a transaction from the backlog.
chain_shift = 0 if self.chain is None else self.chain['height']
logger.debug('BEGIN BLOCK, height:%s, num_txs:%s',
req_begin_block.header.height + chain_shift,
req_begin_block.header.num_txs)
self.block_txn_ids = []
self.block_transactions = []
return self.abci.ResponseBeginBlock()
def deliver_tx(self, raw_transaction):
"""Validate the transaction before mutating the state.
Args:
*transaction_id (str): the transaction(s) to delete
Returns:
The database response.
raw_tx: a raw string (in bytes) transaction.
"""
return self.backend.delete_transaction(*transaction_id)
self.abort_if_abci_chain_is_not_synced()
def get_stale_transactions(self):
"""Get a cursor of stale transactions.
logger.debug('deliver_tx: %s', raw_transaction)
transaction = self.bigchaindb.is_valid_transaction(
decode_transaction(raw_transaction), self.block_transactions)
Transactions are considered stale if they have been assigned a node, but are still in the
backlog after some amount of time specified in the configuration
"""
return self.backend.get_stale_transactions(self.backlog_reassign_delay)
def validate_transaction(self, transaction):
"""Validate a transaction.
Args:
transaction (Transaction): transaction to validate.
Returns:
The transaction if the transaction is valid else it raises an
exception describing the reason why the transaction is invalid.
"""
return self.consensus.validate_transaction(self, transaction)
def is_valid_transaction(self, transaction):
"""Check whether a transaction is valid or invalid.
Similar to :meth:`~bigchaindb.Bigchain.validate_transaction`
but never raises an exception. It returns :obj:`False` if
the transaction is invalid.
Args:
transaction (:Class:`~bigchaindb.models.Transaction`): transaction
to check.
Returns:
The :class:`~bigchaindb.models.Transaction` instance if valid,
otherwise :obj:`False`.
"""
try:
return self.validate_transaction(transaction)
except (ValueError, exceptions.OperationError,
exceptions.TransactionDoesNotExist,
exceptions.TransactionOwnerError, exceptions.DoubleSpend,
exceptions.InvalidHash, exceptions.InvalidSignature,
exceptions.TransactionNotInValidBlock, exceptions.AmountError):
return False
def get_block(self, block_id, include_status=False):
"""Get the block with the specified `block_id` (and optionally its status)
Returns the block corresponding to `block_id` or None if no match is
found.
Args:
block_id (str): transaction id of the transaction to get
include_status (bool): also return the status of the block
the return value is then a tuple: (block, status)
"""
block = self.backend.get_block(block_id)
status = None
if include_status:
if block:
status = self.block_election_status(block_id,
block['block']['voters'])
return block, status
if not transaction:
logger.debug('deliver_tx: INVALID')
return self.abci.ResponseDeliverTx(code=CodeTypeError)
else:
return block
logger.debug('storing tx')
self.block_txn_ids.append(transaction.id)
self.block_transactions.append(transaction)
return self.abci.ResponseDeliverTx(code=CodeTypeOk)
def get_transaction(self, txid, include_status=False):
"""Get the transaction with the specified `txid` (and optionally its status)
This query begins by looking in the bigchain table for all blocks containing
a transaction with the specified `txid`. If one of those blocks is valid, it
returns the matching transaction from that block. Else if some of those
blocks are undecided, it returns a matching transaction from one of them. If
the transaction was found in invalid blocks only, or in no blocks, then this
query looks for a matching transaction in the backlog table, and if it finds
one there, it returns that.
def end_block(self, request_end_block):
"""Calculate block hash using transaction ids and previous block
hash to be stored in the next block.
Args:
txid (str): transaction id of the transaction to get
include_status (bool): also return the status of the transaction
the return value is then a tuple: (tx, status)
Returns:
A :class:`~.models.Transaction` instance if the transaction
was found in a valid block, an undecided block, or the backlog table,
otherwise ``None``.
If :attr:`include_status` is ``True``, also returns the
transaction's status if the transaction was found.
height (int): new height of the chain.
"""
response, tx_status = None, None
self.abort_if_abci_chain_is_not_synced()
validity = self.get_blocks_status_containing_tx(txid)
check_backlog = True
chain_shift = 0 if self.chain is None else self.chain['height']
if validity:
# Disregard invalid blocks, and return if there are no valid or undecided blocks
validity = {_id: status for _id, status in validity.items()
if status != Bigchain.BLOCK_INVALID}
if validity:
height = request_end_block.height + chain_shift
self.new_height = height
# The transaction _was_ found in an undecided or valid block,
# so there's no need to look in the backlog table
check_backlog = False
# store pre-commit state to recover in case there is a crash during
# `end_block` or `commit`
logger.debug(f'Updating pre-commit state: {self.new_height}')
pre_commit_state = dict(height=self.new_height,
transactions=self.block_txn_ids)
self.bigchaindb.store_pre_commit_state(pre_commit_state)
tx_status = self.TX_UNDECIDED
# If the transaction is in a valid or any undecided block, return it. Does not check
# if transactions in undecided blocks are consistent, but selects the valid block
# before undecided ones
for target_block_id in validity:
if validity[target_block_id] == Bigchain.BLOCK_VALID:
tx_status = self.TX_VALID
break
block_txn_hash = calculate_hash(self.block_txn_ids)
block = self.bigchaindb.get_latest_block()
# Query the transaction in the target block and return
response = self.backend.get_transaction_from_block(txid, target_block_id)
if check_backlog:
response = self.backend.get_transaction_from_backlog(txid)
if response:
tx_status = self.TX_IN_BACKLOG
if response:
response = Transaction.from_dict(response)
if include_status:
return response, tx_status
if self.block_txn_ids:
self.block_txn_hash = calculate_hash([block['app_hash'], block_txn_hash])
else:
return response
self.block_txn_hash = block['app_hash']
def get_status(self, txid):
"""Retrieve the status of a transaction with `txid` from bigchain.
validator_update = Election.process_block(self.bigchaindb,
self.new_height,
self.block_transactions)
Args:
txid (str): transaction id of the transaction to query
return self.abci.ResponseEndBlock(validator_updates=validator_update)
Returns:
(string): transaction status ('valid', 'undecided',
or 'backlog'). If no transaction with that `txid` was found it
returns `None`
"""
_, status = self.get_transaction(txid, include_status=True)
return status
def commit(self):
"""Store the new height and along with block hash."""
def get_blocks_status_containing_tx(self, txid):
"""Retrieve block ids and statuses related to a transaction
self.abort_if_abci_chain_is_not_synced()
Transactions may occur in multiple blocks, but no more than one valid block.
data = self.block_txn_hash.encode('utf-8')
Args:
txid (str): transaction id of the transaction to query
# register a new block only when new transactions are received
if self.block_txn_ids:
self.bigchaindb.store_bulk_transactions(self.block_transactions)
Returns:
A dict of blocks containing the transaction,
e.g. {block_id_1: 'valid', block_id_2: 'invalid' ...}, or None
"""
block = Block(app_hash=self.block_txn_hash,
height=self.new_height,
transactions=self.block_txn_ids)
# NOTE: storing the block should be the last operation during commit
# this effects crash recovery. Refer BEP#8 for details
self.bigchaindb.store_block(block._asdict())
# First, get information on all blocks which contain this transaction
blocks = self.backend.get_blocks_status_from_transaction(txid)
if blocks:
# Determine the election status of each block
validity = {
block['id']: self.block_election_status(
block['id'],
block['block']['voters']
) for block in blocks
}
logger.debug('Commit-ing new block with hash: apphash=%s ,'
'height=%s, txn ids=%s', data, self.new_height,
self.block_txn_ids)
# NOTE: If there are multiple valid blocks with this transaction,
# something has gone wrong
if list(validity.values()).count(Bigchain.BLOCK_VALID) > 1:
block_ids = str([block for block in validity
if validity[block] == Bigchain.BLOCK_VALID])
raise exceptions.DoubleSpend('Transaction {tx} is present in '
'multiple valid blocks: '
'{block_ids}'
.format(tx=txid,
block_ids=block_ids))
if self.events_queue:
event = Event(EventTypes.BLOCK_VALID, {
'height': self.new_height,
'transactions': self.block_transactions
})
self.events_queue.put(event)
return validity
return self.abci.ResponseCommit(data=data)
else:
return None
def get_transaction_by_metadata_id(self, metadata_id):
"""Retrieves valid or undecided transactions related to a particular
metadata.
def rollback(b):
pre_commit = b.get_pre_commit_state()
When creating a transaction one of the optional arguments is the
`metadata`. The metadata is a generic dict that contains extra
information that can be appended to the transaction.
if pre_commit is None:
# the pre_commit record is first stored in the first `end_block`
return
To make it easy to query the bigchain for that particular metadata we
create a UUID for the metadata and store it with the transaction.
latest_block = b.get_latest_block()
if latest_block is None:
logger.error('Found precommit state but no blocks!')
sys.exit(1)
Args:
metadata_id (str): the id for this particular metadata.
Returns:
A list of valid or undecided transactions containing that metadata.
If no transaction exists with that metadata it returns an empty
list `[]`
"""
txids = self.backend.get_txids_by_metadata_id(metadata_id)
transactions = []
for txid in txids:
tx = self.get_transaction(txid)
# if a valid or undecided transaction exists append it to the list
# of transactions
if tx:
transactions.append(tx)
return transactions
def get_transactions_by_asset_id(self, asset_id):
"""Retrieves valid or undecided transactions related to a particular
asset.
A digital asset in bigchaindb is identified by an uuid. This allows us
to query all the transactions related to a particular digital asset,
knowing the id.
Args:
asset_id (str): the id for this particular asset.
Returns:
A list of valid or undecided transactions related to the asset.
If no transaction exists for that asset it returns an empty list
`[]`
"""
txids = self.backend.get_txids_by_asset_id(asset_id)
transactions = []
for txid in txids:
tx = self.get_transaction(txid)
if tx:
transactions.append(tx)
return transactions
def get_asset_by_id(self, asset_id):
"""Returns the asset associated with an asset_id.
Args:
asset_id (str): The asset id.
Returns:
:class:`~bigchaindb.common.transaction.Asset` if the asset
exists else None.
"""
cursor = self.backend.get_asset_by_id(asset_id)
cursor = list(cursor)
if cursor:
return Asset.from_dict(cursor[0]['transaction']['asset'])
def get_spent(self, txid, cid):
"""Check if a `txid` was already used as an input.
A transaction can be used as an input for another transaction. Bigchain needs to make sure that a
given `txid` is only used once.
Args:
txid (str): The id of the transaction
cid (num): the index of the condition in the respective transaction
Returns:
The transaction (Transaction) that used the `txid` as an input else
`None`
"""
# checks if an input was already spent
# checks if the bigchain has any transaction with input {'txid': ..., 'cid': ...}
transactions = list(self.backend.get_spent(txid, cid))
# a transaction_id should have been spent at most one time
if transactions:
# determine if these valid transactions appear in more than one valid block
num_valid_transactions = 0
for transaction in transactions:
# ignore invalid blocks
# FIXME: Isn't there a faster solution than doing I/O again?
if self.get_transaction(transaction['id']):
num_valid_transactions += 1
if num_valid_transactions > 1:
raise exceptions.DoubleSpend(('`{}` was spent more than'
' once. There is a problem'
' with the chain')
.format(txid))
if num_valid_transactions:
return Transaction.from_dict(transactions[0])
else:
# all queried transactions were invalid
return None
else:
return None
def get_owned_ids(self, owner):
"""Retrieve a list of `txid`s that can be used as inputs.
Args:
owner (str): base58 encoded public key.
Returns:
:obj:`list` of TransactionLink: list of `txid`s and `cid`s
pointing to another transaction's condition
"""
# get all transactions in which owner is in the `owners_after` list
response = self.backend.get_owned_ids(owner)
owned = []
for tx in response:
# disregard transactions from invalid blocks
validity = self.get_blocks_status_containing_tx(tx['id'])
if Bigchain.BLOCK_VALID not in validity.values():
if Bigchain.BLOCK_UNDECIDED not in validity.values():
continue
# NOTE: It's OK to not serialize the transaction here, as we do not
# use it after the execution of this function.
# a transaction can contain multiple outputs (conditions) so we need to iterate over all of them
# to get a list of outputs available to spend
for index, cond in enumerate(tx['transaction']['conditions']):
# for simple signature conditions there are no subfulfillments
# check if the owner is in the condition `owners_after`
if len(cond['owners_after']) == 1:
if cond['condition']['details']['public_key'] == owner:
tx_link = TransactionLink(tx['id'], index)
else:
# for transactions with multiple `owners_after` there will be several subfulfillments nested
# in the condition. We need to iterate the subfulfillments to make sure there is a
# subfulfillment for `owner`
if util.condition_details_has_owner(cond['condition']['details'], owner):
tx_link = TransactionLink(tx['id'], index)
# check if input was already spent
if not self.get_spent(tx_link.txid, tx_link.cid):
owned.append(tx_link)
return owned
def create_block(self, validated_transactions):
"""Creates a block given a list of `validated_transactions`.
Note that this method does not validate the transactions. Transactions
should be validated before calling create_block.
Args:
validated_transactions (list(Transaction)): list of validated
transactions.
Returns:
Block: created block.
"""
# Prevent the creation of empty blocks
if len(validated_transactions) == 0:
raise exceptions.OperationError('Empty block creation is not '
'allowed')
voters = self.nodes_except_me + [self.me]
block = Block(validated_transactions, self.me, gen_timestamp(), voters)
block = block.sign(self.me_private)
return block
# TODO: check that the votings structure is correctly constructed
def validate_block(self, block):
"""Validate a block.
Args:
block (Block): block to validate.
Returns:
The block if the block is valid else it raises and exception
describing the reason why the block is invalid.
"""
return self.consensus.validate_block(self, block)
def has_previous_vote(self, block_id, voters):
"""Check for previous votes from this node
Args:
block_id (str): the id of the block to check
voters (list(str)): the voters of the block to check
Returns:
bool: :const:`True` if this block already has a
valid vote from this node, :const:`False` otherwise.
Raises:
ImproperVoteError: If there is already a vote,
but the vote is invalid.
"""
votes = list(self.backend.get_votes_by_block_id_and_voter(block_id, self.me))
if len(votes) > 1:
raise exceptions.MultipleVotesError('Block {block_id} has {n_votes} votes from public key {me}'
.format(block_id=block_id, n_votes=str(len(votes)), me=self.me))
has_previous_vote = False
if votes:
if util.verify_vote_signature(voters, votes[0]):
has_previous_vote = True
else:
raise exceptions.ImproperVoteError('Block {block_id} already has an incorrectly signed vote '
'from public key {me}'.format(block_id=block_id, me=self.me))
return has_previous_vote
def write_block(self, block, durability='soft'):
"""Write a block to bigchain.
Args:
block (Block): block to write to bigchain.
"""
return self.backend.write_block(block.to_str(), durability=durability)
def transaction_exists(self, transaction_id):
return self.backend.has_transaction(transaction_id)
def prepare_genesis_block(self):
"""Prepare a genesis block."""
metadata = {'message': 'Hello World from the BigchainDB'}
transaction = Transaction.create([self.me], [([self.me], 1)],
metadata=metadata)
# NOTE: The transaction model doesn't expose an API to generate a
# GENESIS transaction, as this is literally the only usage.
transaction.operation = 'GENESIS'
transaction = transaction.sign([self.me_private])
# create the block
return self.create_block([transaction])
def create_genesis_block(self):
"""Create the genesis block
Block created when bigchain is first initialized. This method is not atomic, there might be concurrency
problems if multiple instances try to write the genesis block when the BigchainDB Federation is started,
but it's a highly unlikely scenario.
"""
# 1. create one transaction
# 2. create the block with one transaction
# 3. write the block to the bigchain
blocks_count = self.backend.count_blocks()
if blocks_count:
raise exceptions.GenesisBlockAlreadyExistsError('Cannot create the Genesis block')
block = self.prepare_genesis_block()
self.write_block(block, durability='hard')
return block
def vote(self, block_id, previous_block_id, decision, invalid_reason=None):
"""Create a signed vote for a block given the
:attr:`previous_block_id` and the :attr:`decision` (valid/invalid).
Args:
block_id (str): The id of the block to vote on.
previous_block_id (str): The id of the previous block.
decision (bool): Whether the block is valid or invalid.
invalid_reason (Optional[str]): Reason the block is invalid
"""
if block_id == previous_block_id:
raise exceptions.CyclicBlockchainError()
vote = {
'voting_for_block': block_id,
'previous_block': previous_block_id,
'is_block_valid': decision,
'invalid_reason': invalid_reason,
'timestamp': gen_timestamp()
}
vote_data = serialize(vote)
signature = crypto.PrivateKey(self.me_private).sign(vote_data.encode())
vote_signed = {
'node_pubkey': self.me,
'signature': signature.decode(),
'vote': vote
}
return vote_signed
def write_vote(self, vote):
"""Write the vote to the database."""
return self.backend.write_vote(vote)
def get_last_voted_block(self):
"""Returns the last block that this node voted on."""
return Block.from_dict(self.backend.get_last_voted_block(self.me))
def get_unvoted_blocks(self):
"""Return all the blocks that have not been voted on by this node.
Returns:
:obj:`list` of :obj:`dict`: a list of unvoted blocks
"""
# XXX: should this return instaces of Block?
return self.backend.get_unvoted_blocks(self.me)
def block_election_status(self, block_id, voters):
"""Tally the votes on a block, and return the status: valid, invalid, or undecided."""
votes = list(self.backend.get_votes_by_block_id(block_id))
n_voters = len(voters)
voter_counts = collections.Counter([vote['node_pubkey'] for vote in votes])
for node in voter_counts:
if voter_counts[node] > 1:
raise exceptions.MultipleVotesError(
'Block {block_id} has multiple votes ({n_votes}) from voting node {node_id}'
.format(block_id=block_id, n_votes=str(voter_counts[node]), node_id=node))
if len(votes) > n_voters:
raise exceptions.MultipleVotesError('Block {block_id} has {n_votes} votes cast, but only {n_voters} voters'
.format(block_id=block_id, n_votes=str(len(votes)),
n_voters=str(n_voters)))
# vote_cast is the list of votes e.g. [True, True, False]
vote_cast = [vote['vote']['is_block_valid'] for vote in votes]
# prev_block are the ids of the nominal prev blocks e.g.
# ['block1_id', 'block1_id', 'block2_id']
prev_block = [vote['vote']['previous_block'] for vote in votes]
# vote_validity checks whether a vote is valid
# or invalid, e.g. [False, True, True]
vote_validity = [self.consensus.verify_vote_signature(voters, vote) for vote in votes]
# element-wise product of stated vote and validity of vote
# vote_cast = [True, True, False] and
# vote_validity = [False, True, True] gives
# [True, False]
# Only the correctly signed votes are tallied.
vote_list = list(compress(vote_cast, vote_validity))
# Total the votes. Here, valid and invalid refer
# to the vote cast, not whether the vote itself
# is valid or invalid.
n_valid_votes = sum(vote_list)
n_invalid_votes = len(vote_cast) - n_valid_votes
# The use of ceiling and floor is to account for the case of an
# even number of voters where half the voters have voted 'invalid'
# and half 'valid'. In this case, the block should be marked invalid
# to avoid a tie. In the case of an odd number of voters this is not
# relevant, since one side must be a majority.
if n_invalid_votes >= math.ceil(n_voters / 2):
return Bigchain.BLOCK_INVALID
elif n_valid_votes > math.floor(n_voters / 2):
# The block could be valid, but we still need to check if votes
# agree on the previous block.
#
# First, only consider blocks with legitimate votes
prev_block_list = list(compress(prev_block, vote_validity))
# Next, only consider the blocks with 'yes' votes
prev_block_valid_list = list(compress(prev_block_list, vote_list))
counts = collections.Counter(prev_block_valid_list)
# Make sure the majority vote agrees on previous node.
# The majority vote must be the most common, by definition.
# If it's not, there is no majority agreement on the previous
# block.
if counts.most_common()[0][1] > math.floor(n_voters / 2):
return Bigchain.BLOCK_VALID
else:
return Bigchain.BLOCK_INVALID
else:
return Bigchain.BLOCK_UNDECIDED
# NOTE: the pre-commit state is always at most 1 block ahead of the commited state
if latest_block['height'] < pre_commit['height']:
Election.rollback(b, pre_commit['height'], pre_commit['transactions'])
b.delete_transactions(pre_commit['transactions'])

View File

@ -1,2 +0,0 @@
# TODO can we use explicit imports?
from bigchaindb.db.utils import * # noqa: F401,F403

View File

@ -1,438 +0,0 @@
"""Backend implementation for RethinkDB.
This module contains all the methods to store and retrieve data from RethinkDB.
"""
from time import time
import rethinkdb as r
from bigchaindb import util
from bigchaindb.db.utils import Connection
from bigchaindb.common import exceptions
class RethinkDBBackend:
def __init__(self, host=None, port=None, db=None):
"""Initialize a new RethinkDB Backend instance.
Args:
host (str): the host to connect to.
port (int): the port to connect to.
db (str): the name of the database to use.
"""
self.read_mode = 'majority'
self.durability = 'soft'
self.connection = Connection(host=host, port=port, db=db)
def write_transaction(self, signed_transaction):
"""Write a transaction to the backlog table.
Args:
signed_transaction (dict): a signed transaction.
Returns:
The result of the operation.
"""
return self.connection.run(
r.table('backlog')
.insert(signed_transaction, durability=self.durability))
def update_transaction(self, transaction_id, doc):
"""Update a transaction in the backlog table.
Args:
transaction_id (str): the id of the transaction.
doc (dict): the values to update.
Returns:
The result of the operation.
"""
return self.connection.run(
r.table('backlog')
.get(transaction_id)
.update(doc))
def delete_transaction(self, *transaction_id):
"""Delete a transaction from the backlog.
Args:
*transaction_id (str): the transaction(s) to delete
Returns:
The database response.
"""
return self.connection.run(
r.table('backlog')
.get_all(*transaction_id)
.delete(durability='hard'))
def get_stale_transactions(self, reassign_delay):
"""Get a cursor of stale transactions.
Transactions are considered stale if they have been assigned a node,
but are still in the backlog after some amount of time specified in the
configuration.
Args:
reassign_delay (int): threshold (in seconds) to mark a transaction stale.
Returns:
A cursor of transactions.
"""
return self.connection.run(
r.table('backlog')
.filter(lambda tx: time() - tx['assignment_timestamp'] > reassign_delay))
def get_transaction_from_block(self, transaction_id, block_id):
"""Get a transaction from a specific block.
Args:
transaction_id (str): the id of the transaction.
block_id (str): the id of the block.
Returns:
The matching transaction.
"""
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get(block_id)
.get_field('block')
.get_field('transactions')
.filter(lambda tx: tx['id'] == transaction_id))[0]
def get_transaction_from_backlog(self, transaction_id):
"""Get a transaction from backlog.
Args:
transaction_id (str): the id of the transaction.
Returns:
The matching transaction.
"""
return self.connection.run(
r.table('backlog')
.get(transaction_id)
.without('assignee', 'assignment_timestamp')
.default(None))
def get_blocks_status_from_transaction(self, transaction_id):
"""Retrieve block election information given a secondary index and value
Args:
value: a value to search (e.g. transaction id string, payload hash string)
index (str): name of a secondary index, e.g. 'transaction_id'
Returns:
:obj:`list` of :obj:`dict`: A list of blocks with with only election information
"""
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get_all(transaction_id, index='transaction_id')
.pluck('votes', 'id', {'block': ['voters']}))
def get_txids_by_metadata_id(self, metadata_id):
"""Retrieves transaction ids related to a particular metadata.
When creating a transaction one of the optional arguments is the
`metadata`. The metadata is a generic dict that contains extra
information that can be appended to the transaction.
To make it easy to query the bigchain for that particular metadata we
create a UUID for the metadata and store it with the transaction.
Args:
metadata_id (str): the id for this particular metadata.
Returns:
A list of transaction ids containing that metadata. If no
transaction exists with that metadata it returns an empty list `[]`
"""
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get_all(metadata_id, index='metadata_id')
.concat_map(lambda block: block['block']['transactions'])
.filter(lambda transaction:
transaction['transaction']['metadata']['id'] ==
metadata_id)
.get_field('id'))
def get_txids_by_asset_id(self, asset_id):
"""Retrieves transactions ids related to a particular asset.
A digital asset in bigchaindb is identified by an uuid. This allows us
to query all the transactions related to a particular digital asset,
knowing the id.
Args:
asset_id (str): the id for this particular metadata.
Returns:
A list of transactions ids related to the asset. If no transaction
exists for that asset it returns an empty list `[]`
"""
# here we only want to return the transaction ids since later on when
# we are going to retrieve the transaction with status validation
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get_all(asset_id, index='asset_id')
.concat_map(lambda block: block['block']['transactions'])
.filter(lambda transaction: transaction['transaction']['asset']['id'] == asset_id)
.get_field('id'))
def get_asset_by_id(self, asset_id):
"""Returns the asset associated with an asset_id.
Args:
asset_id (str): The asset id.
Returns:
Returns a rethinkdb cursor.
"""
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get_all(asset_id, index='asset_id')
.concat_map(lambda block: block['block']['transactions'])
.filter(lambda transaction:
transaction['transaction']['asset']['id'] == asset_id)
.filter(lambda transaction:
transaction['transaction']['operation'] == 'CREATE')
.pluck({'transaction': 'asset'}))
def get_spent(self, transaction_id, condition_id):
"""Check if a `txid` was already used as an input.
A transaction can be used as an input for another transaction. Bigchain needs to make sure that a
given `txid` is only used once.
Args:
transaction_id (str): The id of the transaction.
condition_id (int): The index of the condition in the respective transaction.
Returns:
The transaction that used the `txid` as an input else `None`
"""
# TODO: use index!
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.concat_map(lambda doc: doc['block']['transactions'])
.filter(lambda transaction: transaction['transaction']['fulfillments'].contains(
lambda fulfillment: fulfillment['input'] == {'txid': transaction_id, 'cid': condition_id})))
def get_owned_ids(self, owner):
"""Retrieve a list of `txids` that can we used has inputs.
Args:
owner (str): base58 encoded public key.
Returns:
A cursor for the matching transactions.
"""
# TODO: use index!
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.concat_map(lambda doc: doc['block']['transactions'])
.filter(lambda tx: tx['transaction']['conditions'].contains(
lambda c: c['owners_after'].contains(owner))))
def get_votes_by_block_id(self, block_id):
"""Get all the votes casted for a specific block.
Args:
block_id (str): the block id to use.
Returns:
A cursor for the matching votes.
"""
return self.connection.run(
r.table('votes', read_mode=self.read_mode)
.between([block_id, r.minval], [block_id, r.maxval], index='block_and_voter'))
def get_votes_by_block_id_and_voter(self, block_id, node_pubkey):
"""Get all the votes casted for a specific block by a specific voter.
Args:
block_id (str): the block id to use.
node_pubkey (str): base58 encoded public key
Returns:
A cursor for the matching votes.
"""
return self.connection.run(
r.table('votes', read_mode=self.read_mode)
.get_all([block_id, node_pubkey], index='block_and_voter'))
def write_block(self, block, durability='soft'):
"""Write a block to the bigchain table.
Args:
block (dict): the block to write.
Returns:
The database response.
"""
return self.connection.run(
r.table('bigchain')
.insert(r.json(block), durability=durability))
def get_block(self, block_id):
"""Get a block from the bigchain table
Args:
block_id (str): block id of the block to get
Returns:
block (dict): the block or `None`
"""
return self.connection.run(r.table('bigchain').get(block_id))
def has_transaction(self, transaction_id):
"""Check if a transaction exists in the bigchain table.
Args:
transaction_id (str): the id of the transaction to check.
Returns:
``True`` if the transaction exists, ``False`` otherwise.
"""
return bool(self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get_all(transaction_id, index='transaction_id').count()))
def count_blocks(self):
"""Count the number of blocks in the bigchain table.
Returns:
The number of blocks.
"""
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.count())
def count_backlog(self):
"""Count the number of transactions in the backlog table.
Returns:
The number of transactions in the backlog.
"""
return self.connection.run(
r.table('backlog', read_mode=self.read_mode)
.count())
def write_vote(self, vote):
"""Write a vote to the votes table.
Args:
vote (dict): the vote to write.
Returns:
The database response.
"""
return self.connection.run(
r.table('votes')
.insert(vote))
def get_genesis_block(self):
"""Get the genesis block
Returns:
The genesis block
"""
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.filter(util.is_genesis_block)
.nth(0))
def get_last_voted_block(self, node_pubkey):
"""Get the last voted block for a specific node.
Args:
node_pubkey (str): base58 encoded public key.
Returns:
The last block the node has voted on. If the node didn't cast
any vote then the genesis block is returned.
"""
try:
# get the latest value for the vote timestamp (over all votes)
max_timestamp = self.connection.run(
r.table('votes', read_mode=self.read_mode)
.filter(r.row['node_pubkey'] == node_pubkey)
.max(r.row['vote']['timestamp']))['vote']['timestamp']
last_voted = list(self.connection.run(
r.table('votes', read_mode=self.read_mode)
.filter(r.row['vote']['timestamp'] == max_timestamp)
.filter(r.row['node_pubkey'] == node_pubkey)))
except r.ReqlNonExistenceError:
# return last vote if last vote exists else return Genesis block
return self.get_genesis_block()
# Now the fun starts. Since the resolution of timestamp is a second,
# we might have more than one vote per timestamp. If this is the case
# then we need to rebuild the chain for the blocks that have been retrieved
# to get the last one.
# Given a block_id, mapping returns the id of the block pointing at it.
mapping = {v['vote']['previous_block']: v['vote']['voting_for_block']
for v in last_voted}
# Since we follow the chain backwards, we can start from a random
# point of the chain and "move up" from it.
last_block_id = list(mapping.values())[0]
# We must be sure to break the infinite loop. This happens when:
# - the block we are currenty iterating is the one we are looking for.
# This will trigger a KeyError, breaking the loop
# - we are visiting again a node we already explored, hence there is
# a loop. This might happen if a vote points both `previous_block`
# and `voting_for_block` to the same `block_id`
explored = set()
while True:
try:
if last_block_id in explored:
raise exceptions.CyclicBlockchainError()
explored.add(last_block_id)
last_block_id = mapping[last_block_id]
except KeyError:
break
return self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.get(last_block_id))
def get_unvoted_blocks(self, node_pubkey):
"""Return all the blocks that have not been voted by the specified node.
Args:
node_pubkey (str): base58 encoded public key
Returns:
:obj:`list` of :obj:`dict`: a list of unvoted blocks
"""
unvoted = self.connection.run(
r.table('bigchain', read_mode=self.read_mode)
.filter(lambda block: r.table('votes', read_mode=self.read_mode)
.get_all([block['id'], node_pubkey], index='block_and_voter')
.is_empty())
.order_by(r.asc(r.row['block']['timestamp'])))
# FIXME: I (@vrde) don't like this solution. Filtering should be done at a
# database level. Solving issue #444 can help untangling the situation
unvoted_blocks = filter(lambda block: not util.is_genesis_block(block), unvoted)
return unvoted_blocks

View File

@ -1,202 +0,0 @@
"""Utils to initialize and drop the database."""
import time
import logging
from bigchaindb.common import exceptions
import rethinkdb as r
import bigchaindb
logger = logging.getLogger(__name__)
class Connection:
"""This class is a proxy to run queries against the database,
it is:
- lazy, since it creates a connection only when needed
- resilient, because before raising exceptions it tries
more times to run the query or open a connection.
"""
def __init__(self, host=None, port=None, db=None, max_tries=3):
"""Create a new Connection instance.
Args:
host (str, optional): the host to connect to.
port (int, optional): the port to connect to.
db (str, optional): the database to use.
max_tries (int, optional): how many tries before giving up.
"""
self.host = host or bigchaindb.config['database']['host']
self.port = port or bigchaindb.config['database']['port']
self.db = db or bigchaindb.config['database']['name']
self.max_tries = max_tries
self.conn = None
def run(self, query):
"""Run a query.
Args:
query: the RethinkDB query.
"""
if self.conn is None:
self._connect()
for i in range(self.max_tries):
try:
return query.run(self.conn)
except r.ReqlDriverError as exc:
if i + 1 == self.max_tries:
raise
else:
self._connect()
def _connect(self):
for i in range(self.max_tries):
try:
self.conn = r.connect(host=self.host, port=self.port,
db=self.db)
except r.ReqlDriverError as exc:
if i + 1 == self.max_tries:
raise
else:
time.sleep(2**i)
def get_backend(host=None, port=None, db=None):
'''Get a backend instance.'''
from bigchaindb.db.backends import rethinkdb
# NOTE: this function will be re-implemented when we have real
# multiple backends to support. Right now it returns the RethinkDB one.
return rethinkdb.RethinkDBBackend(host=host or bigchaindb.config['database']['host'],
port=port or bigchaindb.config['database']['port'],
db=db or bigchaindb.config['database']['name'])
def get_conn():
'''Get the connection to the database.'''
return r.connect(host=bigchaindb.config['database']['host'],
port=bigchaindb.config['database']['port'],
db=bigchaindb.config['database']['name'])
def get_database_name():
return bigchaindb.config['database']['name']
def create_database(conn, dbname):
if r.db_list().contains(dbname).run(conn):
raise exceptions.DatabaseAlreadyExists('Database `{}` already exists'.format(dbname))
logger.info('Create database `%s`.', dbname)
r.db_create(dbname).run(conn)
def create_table(conn, dbname, table_name):
logger.info('Create `%s` table.', table_name)
# create the table
r.db(dbname).table_create(table_name).run(conn)
def create_bigchain_secondary_index(conn, dbname):
logger.info('Create `bigchain` secondary index.')
# to order blocks by timestamp
r.db(dbname).table('bigchain')\
.index_create('block_timestamp', r.row['block']['timestamp'])\
.run(conn)
# to query the bigchain for a transaction id
r.db(dbname).table('bigchain')\
.index_create('transaction_id',
r.row['block']['transactions']['id'], multi=True)\
.run(conn)
# secondary index for payload data by UUID
r.db(dbname).table('bigchain')\
.index_create('metadata_id',
r.row['block']['transactions']['transaction']['metadata']['id'], multi=True)\
.run(conn)
# secondary index for asset uuid
r.db(dbname).table('bigchain')\
.index_create('asset_id',
r.row['block']['transactions']['transaction']['asset']['id'], multi=True)\
.run(conn)
# wait for rethinkdb to finish creating secondary indexes
r.db(dbname).table('bigchain').index_wait().run(conn)
def create_backlog_secondary_index(conn, dbname):
logger.info('Create `backlog` secondary index.')
# compound index to read transactions from the backlog per assignee
r.db(dbname).table('backlog')\
.index_create('assignee__transaction_timestamp',
[r.row['assignee'], r.row['assignment_timestamp']])\
.run(conn)
# wait for rethinkdb to finish creating secondary indexes
r.db(dbname).table('backlog').index_wait().run(conn)
def create_votes_secondary_index(conn, dbname):
logger.info('Create `votes` secondary index.')
# compound index to order votes by block id and node
r.db(dbname).table('votes')\
.index_create('block_and_voter',
[r.row['vote']['voting_for_block'],
r.row['node_pubkey']])\
.run(conn)
# wait for rethinkdb to finish creating secondary indexes
r.db(dbname).table('votes').index_wait().run(conn)
def init_database():
conn = get_conn()
dbname = get_database_name()
create_database(conn, dbname)
table_names = ['bigchain', 'backlog', 'votes']
for table_name in table_names:
create_table(conn, dbname, table_name)
create_bigchain_secondary_index(conn, dbname)
create_backlog_secondary_index(conn, dbname)
create_votes_secondary_index(conn, dbname)
def init():
# Try to access the keypair, throws an exception if it does not exist
b = bigchaindb.Bigchain()
init_database()
logger.info('Create genesis block.')
b.create_genesis_block()
logger.info('Done, have fun!')
def drop(assume_yes=False):
conn = get_conn()
dbname = bigchaindb.config['database']['name']
if assume_yes:
response = 'y'
else:
response = input('Do you want to drop `{}` database? [y/n]: '.format(dbname))
if response == 'y':
try:
logger.info('Drop database `%s`', dbname)
r.db_drop(dbname).run(conn)
logger.info('Done.')
except r.ReqlOpFailedError:
raise exceptions.DatabaseDoesNotExist('Database `{}` does not exist'.format(dbname))
else:
logger.info('Drop aborted')

View File

@ -0,0 +1,355 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from collections import OrderedDict
import base58
from uuid import uuid4
from bigchaindb import backend
from bigchaindb.elections.vote import Vote
from bigchaindb.common.exceptions import (InvalidSignature,
MultipleInputsError,
InvalidProposer,
UnequalValidatorSet,
DuplicateTransaction)
from bigchaindb.tendermint_utils import key_from_base64, public_key_to_base64
from bigchaindb.common.crypto import (public_key_from_ed25519_key)
from bigchaindb.common.transaction import Transaction
from bigchaindb.common.schema import (_validate_schema,
TX_SCHEMA_COMMON,
TX_SCHEMA_CREATE)
class Election(Transaction):
"""Represents election transactions.
To implement a custom election, create a class deriving from this one
with OPERATION set to the election operation, ALLOWED_OPERATIONS
set to (OPERATION,), CREATE set to OPERATION.
"""
OPERATION = None
# Custom validation schema
TX_SCHEMA_CUSTOM = None
# Election Statuses:
ONGOING = 'ongoing'
CONCLUDED = 'concluded'
INCONCLUSIVE = 'inconclusive'
# Vote ratio to approve an election
ELECTION_THRESHOLD = 2 / 3
@classmethod
def get_validator_change(cls, bigchain):
"""Return the validator set from the most recent approved block
:return: {
'height': <block_height>,
'validators': <validator_set>
}
"""
latest_block = bigchain.get_latest_block()
if latest_block is None:
return None
return bigchain.get_validator_change(latest_block['height'])
@classmethod
def get_validators(cls, bigchain, height=None):
"""Return a dictionary of validators with key as `public_key` and
value as the `voting_power`
"""
validators = {}
for validator in bigchain.get_validators(height):
# NOTE: we assume that Tendermint encodes public key in base64
public_key = public_key_from_ed25519_key(key_from_base64(validator['public_key']['value']))
validators[public_key] = validator['voting_power']
return validators
@classmethod
def recipients(cls, bigchain):
"""Convert validator dictionary to a recipient list for `Transaction`"""
recipients = []
for public_key, voting_power in cls.get_validators(bigchain).items():
recipients.append(([public_key], voting_power))
return recipients
@classmethod
def is_same_topology(cls, current_topology, election_topology):
voters = {}
for voter in election_topology:
if len(voter.public_keys) > 1:
return False
[public_key] = voter.public_keys
voting_power = voter.amount
voters[public_key] = voting_power
# Check whether the voters and their votes is same to that of the
# validators and their voting power in the network
return current_topology == voters
def validate(self, bigchain, current_transactions=[]):
"""Validate election transaction
NOTE:
* A valid election is initiated by an existing validator.
* A valid election is one where voters are validators and votes are
allocated according to the voting power of each validator node.
Args:
:param bigchain: (BigchainDB) an instantiated bigchaindb.lib.BigchainDB object.
:param current_transactions: (list) A list of transactions to be validated along with the election
Returns:
Election: a Election object or an object of the derived Election subclass.
Raises:
ValidationError: If the election is invalid
"""
input_conditions = []
duplicates = any(txn for txn in current_transactions if txn.id == self.id)
if bigchain.is_committed(self.id) or duplicates:
raise DuplicateTransaction('transaction `{}` already exists'
.format(self.id))
if not self.inputs_valid(input_conditions):
raise InvalidSignature('Transaction signature is invalid.')
current_validators = self.get_validators(bigchain)
# NOTE: Proposer should be a single node
if len(self.inputs) != 1 or len(self.inputs[0].owners_before) != 1:
raise MultipleInputsError('`tx_signers` must be a list instance of length one')
# NOTE: Check if the proposer is a validator.
[election_initiator_node_pub_key] = self.inputs[0].owners_before
if election_initiator_node_pub_key not in current_validators.keys():
raise InvalidProposer('Public key is not a part of the validator set')
# NOTE: Check if all validators have been assigned votes equal to their voting power
if not self.is_same_topology(current_validators, self.outputs):
raise UnequalValidatorSet('Validator set much be exactly same to the outputs of election')
return self
@classmethod
def generate(cls, initiator, voters, election_data, metadata=None):
# Break symmetry in case we need to call an election with the same properties twice
uuid = uuid4()
election_data['seed'] = str(uuid)
(inputs, outputs) = cls.validate_create(initiator, voters, election_data, metadata)
election = cls(cls.OPERATION, {'data': election_data}, inputs, outputs, metadata)
cls.validate_schema(election.to_dict())
return election
@classmethod
def validate_schema(cls, tx):
"""Validate the election transaction. Since `ELECTION` extends `CREATE` transaction, all the validations for
`CREATE` transaction should be inherited
"""
_validate_schema(TX_SCHEMA_COMMON, tx)
_validate_schema(TX_SCHEMA_CREATE, tx)
if cls.TX_SCHEMA_CUSTOM:
_validate_schema(cls.TX_SCHEMA_CUSTOM, tx)
@classmethod
def create(cls, tx_signers, recipients, metadata=None, asset=None):
raise NotImplementedError
@classmethod
def transfer(cls, tx_signers, recipients, metadata=None, asset=None):
raise NotImplementedError
@classmethod
def to_public_key(cls, election_id):
return base58.b58encode(bytes.fromhex(election_id)).decode()
@classmethod
def count_votes(cls, election_pk, transactions, getter=getattr):
votes = 0
for txn in transactions:
if getter(txn, 'operation') == Vote.OPERATION:
for output in getter(txn, 'outputs'):
# NOTE: We enforce that a valid vote to election id will have only
# election_pk in the output public keys, including any other public key
# along with election_pk will lead to vote being not considered valid.
if len(getter(output, 'public_keys')) == 1 and [election_pk] == getter(output, 'public_keys'):
votes = votes + int(getter(output, 'amount'))
return votes
def get_commited_votes(self, bigchain, election_pk=None):
if election_pk is None:
election_pk = self.to_public_key(self.id)
txns = list(backend.query.get_asset_tokens_for_public_key(bigchain.connection,
self.id,
election_pk))
return self.count_votes(election_pk, txns, dict.get)
def has_concluded(self, bigchain, current_votes=[]):
"""Check if the election can be concluded or not.
* Elections can only be concluded if the validator set has not changed
since the election was initiated.
* Elections can be concluded only if the current votes form a supermajority.
Custom elections may override this function and introduce additional checks.
"""
if self.has_validator_set_changed(bigchain):
return False
election_pk = self.to_public_key(self.id)
votes_committed = self.get_commited_votes(bigchain, election_pk)
votes_current = self.count_votes(election_pk, current_votes)
total_votes = sum(output.amount for output in self.outputs)
if (votes_committed < (2/3) * total_votes) and \
(votes_committed + votes_current >= (2/3)*total_votes):
return True
return False
def get_status(self, bigchain):
election = self.get_election(self.id, bigchain)
if election and election['is_concluded']:
return self.CONCLUDED
return self.INCONCLUSIVE if self.has_validator_set_changed(bigchain) else self.ONGOING
def has_validator_set_changed(self, bigchain):
latest_change = self.get_validator_change(bigchain)
if latest_change is None:
return False
latest_change_height = latest_change['height']
election = self.get_election(self.id, bigchain)
return latest_change_height > election['height']
def get_election(self, election_id, bigchain):
return bigchain.get_election(election_id)
def store(self, bigchain, height, is_concluded):
bigchain.store_election(self.id, height, is_concluded)
def show_election(self, bigchain):
data = self.asset['data']
if 'public_key' in data.keys():
data['public_key'] = public_key_to_base64(data['public_key']['value'])
response = ''
for k, v in data.items():
if k != 'seed':
response += f'{k}={v}\n'
response += f'status={self.get_status(bigchain)}'
return response
@classmethod
def _get_initiated_elections(cls, height, txns):
elections = []
for tx in txns:
if not isinstance(tx, Election):
continue
elections.append({'election_id': tx.id, 'height': height,
'is_concluded': False})
return elections
@classmethod
def _get_votes(cls, txns):
elections = OrderedDict()
for tx in txns:
if not isinstance(tx, Vote):
continue
election_id = tx.asset['id']
if election_id not in elections:
elections[election_id] = []
elections[election_id].append(tx)
return elections
@classmethod
def process_block(cls, bigchain, new_height, txns):
"""Looks for election and vote transactions inside the block, records
and processes elections.
Every election is recorded in the database.
Every vote has a chance to conclude the corresponding election. When
an election is concluded, the corresponding database record is
marked as such.
Elections and votes are processed in the order in which they
appear in the block. Elections are concluded in the order of
appearance of their first votes in the block.
For every election concluded in the block, calls its `on_approval`
method. The returned value of the last `on_approval`, if any,
is a validator set update to be applied in one of the following blocks.
`on_approval` methods are implemented by elections of particular type.
The method may contain side effects but should be idempotent. To account
for other concluded elections, if it requires so, the method should
rely on the database state.
"""
# elections initiated in this block
initiated_elections = cls._get_initiated_elections(new_height, txns)
if initiated_elections:
bigchain.store_elections(initiated_elections)
# elections voted for in this block and their votes
elections = cls._get_votes(txns)
validator_update = None
for election_id, votes in elections.items():
election = bigchain.get_transaction(election_id)
if election is None:
continue
if not election.has_concluded(bigchain, votes):
continue
validator_update = election.on_approval(bigchain, new_height)
election.store(bigchain, new_height, is_concluded=True)
return [validator_update] if validator_update else []
@classmethod
def rollback(cls, bigchain, new_height, txn_ids):
"""Looks for election and vote transactions inside the block and
cleans up the database artifacts possibly created in `process_blocks`.
Part of the `end_block`/`commit` crash recovery.
"""
# delete election records for elections initiated at this height and
# elections concluded at this height
bigchain.delete_elections(new_height)
txns = [bigchain.get_transaction(tx_id) for tx_id in txn_ids]
elections = cls._get_votes(txns)
for election_id in elections:
election = bigchain.get_transaction(election_id)
election.on_rollback(bigchain, new_height)
def on_approval(self, bigchain, new_height):
"""Override to update the database state according to the
election rules. Consider the current database state to account for
other concluded elections, if required.
"""
raise NotImplementedError
def on_rollback(self, bigchain, new_height):
"""Override to clean up the database artifacts possibly created
in `on_approval`. Part of the `end_block`/`commit` crash recovery.
"""
raise NotImplementedError

View File

@ -0,0 +1,64 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from bigchaindb.common.transaction import Transaction
from bigchaindb.common.schema import (_validate_schema,
TX_SCHEMA_COMMON,
TX_SCHEMA_TRANSFER,
TX_SCHEMA_VOTE)
class Vote(Transaction):
OPERATION = 'VOTE'
# NOTE: This class inherits TRANSFER txn type. The `TRANSFER` property is
# overriden to re-use methods from parent class
TRANSFER = OPERATION
ALLOWED_OPERATIONS = (OPERATION,)
# Custom validation schema
TX_SCHEMA_CUSTOM = TX_SCHEMA_VOTE
def validate(self, bigchain, current_transactions=[]):
"""Validate election vote transaction
NOTE: There are no additional validity conditions on casting votes i.e.
a vote is just a valid TRANFER transaction
For more details refer BEP-21: https://github.com/bigchaindb/BEPs/tree/master/21
Args:
bigchain (BigchainDB): an instantiated bigchaindb.lib.BigchainDB object.
Returns:
Vote: a Vote object
Raises:
ValidationError: If the election vote is invalid
"""
self.validate_transfer_inputs(bigchain, current_transactions)
return self
@classmethod
def generate(cls, inputs, recipients, election_id, metadata=None):
(inputs, outputs) = cls.validate_transfer(inputs, recipients, election_id, metadata)
election_vote = cls(cls.OPERATION, {'id': election_id}, inputs, outputs, metadata)
cls.validate_schema(election_vote.to_dict())
return election_vote
@classmethod
def validate_schema(cls, tx):
"""Validate the validator election vote transaction. Since `VOTE` extends `TRANSFER`
transaction, all the validations for `CREATE` transaction should be inherited
"""
_validate_schema(TX_SCHEMA_COMMON, tx)
_validate_schema(TX_SCHEMA_TRANSFER, tx)
_validate_schema(cls.TX_SCHEMA_CUSTOM, tx)
@classmethod
def create(cls, tx_signers, recipients, metadata=None, asset=None):
raise NotImplementedError
@classmethod
def transfer(cls, tx_signers, recipients, metadata=None, asset=None):
raise NotImplementedError

109
bigchaindb/events.py Normal file
View File

@ -0,0 +1,109 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from queue import Empty
from collections import defaultdict
from multiprocessing import Queue
POISON_PILL = 'POISON_PILL'
class EventTypes:
"""Container class that holds all the possible
events BigchainDB manages.
"""
# If you add a new Event Type, make sure to add it
# to the docs in docs/server/source/event-plugin-api.rst
ALL = ~0
BLOCK_VALID = 1
BLOCK_INVALID = 2
# NEW_EVENT = 4
# NEW_EVENT = 8
# NEW_EVENT = 16...
class Event:
"""An Event."""
def __init__(self, event_type, event_data):
"""Creates a new event.
Args:
event_type (int): the type of the event, see
:class:`~bigchaindb.events.EventTypes`
event_data (obj): the data of the event.
"""
self.type = event_type
self.data = event_data
class Exchange:
"""Dispatch events to subscribers."""
def __init__(self):
self.publisher_queue = Queue()
self.started_queue = Queue()
# Map <event_types -> queues>
self.queues = defaultdict(list)
def get_publisher_queue(self):
"""Get the queue used by the publisher.
Returns:
a :class:`multiprocessing.Queue`.
"""
return self.publisher_queue
def get_subscriber_queue(self, event_types=None):
"""Create a new queue for a specific combination of event types
and return it.
Returns:
a :class:`multiprocessing.Queue`.
Raises:
RuntimeError if called after `run`
"""
try:
self.started_queue.get(timeout=1)
raise RuntimeError('Cannot create a new subscriber queue while Exchange is running.')
except Empty:
pass
if event_types is None:
event_types = EventTypes.ALL
queue = Queue()
self.queues[event_types].append(queue)
return queue
def dispatch(self, event):
"""Given an event, send it to all the subscribers.
Args
event (:class:`~bigchaindb.events.EventTypes`): the event to
dispatch to all the subscribers.
"""
for event_types, queues in self.queues.items():
if event.type & event_types:
for queue in queues:
queue.put(event)
def run(self):
"""Start the exchange"""
self.started_queue.put('STARTED')
while True:
event = self.publisher_queue.get()
if event == POISON_PILL:
return
else:
self.dispatch(event)

12
bigchaindb/exceptions.py Normal file
View File

@ -0,0 +1,12 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
class BigchainDBError(Exception):
"""Base class for BigchainDB exceptions."""
class CriticalDoubleSpend(BigchainDBError):
"""Data integrity error that requires attention"""

50
bigchaindb/fastquery.py Normal file
View File

@ -0,0 +1,50 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from bigchaindb.utils import condition_details_has_owner
from bigchaindb.backend import query
from bigchaindb.common.transaction import TransactionLink
class FastQuery():
"""Database queries that join on block results from a single node."""
def __init__(self, connection):
self.connection = connection
def get_outputs_by_public_key(self, public_key):
"""Get outputs for a public key"""
txs = list(query.get_owned_ids(self.connection, public_key))
return [TransactionLink(tx['id'], index)
for tx in txs
for index, output in enumerate(tx['outputs'])
if condition_details_has_owner(output['condition']['details'],
public_key)]
def filter_spent_outputs(self, outputs):
"""Remove outputs that have been spent
Args:
outputs: list of TransactionLink
"""
links = [o.to_dict() for o in outputs]
txs = list(query.get_spending_transactions(self.connection, links))
spends = {TransactionLink.from_dict(input_['fulfills'])
for tx in txs
for input_ in tx['inputs']}
return [ff for ff in outputs if ff not in spends]
def filter_unspent_outputs(self, outputs):
"""Remove outputs that have not been spent
Args:
outputs: list of TransactionLink
"""
links = [o.to_dict() for o in outputs]
txs = list(query.get_spending_transactions(self.connection, links))
spends = {TransactionLink.from_dict(input_['fulfills'])
for tx in txs
for input_ in tx['inputs']}
return [ff for ff in outputs if ff in spends]

514
bigchaindb/lib.py Normal file
View File

@ -0,0 +1,514 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Module containing main contact points with Tendermint and
MongoDB.
"""
import logging
from collections import namedtuple
from uuid import uuid4
import rapidjson
try:
from hashlib import sha3_256
except ImportError:
# NOTE: needed for Python < 3.6
from sha3 import sha3_256
import requests
import bigchaindb
from bigchaindb import backend, config_utils, fastquery
from bigchaindb.models import Transaction
from bigchaindb.common.exceptions import (SchemaValidationError,
ValidationError,
DoubleSpend)
from bigchaindb.common.transaction_mode_types import (BROADCAST_TX_COMMIT,
BROADCAST_TX_ASYNC,
BROADCAST_TX_SYNC)
from bigchaindb.tendermint_utils import encode_transaction, merkleroot
from bigchaindb import exceptions as core_exceptions
from bigchaindb.validation import BaseValidationRules
logger = logging.getLogger(__name__)
class BigchainDB(object):
"""Bigchain API
Create, read, sign, write transactions to the database
"""
def __init__(self, connection=None):
"""Initialize the Bigchain instance
A Bigchain instance has several configuration parameters (e.g. host).
If a parameter value is passed as an argument to the Bigchain
__init__ method, then that is the value it will have.
Otherwise, the parameter value will come from an environment variable.
If that environment variable isn't set, then the value
will come from the local configuration file. And if that variable
isn't in the local configuration file, then the parameter will have
its default value (defined in bigchaindb.__init__).
Args:
connection (:class:`~bigchaindb.backend.connection.Connection`):
A connection to the database.
"""
config_utils.autoconfigure()
self.mode_commit = BROADCAST_TX_COMMIT
self.mode_list = (BROADCAST_TX_ASYNC,
BROADCAST_TX_SYNC,
self.mode_commit)
self.tendermint_host = bigchaindb.config['tendermint']['host']
self.tendermint_port = bigchaindb.config['tendermint']['port']
self.endpoint = 'http://{}:{}/'.format(self.tendermint_host, self.tendermint_port)
validationPlugin = bigchaindb.config.get('validation_plugin')
if validationPlugin:
self.validation = config_utils.load_validation_plugin(validationPlugin)
else:
self.validation = BaseValidationRules
self.connection = connection if connection else backend.connect(**bigchaindb.config['database'])
def post_transaction(self, transaction, mode):
"""Submit a valid transaction to the mempool."""
if not mode or mode not in self.mode_list:
raise ValidationError('Mode must be one of the following {}.'
.format(', '.join(self.mode_list)))
tx_dict = transaction.tx_dict if transaction.tx_dict else transaction.to_dict()
payload = {
'method': mode,
'jsonrpc': '2.0',
'params': [encode_transaction(tx_dict)],
'id': str(uuid4())
}
# TODO: handle connection errors!
return requests.post(self.endpoint, json=payload)
def write_transaction(self, transaction, mode):
# This method offers backward compatibility with the Web API.
"""Submit a valid transaction to the mempool."""
response = self.post_transaction(transaction, mode)
return self._process_post_response(response.json(), mode)
def _process_post_response(self, response, mode):
logger.debug(response)
error = response.get('error')
if error:
status_code = 500
message = error.get('message', 'Internal Error')
data = error.get('data', '')
if 'Tx already exists in cache' in data:
status_code = 400
return (status_code, message + ' - ' + data)
result = response['result']
if mode == self.mode_commit:
check_tx_code = result.get('check_tx', {}).get('code', 0)
deliver_tx_code = result.get('deliver_tx', {}).get('code', 0)
error_code = check_tx_code or deliver_tx_code
else:
error_code = result.get('code', 0)
if error_code:
return (500, 'Transaction validation failed')
return (202, '')
def store_bulk_transactions(self, transactions):
txns = []
assets = []
txn_metadatas = []
for t in transactions:
transaction = t.tx_dict if t.tx_dict else rapidjson.loads(rapidjson.dumps(t.to_dict()))
if transaction['operation'] == t.CREATE:
asset = transaction.pop('asset')
asset['id'] = transaction['id']
assets.append(asset)
metadata = transaction.pop('metadata')
txn_metadatas.append({'id': transaction['id'],
'metadata': metadata})
txns.append(transaction)
backend.query.store_metadatas(self.connection, txn_metadatas)
if assets:
backend.query.store_assets(self.connection, assets)
return backend.query.store_transactions(self.connection, txns)
def delete_transactions(self, txs):
return backend.query.delete_transactions(self.connection, txs)
def update_utxoset(self, transaction):
"""Update the UTXO set given ``transaction``. That is, remove
the outputs that the given ``transaction`` spends, and add the
outputs that the given ``transaction`` creates.
Args:
transaction (:obj:`~bigchaindb.models.Transaction`): A new
transaction incoming into the system for which the UTXO
set needs to be updated.
"""
spent_outputs = [
spent_output for spent_output in transaction.spent_outputs
]
if spent_outputs:
self.delete_unspent_outputs(*spent_outputs)
self.store_unspent_outputs(
*[utxo._asdict() for utxo in transaction.unspent_outputs]
)
def store_unspent_outputs(self, *unspent_outputs):
"""Store the given ``unspent_outputs`` (utxos).
Args:
*unspent_outputs (:obj:`tuple` of :obj:`dict`): Variable
length tuple or list of unspent outputs.
"""
if unspent_outputs:
return backend.query.store_unspent_outputs(
self.connection, *unspent_outputs)
def get_utxoset_merkle_root(self):
"""Returns the merkle root of the utxoset. This implies that
the utxoset is first put into a merkle tree.
For now, the merkle tree and its root will be computed each
time. This obviously is not efficient and a better approach
that limits the repetition of the same computation when
unnecesary should be sought. For instance, future optimizations
could simply re-compute the branches of the tree that were
affected by a change.
The transaction hash (id) and output index should be sufficient
to uniquely identify a utxo, and consequently only that
information from a utxo record is needed to compute the merkle
root. Hence, each node of the merkle tree should contain the
tuple (txid, output_index).
.. important:: The leaves of the tree will need to be sorted in
some kind of lexicographical order.
Returns:
str: Merkle root in hexadecimal form.
"""
utxoset = backend.query.get_unspent_outputs(self.connection)
# TODO Once ready, use the already pre-computed utxo_hash field.
# See common/transactions.py for details.
hashes = [
sha3_256(
'{}{}'.format(utxo['transaction_id'], utxo['output_index']).encode()
).digest() for utxo in utxoset
]
# TODO Notice the sorted call!
return merkleroot(sorted(hashes))
def get_unspent_outputs(self):
"""Get the utxoset.
Returns:
generator of unspent_outputs.
"""
cursor = backend.query.get_unspent_outputs(self.connection)
return (record for record in cursor)
def delete_unspent_outputs(self, *unspent_outputs):
"""Deletes the given ``unspent_outputs`` (utxos).
Args:
*unspent_outputs (:obj:`tuple` of :obj:`dict`): Variable
length tuple or list of unspent outputs.
"""
if unspent_outputs:
return backend.query.delete_unspent_outputs(
self.connection, *unspent_outputs)
def is_committed(self, transaction_id):
transaction = backend.query.get_transaction(self.connection, transaction_id)
return bool(transaction)
def get_transaction(self, transaction_id):
transaction = backend.query.get_transaction(self.connection, transaction_id)
if transaction:
asset = backend.query.get_asset(self.connection, transaction_id)
metadata = backend.query.get_metadata(self.connection, [transaction_id])
if asset:
transaction['asset'] = asset
if 'metadata' not in transaction:
metadata = metadata[0] if metadata else None
if metadata:
metadata = metadata.get('metadata')
transaction.update({'metadata': metadata})
transaction = Transaction.from_dict(transaction)
return transaction
def get_transactions(self, txn_ids):
return backend.query.get_transactions(self.connection, txn_ids)
def get_transactions_filtered(self, asset_id, operation=None, last_tx=None):
"""Get a list of transactions filtered on some criteria
"""
txids = backend.query.get_txids_filtered(self.connection, asset_id,
operation, last_tx)
for txid in txids:
yield self.get_transaction(txid)
def get_outputs_filtered(self, owner, spent=None):
"""Get a list of output links filtered on some criteria
Args:
owner (str): base58 encoded public_key.
spent (bool): If ``True`` return only the spent outputs. If
``False`` return only unspent outputs. If spent is
not specified (``None``) return all outputs.
Returns:
:obj:`list` of TransactionLink: list of ``txid`` s and ``output`` s
pointing to another transaction's condition
"""
outputs = self.fastquery.get_outputs_by_public_key(owner)
if spent is None:
return outputs
elif spent is True:
return self.fastquery.filter_unspent_outputs(outputs)
elif spent is False:
return self.fastquery.filter_spent_outputs(outputs)
def get_spent(self, txid, output, current_transactions=[]):
transactions = backend.query.get_spent(self.connection, txid,
output)
transactions = list(transactions) if transactions else []
if len(transactions) > 1:
raise core_exceptions.CriticalDoubleSpend(
'`{}` was spent more than once. There is a problem'
' with the chain'.format(txid))
current_spent_transactions = []
for ctxn in current_transactions:
for ctxn_input in ctxn.inputs:
if ctxn_input.fulfills and\
ctxn_input.fulfills.txid == txid and\
ctxn_input.fulfills.output == output:
current_spent_transactions.append(ctxn)
transaction = None
if len(transactions) + len(current_spent_transactions) > 1:
raise DoubleSpend('tx "{}" spends inputs twice'.format(txid))
elif transactions:
transaction = Transaction.from_db(self, transactions[0])
elif current_spent_transactions:
transaction = current_spent_transactions[0]
return transaction
def store_block(self, block):
"""Create a new block."""
return backend.query.store_block(self.connection, block)
def get_latest_block(self):
"""Get the block with largest height."""
return backend.query.get_latest_block(self.connection)
def get_block(self, block_id):
"""Get the block with the specified `block_id`.
Returns the block corresponding to `block_id` or None if no match is
found.
Args:
block_id (int): block id of the block to get.
"""
block = backend.query.get_block(self.connection, block_id)
latest_block = self.get_latest_block()
latest_block_height = latest_block['height'] if latest_block else 0
if not block and block_id > latest_block_height:
return
result = {'height': block_id,
'transactions': []}
if block:
transactions = backend.query.get_transactions(self.connection, block['transactions'])
result['transactions'] = [t.to_dict() for t in Transaction.from_db(self, transactions)]
return result
def get_block_containing_tx(self, txid):
"""Retrieve the list of blocks (block ids) containing a
transaction with transaction id `txid`
Args:
txid (str): transaction id of the transaction to query
Returns:
Block id list (list(int))
"""
blocks = list(backend.query.get_block_with_transaction(self.connection, txid))
if len(blocks) > 1:
logger.critical('Transaction id %s exists in multiple blocks', txid)
return [block['height'] for block in blocks]
def validate_transaction(self, tx, current_transactions=[]):
"""Validate a transaction against the current status of the database."""
transaction = tx
# CLEANUP: The conditional below checks for transaction in dict format.
# It would be better to only have a single format for the transaction
# throught the code base.
if isinstance(transaction, dict):
try:
transaction = Transaction.from_dict(tx)
except SchemaValidationError as e:
logger.warning('Invalid transaction schema: %s', e.__cause__.message)
return False
except ValidationError as e:
logger.warning('Invalid transaction (%s): %s', type(e).__name__, e)
return False
return transaction.validate(self, current_transactions)
def is_valid_transaction(self, tx, current_transactions=[]):
# NOTE: the function returns the Transaction object in case
# the transaction is valid
try:
return self.validate_transaction(tx, current_transactions)
except ValidationError as e:
logger.warning('Invalid transaction (%s): %s', type(e).__name__, e)
return False
def text_search(self, search, *, limit=0, table='assets'):
"""Return an iterator of assets that match the text search
Args:
search (str): Text search string to query the text index
limit (int, optional): Limit the number of returned documents.
Returns:
iter: An iterator of assets that match the text search.
"""
return backend.query.text_search(self.connection, search, limit=limit,
table=table)
def get_assets(self, asset_ids):
"""Return a list of assets that match the asset_ids
Args:
asset_ids (:obj:`list` of :obj:`str`): A list of asset_ids to
retrieve from the database.
Returns:
list: The list of assets returned from the database.
"""
return backend.query.get_assets(self.connection, asset_ids)
def get_metadata(self, txn_ids):
"""Return a list of metadata that match the transaction ids (txn_ids)
Args:
txn_ids (:obj:`list` of :obj:`str`): A list of txn_ids to
retrieve from the database.
Returns:
list: The list of metadata returned from the database.
"""
return backend.query.get_metadata(self.connection, txn_ids)
@property
def fastquery(self):
return fastquery.FastQuery(self.connection)
def get_validator_change(self, height=None):
return backend.query.get_validator_set(self.connection, height)
def get_validators(self, height=None):
result = self.get_validator_change(height)
return [] if result is None else result['validators']
def get_election(self, election_id):
return backend.query.get_election(self.connection, election_id)
def get_pre_commit_state(self):
return backend.query.get_pre_commit_state(self.connection)
def store_pre_commit_state(self, state):
return backend.query.store_pre_commit_state(self.connection, state)
def store_validator_set(self, height, validators):
"""Store validator set at a given `height`.
NOTE: If the validator set already exists at that `height` then an
exception will be raised.
"""
return backend.query.store_validator_set(self.connection, {'height': height,
'validators': validators})
def delete_validator_set(self, height):
return backend.query.delete_validator_set(self.connection, height)
def store_abci_chain(self, height, chain_id, is_synced=True):
return backend.query.store_abci_chain(self.connection, height,
chain_id, is_synced)
def delete_abci_chain(self, height):
return backend.query.delete_abci_chain(self.connection, height)
def get_latest_abci_chain(self):
return backend.query.get_latest_abci_chain(self.connection)
def migrate_abci_chain(self):
"""Generate and record a new ABCI chain ID. New blocks are not
accepted until we receive an InitChain ABCI request with
the matching chain ID and validator set.
Chain ID is generated based on the current chain and height.
`chain-X` => `chain-X-migrated-at-height-5`.
`chain-X-migrated-at-height-5` => `chain-X-migrated-at-height-21`.
If there is no known chain (we are at genesis), the function returns.
"""
latest_chain = self.get_latest_abci_chain()
if latest_chain is None:
return
block = self.get_latest_block()
suffix = '-migrated-at-height-'
chain_id = latest_chain['chain_id']
block_height_str = str(block['height'])
new_chain_id = chain_id.split(suffix)[0] + suffix + block_height_str
self.store_abci_chain(block['height'] + 1, new_chain_id, False)
def store_election(self, election_id, height, is_concluded):
return backend.query.store_election(self.connection, election_id,
height, is_concluded)
def store_elections(self, elections):
return backend.query.store_elections(self.connection, elections)
def delete_elections(self, height):
return backend.query.delete_elections(self.connection, height)
Block = namedtuple('Block', ('app_hash', 'height', 'transactions'))

130
bigchaindb/log.py Normal file
View File

@ -0,0 +1,130 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import bigchaindb
import logging
from bigchaindb.common.exceptions import ConfigurationError
from logging.config import dictConfig as set_logging_config
import os
DEFAULT_LOG_DIR = os.getcwd()
DEFAULT_LOGGING_CONFIG = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'console': {
'class': 'logging.Formatter',
'format': ('[%(asctime)s] [%(levelname)s] (%(name)s) '
'%(message)s (%(processName)-10s - pid: %(process)d)'),
'datefmt': '%Y-%m-%d %H:%M:%S',
},
'file': {
'class': 'logging.Formatter',
'format': ('[%(asctime)s] [%(levelname)s] (%(name)s) '
'%(message)s (%(processName)-10s - pid: %(process)d)'),
'datefmt': '%Y-%m-%d %H:%M:%S',
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'console',
'level': logging.INFO,
},
'file': {
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(DEFAULT_LOG_DIR, 'bigchaindb.log'),
'mode': 'w',
'maxBytes': 209715200,
'backupCount': 5,
'formatter': 'file',
'level': logging.INFO,
},
'errors': {
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(DEFAULT_LOG_DIR, 'bigchaindb-errors.log'),
'mode': 'w',
'maxBytes': 209715200,
'backupCount': 5,
'formatter': 'file',
'level': logging.ERROR,
}
},
'loggers': {},
'root': {
'level': logging.DEBUG,
'handlers': ['console', 'file', 'errors'],
},
}
def _normalize_log_level(level):
try:
return level.upper()
except AttributeError as exc:
raise ConfigurationError('Log level must be a string!') from exc
def setup_logging():
"""Function to configure log hadlers.
.. important::
Configuration, if needed, should be applied before invoking this
decorator, as starting the subscriber process for logging will
configure the root logger for the child process based on the
state of :obj:`bigchaindb.config` at the moment this decorator
is invoked.
"""
logging_configs = DEFAULT_LOGGING_CONFIG
new_logging_configs = bigchaindb.config['log']
if 'file' in new_logging_configs:
filename = new_logging_configs['file']
logging_configs['handlers']['file']['filename'] = filename
if 'error_file' in new_logging_configs:
error_filename = new_logging_configs['error_file']
logging_configs['handlers']['errors']['filename'] = error_filename
if 'level_console' in new_logging_configs:
level = _normalize_log_level(new_logging_configs['level_console'])
logging_configs['handlers']['console']['level'] = level
if 'level_logfile' in new_logging_configs:
level = _normalize_log_level(new_logging_configs['level_logfile'])
logging_configs['handlers']['file']['level'] = level
if 'fmt_console' in new_logging_configs:
fmt = new_logging_configs['fmt_console']
logging_configs['formatters']['console']['format'] = fmt
if 'fmt_logfile' in new_logging_configs:
fmt = new_logging_configs['fmt_logfile']
logging_configs['formatters']['file']['format'] = fmt
if 'datefmt_console' in new_logging_configs:
fmt = new_logging_configs['datefmt_console']
logging_configs['formatters']['console']['datefmt'] = fmt
if 'datefmt_logfile' in new_logging_configs:
fmt = new_logging_configs['datefmt_logfile']
logging_configs['formatters']['file']['datefmt'] = fmt
log_levels = new_logging_configs.get('granular_levels', {})
for logger_name, level in log_levels.items():
level = _normalize_log_level(level)
try:
logging_configs['loggers'][logger_name]['level'] = level
except KeyError:
logging_configs['loggers'][logger_name] = {'level': level}
set_logging_config(logging_configs)

View File

@ -0,0 +1,48 @@
import json
from bigchaindb.common.schema import TX_SCHEMA_CHAIN_MIGRATION_ELECTION
from bigchaindb.elections.election import Election
class ChainMigrationElection(Election):
OPERATION = 'CHAIN_MIGRATION_ELECTION'
CREATE = OPERATION
ALLOWED_OPERATIONS = (OPERATION,)
TX_SCHEMA_CUSTOM = TX_SCHEMA_CHAIN_MIGRATION_ELECTION
def has_concluded(self, bigchaindb, *args, **kwargs):
chain = bigchaindb.get_latest_abci_chain()
if chain is not None and not chain['is_synced']:
# do not conclude the migration election if
# there is another migration in progress
return False
return super().has_concluded(bigchaindb, *args, **kwargs)
def on_approval(self, bigchain, *args, **kwargs):
bigchain.migrate_abci_chain()
def show_election(self, bigchain):
output = super().show_election(bigchain)
chain = bigchain.get_latest_abci_chain()
if chain is None or chain['is_synced']:
return output
output += f'\nchain_id={chain["chain_id"]}'
block = bigchain.get_latest_block()
output += f'\napp_hash={block["app_hash"]}'
validators = [
{
'pub_key': {
'type': 'tendermint/PubKeyEd25519',
'value': k,
},
'power': v,
} for k, v in self.get_validators(bigchain).items()
]
output += f'\nvalidators={json.dumps(validators, indent=4)}'
return output
def on_rollback(self, bigchain, new_height):
bigchain.delete_abci_chain(new_height)

View File

@ -1,328 +1,75 @@
from bigchaindb.common.crypto import hash_data, PublicKey, PrivateKey
from bigchaindb.common.exceptions import (InvalidHash, InvalidSignature,
OperationError, DoubleSpend,
TransactionDoesNotExist,
TransactionNotInValidBlock,
AssetIdMismatch, AmountError)
from bigchaindb.common.transaction import Transaction, Asset
from bigchaindb.common.util import gen_timestamp, serialize
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from bigchaindb.backend.schema import validate_language_key
from bigchaindb.common.exceptions import (InvalidSignature,
DuplicateTransaction)
from bigchaindb.common.schema import validate_transaction_schema
from bigchaindb.common.transaction import Transaction
from bigchaindb.common.utils import (validate_txn_obj, validate_key)
class Transaction(Transaction):
def validate(self, bigchain):
"""Validate a transaction.
ASSET = 'asset'
METADATA = 'metadata'
DATA = 'data'
def validate(self, bigchain, current_transactions=[]):
"""Validate transaction spend
Args:
bigchain (Bigchain): an instantiated bigchaindb.Bigchain object.
bigchain (BigchainDB): an instantiated bigchaindb.BigchainDB object.
Returns:
The transaction (Transaction) if the transaction is valid else it
raises an exception describing the reason why the transaction is
invalid.
Raises:
OperationError: if the transaction operation is not supported
TransactionDoesNotExist: if the input of the transaction is not
found
TransactionNotInValidBlock: if the input of the transaction is not
in a valid block
TransactionOwnerError: if the new transaction is using an input it
doesn't own
DoubleSpend: if the transaction is a double spend
InvalidHash: if the hash of the transaction is wrong
InvalidSignature: if the signature of the transaction is wrong
ValidationError: If the transaction is invalid
"""
if len(self.fulfillments) == 0:
raise ValueError('Transaction contains no fulfillments')
input_conditions = []
inputs_defined = all([ffill.tx_input for ffill in self.fulfillments])
if self.operation in (Transaction.CREATE, Transaction.GENESIS):
# validate inputs
if inputs_defined:
raise ValueError('A CREATE operation has no inputs')
# validate asset
amount = sum([condition.amount for condition in self.conditions])
self.asset.validate_asset(amount=amount)
if self.operation == Transaction.CREATE:
duplicates = any(txn for txn in current_transactions if txn.id == self.id)
if bigchain.is_committed(self.id) or duplicates:
raise DuplicateTransaction('transaction `{}` already exists'
.format(self.id))
if not self.inputs_valid(input_conditions):
raise InvalidSignature('Transaction signature is invalid.')
elif self.operation == Transaction.TRANSFER:
if not inputs_defined:
raise ValueError('Only `CREATE` transactions can have null '
'inputs')
# check inputs
# store the inputs so that we can check if the asset ids match
input_txs = []
input_amount = 0
for ffill in self.fulfillments:
input_txid = ffill.tx_input.txid
input_cid = ffill.tx_input.cid
input_tx, status = bigchain.\
get_transaction(input_txid, include_status=True)
if input_tx is None:
raise TransactionDoesNotExist("input `{}` doesn't exist"
.format(input_txid))
if status != bigchain.TX_VALID:
raise TransactionNotInValidBlock(
'input `{}` does not exist in a valid block'.format(
input_txid))
spent = bigchain.get_spent(input_txid, ffill.tx_input.cid)
if spent and spent.id != self.id:
raise DoubleSpend('input `{}` was already spent'
.format(input_txid))
input_conditions.append(input_tx.conditions[input_cid])
input_txs.append(input_tx)
if input_tx.conditions[input_cid].amount < 1:
raise AmountError('`amount` needs to be greater than zero')
input_amount += input_tx.conditions[input_cid].amount
# Validate that all inputs are distinct
links = [(f.tx_input.txid, f.tx_input.cid) for f in self.fulfillments]
if len(links) != len(set(links)):
raise DoubleSpend('tx "{}" spends inputs twice'.format(self.id))
# validate asset id
asset_id = Asset.get_asset_id(input_txs)
if asset_id != self.asset.data_id:
raise AssetIdMismatch(('The asset id of the input does not'
' match the asset id of the'
' transaction'))
# get the asset creation to see if its divisible or not
asset = bigchain.get_asset_by_id(asset_id)
# validate the asset
asset.validate_asset(amount=input_amount)
# validate the amounts
output_amount = 0
for condition in self.conditions:
if condition.amount < 1:
raise AmountError('`amount` needs to be greater than zero')
output_amount += condition.amount
if output_amount != input_amount:
raise AmountError(('The amount used in the inputs `{}`'
' needs to be same as the amount used'
' in the outputs `{}`')
.format(input_amount, output_amount))
else:
allowed_operations = ', '.join(Transaction.ALLOWED_OPERATIONS)
raise TypeError('`operation`: `{}` must be either {}.'
.format(self.operation, allowed_operations))
if not self.fulfillments_valid(input_conditions):
raise InvalidSignature()
else:
return self
class Block(object):
"""Bundle a list of Transactions in a Block. Nodes vote on its validity.
Attributes:
transaction (:obj:`list` of :class:`~.Transaction`):
Transactions to be included in the Block.
node_pubkey (str): The public key of the node creating the
Block.
timestamp (str): The Unix time a Block was created.
voters (:obj:`list` of :obj:`str`): A list of a federation
nodes' public keys supposed to vote on the Block.
signature (str): A cryptographic signature ensuring the
integrity and validity of the creator of a Block.
"""
def __init__(self, transactions=None, node_pubkey=None, timestamp=None,
voters=None, signature=None):
"""The Block model is mainly used for (de)serialization and integrity
checking.
Args:
transaction (:obj:`list` of :class:`~.Transaction`):
Transactions to be included in the Block.
node_pubkey (str): The public key of the node creating the
Block.
timestamp (str): The Unix time a Block was created.
voters (:obj:`list` of :obj:`str`): A list of a federation
nodes' public keys supposed to vote on the Block.
signature (str): A cryptographic signature ensuring the
integrity and validity of the creator of a Block.
"""
if transactions is not None and not isinstance(transactions, list):
raise TypeError('`transactions` must be a list instance or None')
else:
self.transactions = transactions or []
if voters is not None and not isinstance(voters, list):
raise TypeError('`voters` must be a list instance or None')
else:
self.voters = voters or []
if timestamp is not None:
self.timestamp = timestamp
else:
self.timestamp = gen_timestamp()
self.node_pubkey = node_pubkey
self.signature = signature
def __eq__(self, other):
try:
other = other.to_dict()
except AttributeError:
return False
return self.to_dict() == other
def validate(self, bigchain):
"""Validate the Block.
Args:
bigchain (:class:`~bigchaindb.Bigchain`): An instantiated Bigchain
object.
Returns:
:class:`~.Block`: If valid, return a `Block` object. Else an
appropriate exception describing the reason of invalidity is
raised.
Raises:
OperationError: If a non-federation node signed the Block.
InvalidSignature: If a Block's signature is invalid.
"""
# First, make sure this node hasn't already voted on this block
if bigchain.has_previous_vote(self.id, self.voters):
return self
# Check if the block was created by a federation node
possible_voters = (bigchain.nodes_except_me + [bigchain.me])
if self.node_pubkey not in possible_voters:
raise OperationError('Only federation nodes can create blocks')
if not self.is_signature_valid():
raise InvalidSignature('Block signature invalid')
# Finally: Tentative assumption that every blockchain will want to
# validate all transactions in each block
for tx in self.transactions:
# NOTE: If a transaction is not valid, `is_valid` will throw an
# an exception and block validation will be canceled.
bigchain.validate_transaction(tx)
self.validate_transfer_inputs(bigchain, current_transactions)
return self
def sign(self, private_key):
"""Create a signature for the Block and overwrite `self.signature`.
Args:
private_key (str): A private key corresponding to
`self.node_pubkey`.
Returns:
:class:`~.Block`
"""
block_body = self.to_dict()
block_serialized = serialize(block_body['block'])
private_key = PrivateKey(private_key)
self.signature = private_key.sign(block_serialized.encode()).decode()
return self
def is_signature_valid(self):
"""Check the validity of a Block's signature.
Returns:
bool: Stating the validity of the Block's signature.
"""
block = self.to_dict()['block']
# cc only accepts bytestring messages
block_serialized = serialize(block).encode()
public_key = PublicKey(block['node_pubkey'])
try:
# NOTE: CC throws a `ValueError` on some wrong signatures
# https://github.com/bigchaindb/cryptoconditions/issues/27
return public_key.verify(block_serialized, self.signature)
except (ValueError, AttributeError):
return False
@classmethod
def from_dict(cls, block_body):
"""Transform a Python dictionary to a Block object.
def from_dict(cls, tx_body):
return super().from_dict(tx_body, False)
Args:
block_body (dict): A block dictionary to be transformed.
@classmethod
def validate_schema(cls, tx_body):
validate_transaction_schema(tx_body)
validate_txn_obj(cls.ASSET, tx_body[cls.ASSET], cls.DATA, validate_key)
validate_txn_obj(cls.METADATA, tx_body, cls.METADATA, validate_key)
validate_language_key(tx_body[cls.ASSET], cls.DATA)
validate_language_key(tx_body, cls.METADATA)
Returns:
:class:`~Block`
Raises:
InvalidHash: If the block's id is not corresponding to its
data.
InvalidSignature: If the block's signature is not corresponding
to it's data or `node_pubkey`.
"""
# TODO: Reuse `is_signature_valid` method here.
block = block_body['block']
block_serialized = serialize(block)
block_id = hash_data(block_serialized)
public_key = PublicKey(block['node_pubkey'])
class FastTransaction:
"""A minimal wrapper around a transaction dictionary. This is useful for
when validation is not required but a routine expects something that looks
like a transaction, for example during block creation.
try:
signature = block_body['signature']
except KeyError:
signature = None
Note: immutability could also be provided
"""
if block_id != block_body['id']:
raise InvalidHash()
if signature is not None:
# NOTE: CC throws a `ValueError` on some wrong signatures
# https://github.com/bigchaindb/cryptoconditions/issues/27
try:
signature_valid = public_key\
.verify(block_serialized.encode(), signature)
except ValueError:
signature_valid = False
if signature_valid is False:
raise InvalidSignature('Invalid block signature')
transactions = [Transaction.from_dict(tx) for tx
in block['transactions']]
return cls(transactions, block['node_pubkey'],
block['timestamp'], block['voters'], signature)
def __init__(self, tx_dict):
self.data = tx_dict
@property
def id(self):
return self.to_dict()['id']
return self.data['id']
def to_dict(self):
"""Transform the Block to a Python dictionary.
Returns:
dict: The Block as a dict.
Raises:
OperationError: If the Block doesn't contain any transactions.
"""
if len(self.transactions) == 0:
raise OperationError('Empty block creation is not allowed')
block = {
'timestamp': self.timestamp,
'transactions': [tx.to_dict() for tx in self.transactions],
'node_pubkey': self.node_pubkey,
'voters': self.voters,
}
block_serialized = serialize(block)
block_id = hash_data(block_serialized)
return {
'id': block_id,
'block': block,
'signature': self.signature,
}
def to_str(self):
return serialize(self.to_dict())
return self.data

View File

@ -1,32 +0,0 @@
from platform import node
import statsd
import bigchaindb
from bigchaindb import config_utils
class Monitor(statsd.StatsClient):
"""Set up statsd monitoring."""
def __init__(self, *args, **kwargs):
"""Overrides statsd client, fixing prefix to messages and loading configuration
Args:
*args: arguments (identical to Statsclient)
**kwargs: keyword arguments (identical to Statsclient)
"""
config_utils.autoconfigure()
if not kwargs:
kwargs = {}
# set prefix, parameters from configuration file
if 'prefix' not in kwargs:
kwargs['prefix'] = '{hostname}.'.format(hostname=node())
if 'host' not in kwargs:
kwargs['host'] = bigchaindb.config['statsd']['host']
if 'port' not in kwargs:
kwargs['port'] = bigchaindb.config['statsd']['port']
super().__init__(*args, **kwargs)

Some files were not shown because too many files have changed in this diff Show More