title |
---|
Node Administration |
To check the status of the containers, run:
fednode ps
Configuration files for the bitcoin
, counterparty
and counterblock
services are stored under federatednode/config/
and may be freely edited. The various locations are as follows:
bitcoin
: Seefederatednode/config/bitcoin/bitcoin.conf
bitcoin-testnet
: Seefederatednode/config/bitcoin/bitcoin.testnet.conf
counterparty
: Seefederatednode/config/counterparty/server.conf
counterparty-testnet
: Seefederatednode/config/counterparty/server.testnet.conf
counterblock
: Seefederatednode/config/counterblock/server.conf
counterblock-testnet
: Seefederatednode/config/counterblock/server.testnet.conf
redis
: shared service used for both mainnet and testnetmongodb
: shared service used for both mainnet and testnet
Remember: once done editing a configuration file, you must restart
the corresponding service. Also, please don't change port or usernames/passwords if the configuration files unless you know what you are doing (as the services are coded to work together smoothly with specific values).
For example, a user with base setup (Bitcoin Core & Counterparty Server) could make Counterparty use existing Bitcoin Core by changing configuration files found under federatednode/config/counterparty/ (backend-connect
in Counterparty server configuration files and wallet-connect
in client configuration files.) At this point Bitcoin Core (mainnet and/or testnet) container(s) could be stopped and counterparty server container restarted. If your existing Bitcoin Server allows RPC connections, with proper settings and correct RPC credentials in their configuration files, counterparty (server), counterblock and counterwallet can all use it so that you don't have to run bitcoin or bitcoin-testnet container.
The various services use Docker named volumes to store data that is meant to be persistent:
bitcoin
andbitcoin-testnet
: Stores blockchain data in thefederatednode_bitcoin-data
volumeaddrindexrs
andaddrindexrs-testnet
: Stores index data in thefederatednode_addrindexrs-data
volumecounterparty
andcounterparty-testnet
: Stores Counterparty databases in thefederatednode_counterparty-data
volumecounterblock
andcounterblock-testnet
: Stores Counterblock asset info (images), etc in thefederatednode_counterblock-data
volumemongodb
: Stores the databases forcounterblock
andcounterblock-testnet
in thefederatednode_mongodb-data
volume
Use docker volume inspect <volume-name>
to display volume location. See docker volume --help
for help on how to interact with Docker volumes.
To tail the logs, use the following command:
fednode tail <service>
Or, to view the entire log, run:
fednode logs <service>
Where <service>
may be one the following, or blank to tail all services:
counterparty
(counterparty-server
mainnet)counterblock
(counterblock
mainnet)bitcoin
(bitcoin
mainnet)addrindexrs
(addrindexrs
mainnet)armory_utxsvr
(armory_utxsvr
mainnet)counterparty-testnet
counterblock-testnet
bitcoin-testnet
addrindexrs-testnet
armory_utxsvr-testnet
counterwallet
fednode stop <service>
fednode start <service>
fednode restart <service>
Where <service>
is one of the service names listed above, or blank for all services.
Note that redis and mongodb are shared services and need to run if either (mainnet or testnet) counterblock container is running and shut down only if both counterblock containers are not running.
fednode exec <service> <CMD>
Where <service>
is one of the service names listed above, and <CMD>
is an arbitrary shell command.
For example:
fednode exec counterparty counterparty-client send --source=12u4Vymr3bGTywjMQDgBkwAnazwQuDqzJG --destination=1AanCo9CJSomhUEy2YrhfXrU1PboBhFaBq --quantity=1.5 --asset=XCP
fednode exec bitcoin-testnet bitcoin-cli getpeerinfo
fednode exec counterblock ls /root
Getting a shell in a conainer
fednode shell <service>
Where <service>
is one of the service names listed above.
To pull the newest software from the git repositories and restart the appropriate daemon, issue the following command:
fednode update <service>
Where <service>
is one of the following, or blank for all applicable services:
counterparty
counterparty-testnet
counterblock
counterblock-testnet
armory_utxsvr
armory_utxsvr-testnet
counterwallet
Both counterparty-server
and counterblock
read in blockchain data and construct their own internal databases. To reset these databases and trigger a reparse of this blockchain data for one of the services, run:
fednode reparse <service>
Where service is counterparty
, counterparty-testnet
, counterblock
, or counterblock-testnet
.
As a more extensive option, if you want to remove, rebuild and reinstall a container (downloading the newest container image/Dockerfile
and utilizing that):
fednode rebuild <service>
Where <service>
is one of the service names listed earlier, or blank for all services. Note that you are just looking to update the source code and restart the service, update
is a better option.
To uninstall the entire fednode setup, run:
fednode uninstall
The system allows for easy development and modification of the Counterparty software components. To do so, simply update code in the directories under federatednode/src/
as you see fit. These directories are mapped into the appropriate containers, overlaying (overriding) the source code that the container ships with. This, along with symlinked (develop) Python package installations makes it possible to work on code in-place, with just a service restart necessary to have the changes take effect.
Once done updating the source code for a particular service, issue the following command(s) to restart the container with the new code:
fednode restart <service>
Where <service>
is one of the services mentioned here.
- To run the
counterparty-lib
test suite, execute:
fednode exec counterparty "cd /counterparty-lib/counterpartylib; py.test --verbose --skiptestbook=all --cov-config=../.coveragerc --cov-report=term-missing --cov=./"
-
If you are working on
counterwallet
, you should browse the system using the/src/
subdirectory (e.g.https://mycounterwallet.bla/src/
). This avoids using precompiled sources. Once you are happy with your changes and ready to make them available to everyone that hits the server, runfednode update counterwallet
, which will pull the newest repo code and repackage the web assets so that the code updates are then active fromhttps://mycounterwallet.bla/
. -
Note that when you install the federated node system, HTTPS repository URLs are used by default for all of the repositories checked out under
src
byfednode.py
. To use SSH URIs instead, specify the--use-ssh-uris
to thefednode install
command.