Initial commit
see https://github.com/king-11/vls-containers/pull/1 for the original PR discussion
This commit is contained in:
commit
93884e15b4
202
LICENSE
Normal file
202
LICENSE
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright 2023 lightning-signer
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
21
README.md
Normal file
21
README.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# VLS Containers
|
||||||
|
|
||||||
|
## Volume Creation
|
||||||
|
|
||||||
|
```
|
||||||
|
docker container create bitcoin_data
|
||||||
|
docker container create lightning_data
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker Compose Run
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compoe -f docker-compose.yml up --build
|
||||||
|
```
|
||||||
|
|
||||||
|
### References
|
||||||
|
|
||||||
|
- [bitcoind](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/23/alpine/Dockerfile) by @ruimarinho
|
||||||
|
- [lightningd with clboss](https://github.com/tsjk/docker-core-lightning/blob/main/Dockerfile) by @tsjk
|
||||||
|
- [elements lightning](https://github.com/ElementsProject/lightning/blob/master/contrib/docker/Dockerfile.alpine) by @ElementsProject
|
||||||
|
- [docker compose](https://github.com/LukasBahrenberg/lightning-dockercompose/blob/master/docker-compose.yaml) by @LukasBahrenberg
|
16
assets/bitcoin.conf
Normal file
16
assets/bitcoin.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
##
|
||||||
|
## bitcoin.conf configuration file. Lines beginning with # are comments.
|
||||||
|
##
|
||||||
|
|
||||||
|
[test]
|
||||||
|
server=1
|
||||||
|
rpcuser=rpcuser
|
||||||
|
rpcpassword=VLSsigner1
|
||||||
|
rpcport=18332
|
||||||
|
rpcbind=0.0.0.0
|
||||||
|
rpcallowip=0.0.0.0/0
|
||||||
|
whitelist=0.0.0.0/0
|
||||||
|
zmqpubrawblock=tcp://bitcoind:38332
|
||||||
|
zmqpubrawtx=tcp://bitcoind:38333
|
||||||
|
txindex=1
|
||||||
|
blockfilterindex=1
|
8
assets/testnet-config
Normal file
8
assets/testnet-config
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
network=testnet
|
||||||
|
bitcoin-rpcuser=rpcuser
|
||||||
|
bitcoin-rpcpassword=VLSsigner1
|
||||||
|
bitcoin-rpcport=18332
|
||||||
|
log-level=info
|
||||||
|
max-locktime-blocks=288
|
||||||
|
important-plugin=/usr/bin/clboss
|
||||||
|
clboss-auto-close=true
|
4
assets/testnet-env
Normal file
4
assets/testnet-env
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
VLS_PORT=17701
|
||||||
|
VLS_NETWORK=testnet
|
||||||
|
BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
||||||
|
RUST_LOG=info
|
134
bitcoind/Dockerfile
Normal file
134
bitcoind/Dockerfile
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
# Build stage for Bitcoin Core
|
||||||
|
FROM alpine as bitcoin-core
|
||||||
|
|
||||||
|
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
|
||||||
|
RUN apk add \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
boost-dev \
|
||||||
|
build-base \
|
||||||
|
chrpath \
|
||||||
|
file \
|
||||||
|
gnupg \
|
||||||
|
libevent-dev \
|
||||||
|
libressl \
|
||||||
|
libtool \
|
||||||
|
linux-headers \
|
||||||
|
sqlite-dev \
|
||||||
|
zeromq-dev
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& for key in \
|
||||||
|
152812300785C96444D3334D17565732E08E5E41 \
|
||||||
|
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||||
|
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||||
|
28F5900B1BB5D1A4B6B6D1A9ED357015286A333D \
|
||||||
|
637DB1E23370F84AFF88CCE03152347D07DA627C \
|
||||||
|
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||||
|
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||||
|
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||||
|
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||||
|
F9A8737BF4FF5C89C903DF31DD78544CF91B1514 \
|
||||||
|
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||||
|
E463A93F5F3117EEDE6C7316BD02942421F4889F \
|
||||||
|
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
|
||||||
|
4DAF18FE948E7A965B30F9457E296D555E7F63A7 \
|
||||||
|
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||||
|
74E2DEF5D77260B98BC19438099BAD163C70FBFA \
|
||||||
|
; do \
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||||
|
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||||
|
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||||
|
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||||
|
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||||
|
done && \
|
||||||
|
wget -O- https://raw.githubusercontent.com/Kvaciral/kvaciral/main/kvaciral.asc | gpg --import
|
||||||
|
|
||||||
|
ENV BITCOIN_VERSION=23.0
|
||||||
|
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||||
|
|
||||||
|
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS
|
||||||
|
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
|
||||||
|
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
|
||||||
|
RUN gpg --verify SHA256SUMS.asc SHA256SUMS
|
||||||
|
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
||||||
|
RUN tar -xzf *.tar.gz
|
||||||
|
|
||||||
|
WORKDIR /bitcoin-${BITCOIN_VERSION}
|
||||||
|
|
||||||
|
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
|
||||||
|
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
|
||||||
|
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
|
||||||
|
RUN ./autogen.sh
|
||||||
|
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
|
||||||
|
--prefix=${BITCOIN_PREFIX} \
|
||||||
|
--mandir=/usr/share/man \
|
||||||
|
--disable-tests \
|
||||||
|
--disable-bench \
|
||||||
|
--disable-ccache \
|
||||||
|
--with-gui=no \
|
||||||
|
--with-utils \
|
||||||
|
--with-libs \
|
||||||
|
--with-sqlite=yes \
|
||||||
|
--with-daemon
|
||||||
|
RUN make -j`nproc`
|
||||||
|
RUN make install
|
||||||
|
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
|
||||||
|
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
|
||||||
|
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
|
||||||
|
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
|
||||||
|
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
|
||||||
|
|
||||||
|
# Build stage for compiled artifacts
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
ARG UID=100
|
||||||
|
ARG GID=101
|
||||||
|
|
||||||
|
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||||
|
maintainer.1="Dev Random (@devrandom01)"
|
||||||
|
|
||||||
|
RUN addgroup bitcoin --gid ${GID} --system
|
||||||
|
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
|
||||||
|
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
|
||||||
|
RUN apk --no-cache add \
|
||||||
|
boost-filesystem \
|
||||||
|
boost-system \
|
||||||
|
boost-thread \
|
||||||
|
sqlite-dev \
|
||||||
|
libevent \
|
||||||
|
libzmq
|
||||||
|
|
||||||
|
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||||
|
ENV BITCOIN_VERSION=23.0
|
||||||
|
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||||
|
|
||||||
|
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-cli /usr/bin/bitcoin-cli
|
||||||
|
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-tx /usr/bin/bitcoin-tx
|
||||||
|
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoind /usr/bin/bitcoind
|
||||||
|
|
||||||
|
COPY bitcoind/entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
COPY assets/bitcoin.conf /bitcoin.conf
|
||||||
|
|
||||||
|
COPY bitcoind/healthcheck.sh /healthcheck.sh
|
||||||
|
RUN chmod +x /healthcheck.sh
|
||||||
|
|
||||||
|
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||||
|
|
||||||
|
EXPOSE 8332 8333 18332 18333 18444
|
||||||
|
|
||||||
|
RUN mkdir -p "${BITCOIN_DATA}"
|
||||||
|
RUN chown -R bitcoin:bitcoin "${BITCOIN_DATA}"
|
||||||
|
|
||||||
|
USER bitcoin
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh" ]
|
||||||
|
|
||||||
|
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s \
|
||||||
|
CMD ["/bin/sh", "-c", "/healthcheck.sh"]
|
||||||
|
|
||||||
|
CMD ["bitcoind"]
|
13
bitcoind/entrypoint.sh
Executable file
13
bitcoind/entrypoint.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cp -u /bitcoin.conf $BITCOIN_DATA/
|
||||||
|
|
||||||
|
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||||
|
echo "$0: assuming arguments for bitcoind"
|
||||||
|
|
||||||
|
set -- bitcoind "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
exec "$@"
|
1
bitcoind/healthcheck.sh
Executable file
1
bitcoind/healthcheck.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
bitcoin-cli --chain=$BITCOIN_CHAIN getblockchaininfo
|
69
docker-compose.yml
Normal file
69
docker-compose.yml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
bitcoin-core:
|
||||||
|
build:
|
||||||
|
dockerfile: ./bitcoind/Dockerfile
|
||||||
|
image: bitcoind
|
||||||
|
container_name: bitcoind
|
||||||
|
command:
|
||||||
|
- --testnet
|
||||||
|
- -pid=/home/bitcoin/.bitcoin/testnet3/bitcoind-testnet.pid
|
||||||
|
volumes:
|
||||||
|
- data:/home/bitcoin/.bitcoin
|
||||||
|
expose:
|
||||||
|
- 8332
|
||||||
|
- 8333
|
||||||
|
- 18332
|
||||||
|
- 18333
|
||||||
|
- 18444
|
||||||
|
ports:
|
||||||
|
- 8333:8333
|
||||||
|
- 18333:18333
|
||||||
|
- 38333:38333
|
||||||
|
networks:
|
||||||
|
LN_testing:
|
||||||
|
aliases:
|
||||||
|
- bitcoind
|
||||||
|
environment:
|
||||||
|
- BITCOIN_CHAIN=test
|
||||||
|
|
||||||
|
core-lightning:
|
||||||
|
build:
|
||||||
|
dockerfile: ./lightningd/Dockerfile
|
||||||
|
image: lightningd
|
||||||
|
container_name: lightningd
|
||||||
|
command:
|
||||||
|
- --conf=/home/lightning/.lightning/testnet-config
|
||||||
|
- --bitcoin-rpcconnect=bitcoind
|
||||||
|
- --bind-addr=core-lightning:19735
|
||||||
|
- --announce-addr=core-lightning:19735
|
||||||
|
volumes:
|
||||||
|
- clightning:/home/lightning/.lightning
|
||||||
|
expose:
|
||||||
|
- 9735
|
||||||
|
- 9835
|
||||||
|
ports:
|
||||||
|
- 9735:9735
|
||||||
|
- 19735:19735
|
||||||
|
networks:
|
||||||
|
- LN_testing
|
||||||
|
links:
|
||||||
|
- bitcoin-core:bitcoind
|
||||||
|
depends_on:
|
||||||
|
bitcoin-core:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: true
|
||||||
|
env_file:
|
||||||
|
- ./assets/testnet-env
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data:
|
||||||
|
name: bitcoin_data
|
||||||
|
external: true
|
||||||
|
clightning:
|
||||||
|
name: lightning_data
|
||||||
|
external: true
|
||||||
|
|
||||||
|
networks:
|
||||||
|
LN_testing:
|
101
lightningd/Dockerfile
Normal file
101
lightningd/Dockerfile
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
FROM alpine:3.16 as builder
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add \
|
||||||
|
alpine-sdk \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
ca-certificates \
|
||||||
|
cargo \
|
||||||
|
gettext \
|
||||||
|
git \
|
||||||
|
libsodium \
|
||||||
|
libtool \
|
||||||
|
net-tools \
|
||||||
|
postgresql-dev \
|
||||||
|
py3-mako \
|
||||||
|
python3 \
|
||||||
|
python3-dev \
|
||||||
|
sqlite-dev \
|
||||||
|
sqlite-static \
|
||||||
|
zlib-dev \
|
||||||
|
zlib-static
|
||||||
|
|
||||||
|
RUN git clone -b 2023-08-remote-hsmd-v23.08rc3 --recursive https://github.com/lightning-signer/c-lightning.git /repo --recursive && \
|
||||||
|
cd /repo && \
|
||||||
|
./configure --enable-static --prefix=/usr && \
|
||||||
|
make -j $(nproc) && \
|
||||||
|
make install
|
||||||
|
|
||||||
|
RUN apk add \
|
||||||
|
autoconf-archive \
|
||||||
|
bind-tools \
|
||||||
|
build-base \
|
||||||
|
curl-dev \
|
||||||
|
libev-dev \
|
||||||
|
pkgconf \
|
||||||
|
sqlite-dev
|
||||||
|
|
||||||
|
RUN git clone -b 2023-09-gnuc-version --recurse-submodules https://github.com/ksedgwic/clboss.git /clboss && \
|
||||||
|
cd /clboss && \
|
||||||
|
autoreconf -i && \
|
||||||
|
./configure --prefix=/usr && \
|
||||||
|
make -j $(nproc) && \
|
||||||
|
make install
|
||||||
|
|
||||||
|
FROM alpine:3.16 as runner
|
||||||
|
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||||
|
maintainer.1="Dev Random (@devrandom01)"
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add \
|
||||||
|
python3 \
|
||||||
|
postgresql \
|
||||||
|
bitcoin-cli \
|
||||||
|
pkgconf \
|
||||||
|
build-base \
|
||||||
|
bind-tools \
|
||||||
|
libev-dev \
|
||||||
|
curl-dev \
|
||||||
|
sqlite-dev
|
||||||
|
|
||||||
|
ARG LIGHTNINGD_UID=101
|
||||||
|
ENV LIGHTNINGD_USER=lightning
|
||||||
|
ENV LIGHTNINGD_HOME=/home/${LIGHTNINGD_USER}
|
||||||
|
ENV LIGHTNINGD_DATA=${LIGHTNINGD_HOME}/.lightning \
|
||||||
|
LIGHTNINGD_RPC_PORT=9835 \
|
||||||
|
LIGHTNINGD_PORT=9735 \
|
||||||
|
BITCOIND_HOME=/root/.bitcoin
|
||||||
|
|
||||||
|
COPY lightningd/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
COPY --from=builder /usr/bin/lightningd /usr/bin/
|
||||||
|
COPY --from=builder /usr/bin/lightning-cli /usr/bin/
|
||||||
|
COPY --from=builder /usr/bin/lightning-hsmtool /usr/bin/
|
||||||
|
COPY --from=builder /usr/libexec/c-lightning /usr/libexec/c-lightning
|
||||||
|
COPY --from=builder /usr/share/man/man8 /usr/share/man/man8
|
||||||
|
COPY --from=builder /usr/share/doc/c-lightning /usr/share/doc/c-lightning
|
||||||
|
COPY --from=builder /usr/bin/clboss /usr/bin/clboss
|
||||||
|
|
||||||
|
RUN addgroup -S lightning && adduser -S lightning -G lightning && \
|
||||||
|
mkdir -p ${LIGHTNINGD_DATA} && \
|
||||||
|
touch ${LIGHTNINGD_DATA}/config && \
|
||||||
|
chown -R lightning:lightning "${LIGHTNINGD_DATA}"
|
||||||
|
|
||||||
|
VOLUME ["${LIGHTNINGD_DATA}"]
|
||||||
|
|
||||||
|
RUN mkdir -p "${BITCOIND_HOME}" && \
|
||||||
|
chown -R lightning:lightning "${BITCOIND_HOME}"
|
||||||
|
|
||||||
|
COPY assets/bitcoin.conf "${BITCOIND_HOME}"/bitcoin.conf
|
||||||
|
COPY assets/testnet-config /testnet-config
|
||||||
|
|
||||||
|
USER lightning
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s \
|
||||||
|
CMD lighting-cli --testnet getinfo
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["lightningd"]
|
15
lightningd/entrypoint.sh
Executable file
15
lightningd/entrypoint.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cp -u /testnet-config ${LIGHTNINGD_DATA}/testnet-config
|
||||||
|
|
||||||
|
export GREENLIGHT_VERSION=$(lightningd --version)
|
||||||
|
|
||||||
|
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||||
|
echo "$0: assuming arguments for lightningd"
|
||||||
|
|
||||||
|
set -- lightningd "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user