There was a recent change merged into btcd that isn't backward
compatible with older RPC clients. To make sure our docker quick
start example still works, we need to pin down btcd to the version
that is still compatible with lnd.
It is better to replace bash shell with potentially long-running
last script command. This way the running command will receive all
potential unix process signals directly.
A concrete example which motivated this change:
Exec of btcd is needed for graceful shutdown of btcd during
`docker-compose down`. Docker Compose properly sends this signal to our
start-btcd.sh bash shell but it is not further signalled to the running
btcd process. Docker Compose then kills whole container forcefully after
some timeout.
An alternative solution would be to trap SIGTERM in our bash script and
forward it to running btcd. Which would be IMO ugly and error prone.
This commit revamps the existing docker configuration to allow for
developer’s to easily bring up/down a Lightning Network testbed
environment.
Configuration related bugs within the prior swarm set up have been
fixed. The launched lnd nodes are now able to properly communicate with
the primary btcd node over RPC. The auto-generated RPC script has been
scrapped in favor of hard-coding a developer-only set of RPC
credentials. With this change, it’s now possible to add/remove
additional lnd nodes in order to test more complex scenarios.
Additionally, the containers now build off of the latest Go version
(1.7).
This commit adds two Dockerfiles, along with a docker-compose file
which links the two docker files together allowing for single-command
deployment.
Using the docker-compose file, two containers are deployed. One running
btcd, and the other running lnd. Both containers share the same shared
volume mounted to the file system in order to allow land to read btcd’s
certificates for the TLS RPC connections.
Additionally, the btcd instance comes will an automatic RPC
configuration generated allowing one to use btcctl out of the box via
calls to “docker-compose exec btcctl …”.