Package: counterparty-lib
Descriptioncounterparty-libis the reference implementation of theCounterparty Protocol.Note:for the command-line interface tocounterparty-lib, see`counterparty-cli<https://github.com/CounterpartyXCP/counterparty-cli>`__.InstallationFor a simple Docker-based install of the Counterparty software stack,
seethis guide.Manual installationDownload the newestpatched Bitcoin
Coreand create abitcoin.conffile with the following options:rpcuser=bitcoinrpc
rpcpassword=rpc
server=1
txindex=1
addrindex=1
rpctimeout=300Note:you can and should replace the RPC credentials. Remember to
use the changed RPC credentials throughout this document.Then, download and installcounterparty-lib:$ git clone https://github.com/CounterpartyXCP/counterparty-lib.git
$ cd counterparty-lib
$ sudo pip3 install --upgrade -r requirements.txt
$ sudo python3 setup.py installFollowed bycounterparty-cli:$ git clone https://github.com/CounterpartyXCP/counterparty-cli.git
$ cd counterparty-cli
$ sudo pip3 install --upgrade -r requirements.txt
$ sudo python3 setup.py installNote onsudo: both counterparty-lib and counterparty-server can be
installed by non-sudoers. Please refer to external documentation for
instructions on using pip without root access and other information
related to custom install locations.Then, launch the daemon via:$ counterparty-server bootstrap
$ counterparty-server --backend-password=rpc startBasic UsageVia command-line(Requirescounterparty-clito be installed.)The first time you run the server, you may bootstrap the local
database with:$counterparty-serverbootstrapStart the server with:$counterparty-serverstartCheck the status of the server with:$counterparty-clientgetinfoFor additional command-line arguments and options:$counterparty-server--help$counterparty-client--helpVia PythonBare usage from Python is also possible, without installingcounterparty-cli:$ python3
>>> from counterpartylib import server
>>> db = server.initialise(<options>)
>>> server.start_all(db)Configuration and OperationThe paths to theconfigurationfiles,logfiles anddatabasefiles are printed to the screen when starting the server in ‘verbose’
mode:$counterparty-server--verbosestartBy default, theconfiguration filesare namedserver.confandclient.confand located in the following directories:Linux:~/.config/counterparty/Windows:%APPDATA%\Counterparty\Client and Server log files are namedcounterparty.client.[testnet.]logandcounterparty.server.[testnet.]log, and located in the following
directories:Linux:~/.cache/counterparty/log/Windows:%APPDATA%\Local\Counterparty\counterparty\LogsCounterparty API activity is logged inserver.[testnet.]api.logandclient.[testnet.]api.log.Counterparty database files are by default namedcounterparty.[testnet.]dband located in the following directories:Linux:~/.local/share/counterpartyWindows:%APPDATA%\Roaming\Counterparty\counterpartyConfiguration File FormatManual configuration is not necessary for most use cases. “back-end” and
“wallet” are used to access Bitcoin server RPC.Acounterparty-serverconfiguration file looks like this:[Default]
backend-name = addrindex
backend-user = <user>
backend-password = <password>
rpc-host = 0.0.0.0
rpc-user = <rpcuser>
rpc-password = <rpcpassword>Theforceargument can be used either in the server configuration
file or passed at runtime to make the server keep running in the case it
loses connectivity with the Internet and falls behind the back-end
database. This may be useful fornon-productionCounterparty servers
that need to maintain RPC service availability even when the backend or
counterparty server has no Internet connectivity.Acounterparty-clientconfiguration file looks like this:[Default]
wallet-name = bitcoincore
wallet-connect = localhost
wallet-user = <user>
wallet-password = <password>
counterparty-rpc-connect = localhost
counterparty-rpc-user = <rpcuser>
counterparty-rpc-password = <password>Developer notesVersioningMajor version changes require a full (automatic) rebuild of the
database.Minor version changes require a(n automatic) database reparse.All protocol changes are retroactive on testnet.Continuous integrationTravisCI is setup to run all tests with 1 command and generate a
coverage report and letpython-coverallsparse and upload it. It
does runs with--skiptestbook=allso it will not do the reparsing
of the bootstrap files.CircleCI is setup to split the tests as much as possible to make it
easier to read the error reports. It also runs theintegration_test.test_booktests, which reparse the bootstrap
files.Further ReadingOfficial Project Documentation