top of page

Counterparty Development Update #11: Separating counterpartyd, Improved Dependency Management & More

This week we made significant progress in terms of code refactoring, testing and dependency management. We implemented changes in our code in order to separate the responsibilities and decrease dependencies of our components. The first change we made was to separate the server and client functions and move all commands to counterparty-cli, followed by separating blockchain explorer and wallet dependencies. Please note, however, that these changes are still in develop and are planned to be released in a non-mandatory upgrade v9.49.5. Below we explain each change in detail.

Separating counterpartydcounterpartyd repository has been divided into two parts: counterparty-lib and counterparty-cli. The main characteristics of counterparty-lib are:

  1. it is a "pure" Python library and doesn’t contain any command line scripts

  2. it can be installed/upgraded with a simple pip install counterparty-lib

  3. it doesn’t need or manage a wallet but only a block explorer, which is why, in the API, the pubkey parameter is now mandatory if not present in the blockchain

  4. it doesn’t need or manage user configuration filecounterparty-cli contains 2 command line scripts:

  5. counterparty-server.py replaces counterpartyd.py and uses its own configuration file (~/.config/counterparty-server/counterparty-server.conf). The configuration file must contain parameters to connect to the block explorer (addrindex backend), and parameters to serve the RPC API.

  6. counterparty-client.py replaces counterparty-cli.py and uses its own configuration file (~/.config/counterparty-client/counterparty-client.conf). The configuration file must contain parameters to connect to the counterparty-server and parameters to connect to the wallet (Bitcoin Core for now). For an example of the two configuration files see the README in counterparty-cli repository. counterparty-cli can also be installed via a simple pip install counterparty-cli. The install script installs counterparty-lib and all other dependencies, and adds the two command line scripts to the PATH. counterparty-cli can be compiled as .exe for Windows with pyton setup.py py2exe. Binaries will be available for download on Github and in a near future as a msi installer. More information about this change is available here: Important informations about version 9.49.4

Separating Blockchain Explorer and Wallet Dependenciescounterpartyd.py has been split into two components: counterparty-server.py andcounterparty-client.py. Here are the changes made:

  1. counterparty-server.py

  2. counterparty-server has only one dependency: a blockchain explorer (BACKEND_* in theconfig.py`)

  3. counteparty-server.py now manages only these actions: server, reparse, rollback andkickstart

  4. backend parameters have been renamed: BACKENDRPC are replaced by BACKEND support of parameters `bitcoind_rpc` in the configuration file has been removed

  5. BLOCKCHAIN_SERVICE_NAME is replaced by BACKEND_NAME

  6. jmcorgan is replaced by addrindex

  7. support of Insight, Blockr and SoChain has been removed

  8. counterparty-client.py

  9. counterparty-client has two dependencies: a counterparty-server and a wallet.

  10. it is completely independent of the lib folder.

  11. It has its own configuration file (~/.config/counterparty-client/counterparty-client.conf) and doesn’t use a database

  12. Only Bitcoin Core wallet is supported for now, but a wrapper for another wallet can easily be added in the client/wallet folder.

  13. requests library is always used to make RPC calls

Changes and Fixes Across our Repositories

counterpartyd

  1. Moved CLIs to counterparty-cli repository

  2. Added counterparty-lib python package:

  3. moved python file in subfolder counterparty

  4. removed pip-requirement.txt

  5. added setup.py

  6. moved server.py in counterparty folder

  7. updated README.md

  8. Included apsw and serpent installation in setup.py

  9. Fixed the error with counterpartyd resetting continuously on a data-overflow error (testnet) #615

  10. Implemented dropping Contracts table after other related tables

  11. Implemented more detailed exceptions in util.py

  12. Added new unit tests

  13. Added specific arguments for all unit.py functions, updated docstring documentation in util.pyand script.py

  14. Fixed the bug with get_running_info

  15. Fixed executions status when contract execution fails: In XCP holders calculation, includedgas_remained and gas_cost for executions with status equal to out of gas

  16. Removed forcing Non‐Callability for reissuances: Re‐issuances should use old callability,call_date, call_price values.

  17. Fixed bug with bet transactions accepted from addresses with 0 XCP balance #612

  18. Fixed excessive logging problem #621 - block_index should be passed to log.message() to detect mempool transactions

  19. Fixed bug with Bitcoin Core 0.10.0 - wait on "Verifying blocks..."? #585

  20. Fixed the bug with AttributeError: 'module' object has no attribute 'handlers' error

  21. Renamed counterparty folder to counterpartylib

counterpartyd_build

  1. Prevented CPU maxing out if cpd/cbd have crashing issues

  2. Implemented build using BTCdrac bitcoind 0.10 That covers our development updates for this week. If you have any questions regarding recent or upcoming changes you can contact us via our support channel, forum or github. In order to stay up to date with our progress subscribe to our newsletter at the bottom of this page and receive weekly updates via email.


Comentários


bottom of page