Docker
Included in this repo are docker images for the Bitcoin SV Node implementation. Thanks to Josh Ellithorpe and his repository, which provided the base for this repo.
This Docker image provides bitcoind
, bitcoin-cli
and bitcoin-tx
which can be used to run and interact with a Bitcoin server.
To see the available versions/tags, please visit the Docker Hub page.
To run the latest version of Bitcoin SV:
To run a container in the background, pass the -d option to docker run, and give your container a name for easy reference later:
Once you have the bitcoind service running in the background, you can show running containers:
Or view the logs of a service:
To stop and restart a running container:
The best method to configure the server is to pass arguments to the bitcoind command. For example, to run Bitcoin SV on the testnet:
Alternatively, you can edit the bitcoin.conf
file which is generated in your data directory (see below).
By default, Docker will create ephemeral containers. That is, the blockchain data will not be persisted, and you will need to sync the blockchain from scratch each time you launch a container.
To keep your blockchain data between container restarts or upgrades, simply add the -v
option to create a data volume:
Alternatively, you can map the data volume to a location on your host:
By default, Docker runs all containers on a private bridge network. This means that you are unable to access the RPC port (8332) necessary to run bitcoin-cli
commands.
There are several methods to run bitcoin-cli
against a running bitcoind
container. The easiest is to simply let your bitcoin-cli
container share networking with your bitcoind
container:
If you plan on exposing the RPC port to multiple containers (for example, if you are developing an application which communicates with the RPC port directly), you probably want to consider creating a user-defined network. You can then use this network for both your bitcoind
and bitclin-cli
containers, passing -rpcconnect
to specify the hostname of your bitcoind container:
Last updated