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 -*-
This commit is contained in:
Troy McConaghy 2018-08-16 12:31:32 +02:00 committed by Muawia Khan
parent 3092beb995
commit abdd23f5a6
331 changed files with 1521 additions and 27 deletions

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright BigchainDB GmbH and BigchainDB 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 set -e -x

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright BigchainDB GmbH and BigchainDB 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 set -e -x

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright BigchainDB GmbH and BigchainDB 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 if [[ -z ${TOXENV} ]]; then
sudo apt-get update sudo apt-get update

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright BigchainDB GmbH and BigchainDB 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 set -e -x

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright BigchainDB GmbH and BigchainDB 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 set -e -x

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright BigchainDB GmbH and BigchainDB 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 set -e -x

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # 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. There are many ways you can contribute to the BigchainDB project, some very easy and others more involved.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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: repos:
- repo: git://github.com/pre-commit/pre-commit-hooks - repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.1.1 sha: v1.1.1

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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: build:
image: latest image: latest

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 sudo: required
dist: trusty dist: trusty

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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) # Change Log (Release Notes)
All _notable_ changes to this project will be documented in this file (`CHANGELOG.md`). All _notable_ changes to this project will be documented in this file (`CHANGELOG.md`).

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of As contributors and maintainers of this project, and in the interest of

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 Handle External Pull Requests # How to Handle External Pull Requests
See [BEP-16](https://github.com/bigchaindb/BEPs/tree/master/16). See [BEP-16](https://github.com/bigchaindb/BEPs/tree/master/16).

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # 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. This guide starts out with our general Python coding style guidelines and ends with a section on how we write & run (Python) tests.

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 <!--- There is no shield to get the latest version
(including pre-release versions) from PyPI, (including pre-release versions) from PyPI,
so show the latest GitHub release instead. so show the latest GitHub release instead.

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # Our Release Process
## Notes ## Notes

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # BigchainDB Roadmap
We moved the BigchainDB Roadmap to the bigchaindb/org repository; see: We moved the BigchainDB Roadmap to the bigchaindb/org repository; see:

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # Acceptance test suite
This directory contains the acceptance test suite for BigchainDB. This directory contains the acceptance test suite for BigchainDB.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # # Basic Acceptance Test
# Here we check that the primitives of the system behave as expected. # Here we check that the primitives of the system behave as expected.
# As you will see, this script tests basic stuff like: # As you will see, this script tests basic stuff like:
@ -36,7 +40,6 @@ def test_basic():
# The two keypairs will be called—drum roll—Alice and Bob. # The two keypairs will be called—drum roll—Alice and Bob.
alice, bob = generate_keypair(), generate_keypair() alice, bob = generate_keypair(), generate_keypair()
# ## Alice registers her bike in BigchainDB # ## Alice registers her bike in BigchainDB
# Alice has a nice bike, and here she creates the "digital twin" # Alice has a nice bike, and here she creates the "digital twin"
# of her bike. # of her bike.
@ -57,7 +60,6 @@ def test_basic():
# a variable with a short and easy name # a variable with a short and easy name
bike_id = fulfilled_creation_tx['id'] bike_id = fulfilled_creation_tx['id']
# Now she is ready to send it to the BigchainDB Network. # Now she is ready to send it to the BigchainDB Network.
sent_transfer_tx = bdb.transactions.send(fulfilled_creation_tx) sent_transfer_tx = bdb.transactions.send(fulfilled_creation_tx)
@ -69,7 +71,6 @@ def test_basic():
assert len(bdb.outputs.get(alice.public_key, spent=False)) == 1 assert len(bdb.outputs.get(alice.public_key, spent=False)) == 1
assert bdb.outputs.get(alice.public_key)[0]['transaction_id'] == bike_id assert bdb.outputs.get(alice.public_key)[0]['transaction_id'] == bike_id
# ## Alice transfers her bike to Bob # ## Alice transfers her bike to Bob
# After registering her bike, Alice is ready to transfer it to Bob. # After registering her bike, Alice is ready to transfer it to Bob.
# She needs to create a new `TRANSFER` transaction. # She needs to create a new `TRANSFER` transaction.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # # Divisible assets integration testing
# This test checks if we can successfully divide assets. # This test checks if we can successfully divide assets.
# The script tests various things like: # The script tests various things like:

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # # Double Spend testing
# This test challenge the system with double spends. # This test challenge the system with double spends.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # # Multiple owners integration testing
# This test checks if we can successfully create and transfer a transaction # This test checks if we can successfully create and transfer a transaction
# with multiple owners. # with multiple owners.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # ## Testing potentially hazardous strings
# This test uses a library of `naughty` strings (code injections, weird unicode chars., etc.) as both keys and values. # 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 # 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
@ -8,7 +12,8 @@
# env variables. # env variables.
import os 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. # 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 import re
# We'll use a nice library of naughty strings... # We'll use a nice library of naughty strings...

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # # Stream Acceptance Test
# This test checks if the event stream works correctly. The basic idea of this # 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 # test is to generate some random **valid** transaction, send them to a

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # Overview
A high-level description of the files and subdirectories of BigchainDB. A high-level description of the files and subdirectories of BigchainDB.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 copy
import logging import logging

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # Backend Interfaces
## Structure ## Structure

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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. """Generic backend database interfaces expected by BigchainDB.
The interfaces in this module allow BigchainDB to be agnostic about its The interfaces in this module allow BigchainDB to be agnostic about its

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 repeat from itertools import repeat
from importlib import import_module from importlib import import_module
import logging import logging

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 from bigchaindb.exceptions import BigchainDBError

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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. """MongoDB backend implementation.
Contains a MongoDB-specific implementation of the Contains a MongoDB-specific implementation of the

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 time
import logging import logging
from ssl import CERT_REQUIRED from ssl import CERT_REQUIRED

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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""" """Query implementation for MongoDB"""
from pymongo import DESCENDING from pymongo import DESCENDING

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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.""" """Utils to initialize and drop the database."""
import logging import logging

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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.""" """Query interfaces for backends."""
from functools import singledispatch from functools import singledispatch
@ -364,6 +368,7 @@ def store_validator_set(conn, validator_update):
@singledispatch @singledispatch
def get_validator_set(conn, height): def get_validator_set(conn, height):
"""Get validator set for a given `height`, if `height` is not specified """Get validator set for a given `height`, if `height` is not specified
then return the latest validator set""" then return the latest validator set
"""
raise NotImplementedError raise NotImplementedError

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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. """Database creation and schema-providing interfaces for backends.
Attributes: Attributes:

View File

@ -1,3 +1,8 @@
# Copyright BigchainDB GmbH and BigchainDB 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 ModuleDispatchRegistrationError(Exception): class ModuleDispatchRegistrationError(Exception):
"""Raised when there is a problem registering dispatched functions for a """Raised when there is a problem registering dispatched functions for a
module module

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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, """Implementation of the `bigchaindb` command,
the command-line interface (CLI) for BigchainDB Server. the command-line interface (CLI) for BigchainDB Server.
""" """

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 """Utility functions and basic common arguments
for ``argparse.ArgumentParser``. for ``argparse.ArgumentParser``.
""" """

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 # Separate all crypto code so that we can easily test several implementations
from collections import namedtuple from collections import namedtuple

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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. """Custom exceptions used in the `bigchaindb` package.
""" """
from bigchaindb.exceptions import BigchainDBError from bigchaindb.exceptions import BigchainDBError

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB 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 # Introduction
This directory contains the schemas for the different JSON documents BigchainDB uses. This directory contains the schemas for the different JSON documents BigchainDB uses.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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""" """Schema validation related functions and data"""
import os.path import os.path
import logging import logging

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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#" "$schema": "http://json-schema.org/draft-04/schema#"
type: object type: object

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Transaction related models to parse and construct transaction """Transaction related models to parse and construct transaction
payloads. payloads.
@ -570,7 +574,7 @@ class Transaction(object):
@property @property
def spent_outputs(self): def spent_outputs(self):
"""tuple of :obj:`dict`: Inputs of this transaction. Each input """Tuple of :obj:`dict`: Inputs of this transaction. Each input
is represented as a dictionary containing a transaction id and is represented as a dictionary containing a transaction id and
output index. output index.
""" """

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 time
import re import re
import rapidjson import rapidjson

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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. """Utils for reading and setting configuration settings.
The value of each BigchainDB Server configuration setting is The value of each BigchainDB Server configuration setting is

View File

@ -1,3 +1,6 @@
# Copyright BigchainDB GmbH and BigchainDB 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 BaseConsensusRules(): class BaseConsensusRules():

View File

@ -1,5 +1,10 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""This module contains all the goodness to integrate BigchainDB """This module contains all the goodness to integrate BigchainDB
with Tendermint.""" with Tendermint.
"""
import logging import logging
import codecs import codecs
@ -33,7 +38,8 @@ class App(BaseApplication):
The role of this class is to expose the BigchainDB The role of this class is to expose the BigchainDB
transactional logic to the Tendermint Consensus transactional logic to the Tendermint Consensus
State Machine.""" State Machine.
"""
def __init__(self, bigchaindb=None): def __init__(self, bigchaindb=None):
self.bigchaindb = bigchaindb or BigchainDB() self.bigchaindb = bigchaindb or BigchainDB()
@ -69,7 +75,8 @@ class App(BaseApplication):
the mempool. the mempool.
Args: Args:
raw_tx: a raw string (in bytes) transaction.""" raw_tx: a raw string (in bytes) transaction.
"""
logger.benchmark('CHECK_TX_INIT') logger.benchmark('CHECK_TX_INIT')
logger.debug('check_tx: %s', raw_transaction) logger.debug('check_tx: %s', raw_transaction)
@ -101,7 +108,8 @@ class App(BaseApplication):
"""Validate the transaction before mutating the state. """Validate the transaction before mutating the state.
Args: Args:
raw_tx: a raw string (in bytes) transaction.""" raw_tx: a raw string (in bytes) transaction.
"""
logger.debug('deliver_tx: %s', raw_transaction) logger.debug('deliver_tx: %s', raw_transaction)
transaction = self.bigchaindb.is_valid_transaction( transaction = self.bigchaindb.is_valid_transaction(
decode_transaction(raw_transaction), self.block_transactions) decode_transaction(raw_transaction), self.block_transactions)
@ -120,7 +128,8 @@ class App(BaseApplication):
hash to be stored in the next block. hash to be stored in the next block.
Args: Args:
height (int): new height of the chain.""" height (int): new height of the chain.
"""
height = request_end_block.height height = request_end_block.height
self.new_height = height self.new_height = height

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 asyncio import asyncio
import json import json
import logging import logging

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 queue import Empty
from collections import defaultdict from collections import defaultdict
from multiprocessing import Queue from multiprocessing import Queue

View File

@ -1,3 +1,8 @@
# Copyright BigchainDB GmbH and BigchainDB 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): class BigchainDBError(Exception):
"""Base class for BigchainDB exceptions.""" """Base class for BigchainDB exceptions."""

View File

@ -1,19 +1,20 @@
# Copyright BigchainDB GmbH and BigchainDB 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.utils import condition_details_has_owner
from bigchaindb.backend import query from bigchaindb.backend import query
from bigchaindb.common.transaction import TransactionLink from bigchaindb.common.transaction import TransactionLink
class FastQuery(): class FastQuery():
""" """Database queries that join on block results from a single node."""
Database queries that join on block results from a single node.
"""
def __init__(self, connection): def __init__(self, connection):
self.connection = connection self.connection = connection
def get_outputs_by_public_key(self, public_key): def get_outputs_by_public_key(self, public_key):
""" """Get outputs for a public key"""
Get outputs for a public key
"""
txs = list(query.get_owned_ids(self.connection, public_key)) txs = list(query.get_owned_ids(self.connection, public_key))
return [TransactionLink(tx['id'], index) return [TransactionLink(tx['id'], index)
for tx in txs for tx in txs
@ -22,8 +23,7 @@ class FastQuery():
public_key)] public_key)]
def filter_spent_outputs(self, outputs): def filter_spent_outputs(self, outputs):
""" """Remove outputs that have been spent
Remove outputs that have been spent
Args: Args:
outputs: list of TransactionLink outputs: list of TransactionLink
@ -36,8 +36,7 @@ class FastQuery():
return [ff for ff in outputs if ff not in spends] return [ff for ff in outputs if ff not in spends]
def filter_unspent_outputs(self, outputs): def filter_unspent_outputs(self, outputs):
""" """Remove outputs that have not been spent
Remove outputs that have not been spent
Args: Args:
outputs: list of TransactionLink outputs: list of TransactionLink

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 """Module containing main contact points with Tendermint and
MongoDB. MongoDB.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 bigchaindb
import logging import logging

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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.exceptions import (InvalidSignature, from bigchaindb.common.exceptions import (InvalidSignature,
DuplicateTransaction) DuplicateTransaction)
from bigchaindb.common.transaction import Transaction from bigchaindb.common.transaction import Transaction

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 import logging
import setproctitle import setproctitle

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 base64 import base64
import hashlib import hashlib
import json import json

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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.upsert_validator.validator_election import ValidatorElection # noqa from bigchaindb.upsert_validator.validator_election import ValidatorElection # noqa
from bigchaindb.upsert_validator.validator_election_vote import ValidatorElectionVote # noqa from bigchaindb.upsert_validator.validator_election_vote import ValidatorElectionVote # noqa

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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.exceptions import (InvalidSignature, from bigchaindb.common.exceptions import (InvalidSignature,
MultipleInputsError, MultipleInputsError,
InvalidProposer, InvalidProposer,

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 base58 import base58
from bigchaindb.common.transaction import Transaction from bigchaindb.common.transaction import Transaction

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 contextlib import contextlib
import threading import threading
import queue import queue

View File

@ -1,2 +1,6 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
__version__ = '2.0.0b5' __version__ = '2.0.0b5'
__short_version__ = '2.0b5' __short_version__ = '2.0b5'

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""API routes definition""" """API routes definition"""
from flask_restful import Api from flask_restful import Api
from bigchaindb.web.views import ( from bigchaindb.web.views import (

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""This module contains basic functions to instantiate the BigchainDB API. """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn. The application is implemented in Flask and runs using Gunicorn.

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""This module provides the blueprint for some basic API endpoints. """This module provides the blueprint for some basic API endpoints.
For more information please refer to the documentation: http://bigchaindb.com/http-api For more information please refer to the documentation: http://bigchaindb.com/http-api

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Common classes and methods for API handlers """Common classes and methods for API handlers
""" """
import logging import logging

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""This module provides the blueprint for the blocks API endpoints. """This module provides the blueprint for the blocks API endpoints.
For more information please refer to the documentation: http://bigchaindb.com/http-api For more information please refer to the documentation: http://bigchaindb.com/http-api

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""API Index endpoint""" """API Index endpoint"""
import flask import flask

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""This module provides the blueprint for some basic API endpoints. """This module provides the blueprint for some basic API endpoints.
For more information please refer to the documentation: http://bigchaindb.com/http-api For more information please refer to the documentation: http://bigchaindb.com/http-api

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 flask import current_app from flask import current_app
from flask_restful import reqparse, Resource from flask_restful import reqparse, Resource

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 re import re

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""This module provides the blueprint for some basic API endpoints. """This module provides the blueprint for some basic API endpoints.
For more information please refer to the documentation: http://bigchaindb.com/http-api For more information please refer to the documentation: http://bigchaindb.com/http-api

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB 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 flask import current_app from flask import current_app
from flask_restful import Resource from flask_restful import Resource

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""WebSocket server for the BigchainDB Event Stream API.""" """WebSocket server for the BigchainDB Event Stream API."""
# NOTE # NOTE

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
codecov: codecov:
branch: master # the branch to show by default branch: master # the branch to show by default

View File

@ -1,3 +1,7 @@
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
version: '2.1' version: '2.1'
services: services:

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
- [Documentation on ReadTheDocs](http://bigchaindb.readthedocs.org/) - [Documentation on ReadTheDocs](http://bigchaindb.readthedocs.org/)
- [BigchainDB Upgrade Guides](upgrade-guides/) - [BigchainDB Upgrade Guides](upgrade-guides/)

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # Copyright BigchainDB GmbH and BigchainDB 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 documentation build configuration file, created by # BigchainDB documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 29 11:13:27 2016. # sphinx-quickstart on Thu Sep 29 11:13:27 2016.
# #

View File

@ -1,3 +1,8 @@
.. Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
Policies Policies
======== ========

View File

@ -1,3 +1,8 @@
.. Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
Developer Setup, Coding & Contribution Process Developer Setup, Coding & Contribution Process
============================================== ==============================================

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Run a BigchainDB network with Ansible # Run a BigchainDB network with Ansible
**NOT for Production Use** **NOT for Production Use**

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Run a BigchainDB network # Run a BigchainDB network
**NOT for Production Use** **NOT for Production Use**

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Notes on Running a Local Dev Node as Processes # Notes on Running a Local Dev Node as Processes
The following doc describes how to run a local node for developing BigchainDB Tendermint version. The following doc describes how to run a local node for developing BigchainDB Tendermint version.

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Notes on Running a Local Dev Node with Docker Compose # Notes on Running a Local Dev Node with Docker Compose
## Setting up a single node development environment with ``docker-compose`` ## Setting up a single node development environment with ``docker-compose``

View File

@ -1,3 +1,8 @@
.. Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
Write Code Write Code
========== ==========

View File

@ -1,3 +1,8 @@
.. Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
Contributing to BigchainDB Contributing to BigchainDB
========================== ==========================

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Answer Questions # Answer Questions
People ask questions about BigchainDB in the following places: People ask questions about BigchainDB in the following places:

View File

@ -1,3 +1,8 @@
.. Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
Ways to Contribute Ways to Contribute
================== ==================

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Make a Feature Request or Proposal # Make a Feature Request or Proposal
To make a feature request or proposal, [write a BigchainDB Enhancement Proposal (BEP)](write-a-bep.html). To make a feature request or proposal, [write a BigchainDB Enhancement Proposal (BEP)](write-a-bep.html).

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Report a Bug # Report a Bug
To report a bug, go to the relevant GitHub repository, click on the **Issues** tab, click on the **New issue** button, and read the instructions. To report a bug, go to the relevant GitHub repository, click on the **Issues** tab, click on the **New issue** button, and read the instructions.

View File

@ -1,3 +1,9 @@
<!---
Copyright BigchainDB GmbH and BigchainDB contributors
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
Code is Apache-2.0 and docs are CC-BY-4.0
--->
# Write a BigchainDB Enhancement Proposal (BEP) # Write a BigchainDB Enhancement Proposal (BEP)
If you have an idea for a new feature or enhancement, and you want some feedback before you write a full BigchainDB Enhancement Proposal (BEP), then feel free to: If you have an idea for a new feature or enhancement, and you want some feedback before you write a full BigchainDB Enhancement Proposal (BEP), then feel free to:

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