From 42cc0d0e8642d6bafc606dbd50b8648681d0a09c Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Mon, 23 Jul 2018 16:54:27 +0200 Subject: [PATCH 1/5] Problem: No troubleshooting help for users of simple-network-setup (#2398) Solution: Add a Troubleshooting section to the simple-network-setup docs --- docs/server/source/simple-network-setup.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/server/source/simple-network-setup.md b/docs/server/source/simple-network-setup.md index 752b39ba..dc13dd43 100644 --- a/docs/server/source/simple-network-setup.md +++ b/docs/server/source/simple-network-setup.md @@ -244,6 +244,19 @@ If you followed the recommended approach and created startup scripts for Bigchai If you followed the above instructions, then your node should be publicly-accessible with BigchainDB Root URL `http://hostname:9984` (where hostname is something like `bdb7.canada.vmsareus.net` or `17.122.200.76`). That is, anyone can interact with your node using the [BigchainDB HTTP API](http-client-server-api.html) exposed at that address. The most common way to do that is to use one of the [BigchainDB Drivers](./drivers-clients/index.html). +## Troubleshooting + +To check which nodes your node is connected to (via Tendermint protocols), do: + +```text +# if you don't jq installed, then install it +sudo apt install jq +# then do +curl -s localhost:26657/net_info | jq ".result.peers[].node_info | {id, listen_addr, moniker}" +``` + +Tendermint has other endpoints besides `/net_info`: see [the Tendermint RPC docs](https://tendermint.github.io/slate/?shell#introduction). + ## Refreshing Your Node If you want to refresh your node back to a fresh empty state, then your best bet is to terminate it and deploy a new virtual machine, but if that's not an option, then you can: From 75c22141ade8cd8caa7b2b1882c793c877a774b4 Mon Sep 17 00:00:00 2001 From: Muawia Khan Date: Mon, 23 Jul 2018 17:38:24 +0200 Subject: [PATCH 2/5] Problem: mongodb repos different for debian and ubuntu (#2385) * Problem: mongodb repos different for debian and ubuntu * Ignore errors for checking bdb process --- pkg/configuration/roles/bigchaindb/tasks/stop.yml | 3 ++- pkg/configuration/roles/mongodb/defaults/main.yml | 3 ++- pkg/configuration/roles/mongodb/tasks/debian.yml | 11 ++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pkg/configuration/roles/bigchaindb/tasks/stop.yml b/pkg/configuration/roles/bigchaindb/tasks/stop.yml index 016a06fe..8c518690 100644 --- a/pkg/configuration/roles/bigchaindb/tasks/stop.yml +++ b/pkg/configuration/roles/bigchaindb/tasks/stop.yml @@ -13,6 +13,7 @@ - name: Get Running BigchainDB Process(es) shell: "ps aux | grep \"[b]igchaindb\" | awk '{print $2}'" register: bdb_ps + ignore_errors: yes when: stack_type|lower == "local" tags: [bigchaindb] @@ -30,4 +31,4 @@ - gunicorn ignore_errors: yes when: stack_type|lower == "local" - tags: [bigchaindb] \ No newline at end of file + tags: [bigchaindb] diff --git a/pkg/configuration/roles/mongodb/defaults/main.yml b/pkg/configuration/roles/mongodb/defaults/main.yml index 612b96b1..e198d632 100644 --- a/pkg/configuration/roles/mongodb/defaults/main.yml +++ b/pkg/configuration/roles/mongodb/defaults/main.yml @@ -8,7 +8,8 @@ distribution_major: "{{ ansible_distribution_major_version }}" server_arch: "amd64,arm64" # MongoDB Repos -mongodb_apt_repo: "deb [arch={{ server_arch }}] http://repo.mongodb.org/apt/{{ distribution_name }} {{ distribution_codename }}/{{ mongodb_package }}/{{ mongo_version }} {{'main' if ansible_distribution == 'debian' else 'multiverse'}}" +mongodb_apt_repo: "deb [arch={{ server_arch }}] http://repo.mongodb.org/apt/{{ distribution_name }} {{ distribution_codename }}/{{ mongodb_package }}/{{ mongo_version }} multiverse" +mongodb_deb_repo: "deb http://repo.mongodb.org/apt/{{ distribution_name }} {{ distribution_codename }}/{{ mongodb_package }}/{{ mongo_version }} main" mongodb_yum_base_url: "https://repo.mongodb.org/yum/{{ ansible_os_family|lower }}/$releasever/{{ mongodb_package }}/{{ mongo_version }}/{{ ansible_architecture }}" mongodb_dnf_base_url: "https://repo.mongodb.org/yum/{{ ansible_os_family|lower }}/7/{{ mongodb_package }}/{{ mongo_version }}/{{ ansible_architecture }}" diff --git a/pkg/configuration/roles/mongodb/tasks/debian.yml b/pkg/configuration/roles/mongodb/tasks/debian.yml index 86dab821..e2e38855 100644 --- a/pkg/configuration/roles/mongodb/tasks/debian.yml +++ b/pkg/configuration/roles/mongodb/tasks/debian.yml @@ -22,6 +22,15 @@ repo: "{{ mongodb_apt_repo }}" state: present update_cache: no + when: distribution_name == "ubuntu" + tags: [mongodb] + +- name: Add MongoDB repo and update cache | deb + apt_repository: + repo: "{{ mongodb_deb_repo }}" + state: present + update_cache: no + when: distribution_name == "debian" tags: [mongodb] - name: Install MongoDB | apt @@ -31,4 +40,4 @@ update_cache: yes with_items: - "{{ mongodb_package }}" - tags: [mongodb] \ No newline at end of file + tags: [mongodb] From 12740686e94cc39a250c91285fe684ec7e8d51a7 Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Mon, 23 Jul 2018 18:03:21 +0200 Subject: [PATCH 3/5] 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 --- docs/root/source/smart-contracts.rst | 2 +- docs/root/source/transaction-concepts.md | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/root/source/smart-contracts.rst b/docs/root/source/smart-contracts.rst index 91b01b3b..b031f2f2 100644 --- a/docs/root/source/smart-contracts.rst +++ b/docs/root/source/smart-contracts.rst @@ -3,7 +3,7 @@ BigchainDB and Smart Contracts One can store the source code of any smart contract (i.e. a computer program) in BigchainDB, but BigchainDB won't run arbitrary smart contracts. -BigchainDB will run the subset of smart contracts expressible using `Crypto-Conditions `_. Crypto-conditions are part of the `Interledger Protocol `_. +BigchainDB will run the subset of smart contracts expressible using `Crypto-Conditions `_. The owners of an asset can impose conditions on it that must be met for the asset to be transferred to new owners. Examples of possible conditions (crypto-conditions) include: diff --git a/docs/root/source/transaction-concepts.md b/docs/root/source/transaction-concepts.md index 18c2d3b7..6a3b183d 100644 --- a/docs/root/source/transaction-concepts.md +++ b/docs/root/source/transaction-concepts.md @@ -27,9 +27,8 @@ and the other output might have 15 oak trees for another set of owners. Each output also has an associated condition: the condition that must be met (by a TRANSFER transaction) to transfer/spend the output. -BigchainDB supports a variety of conditions, -a subset of the [Interledger Protocol (ILP)](https://interledger.org/) -crypto-conditions. For details, see +BigchainDB supports a variety of conditions. +For details, see the section titled **Transaction Components: Conditions** in the relevant [BigchainDB Transactions Spec](https://github.com/bigchaindb/BEPs/tree/master/tx-specs/). From d0a24ef5844b72e93ab93b258de0756f0c9d8504 Mon Sep 17 00:00:00 2001 From: vrde Date: Wed, 25 Jul 2018 16:16:06 +0200 Subject: [PATCH 5/5] 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. --- bigchaindb/tendermint/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigchaindb/tendermint/lib.py b/bigchaindb/tendermint/lib.py index ed7aec15..5e238c94 100644 --- a/bigchaindb/tendermint/lib.py +++ b/bigchaindb/tendermint/lib.py @@ -254,10 +254,10 @@ class BigchainDB(object): def get_transaction(self, transaction_id, include_status=False): transaction = backend.query.get_transaction(self.connection, transaction_id) - asset = backend.query.get_asset(self.connection, transaction_id) - metadata = backend.query.get_metadata(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