From 215e0f26febb3e41063f5bf5f9e1a53b1d815c6f Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Thu, 3 Aug 2023 17:53:58 +0200 Subject: [PATCH] docker: remove litcoin docker scripts --- docker/docker-compose.ltc.yml | 55 -------------------------- docker/lnd/start-lnd.sh | 3 -- docker/ltcd/Dockerfile | 49 ----------------------- docker/ltcd/start-ltcctl.sh | 59 ---------------------------- docker/ltcd/start-ltcd.sh | 74 ----------------------------------- 5 files changed, 240 deletions(-) delete mode 100644 docker/docker-compose.ltc.yml delete mode 100644 docker/ltcd/Dockerfile delete mode 100755 docker/ltcd/start-ltcctl.sh delete mode 100755 docker/ltcd/start-ltcd.sh diff --git a/docker/docker-compose.ltc.yml b/docker/docker-compose.ltc.yml deleted file mode 100644 index 0e4602000..000000000 --- a/docker/docker-compose.ltc.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: '2' -services: - # ltc is an image of litecoin node which used as base image for ltcd and - # ltcctl. The environment variables default values determined on stage of - # container start within starting script. - ltcd: - image: ltcd - container_name: ltcd - build: - context: ltcd/ - volumes: - - shared:/rpc - - litecoin:/data - environment: - - RPCUSER - - RPCPASS - - NETWORK - - DEBUG - - MINING_ADDRESS - entrypoint: ["./start-ltcd.sh"] - - lnd: - image: lnd - container_name: lnd_ltc - build: - context: ../ - dockerfile: dev.Dockerfile - environment: - - RPCUSER - - RPCPASS - - NETWORK - - CHAIN=litecoin - - DEBUG - volumes: - - shared:/rpc - - lnd_ltc:/root/.lnd - entrypoint: ["./start-lnd.sh"] - links: - - "ltcd:blockchain" - -volumes: - # shared volume is need to store the btcd rpc certificates and use it within - # ltcctl and lnd containers. - shared: - driver: local - - # litecoin volume is needed for maintaining blockchain persistence - # during ltcd container recreation. - litecoin: - driver: local - - # lnd volume is used for persisting lnd application data and chain state - # during container lifecycle. - lnd_ltc: - driver: local diff --git a/docker/lnd/start-lnd.sh b/docker/lnd/start-lnd.sh index 6470f8b4c..8a291a2e8 100755 --- a/docker/lnd/start-lnd.sh +++ b/docker/lnd/start-lnd.sh @@ -48,9 +48,6 @@ NETWORK=$(set_default "$NETWORK" "simnet") CHAIN=$(set_default "$CHAIN" "bitcoin") BACKEND="btcd" HOSTNAME=$(hostname) -if [[ "$CHAIN" == "litecoin" ]]; then - BACKEND="ltcd" -fi # CAUTION: DO NOT use the --noseedback for production/mainnet setups, ever! # Also, setting --rpclisten to $HOSTNAME will cause it to listen on an IP diff --git a/docker/ltcd/Dockerfile b/docker/ltcd/Dockerfile deleted file mode 100644 index 38547ceab..000000000 --- a/docker/ltcd/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM golang:1.21.0-alpine as builder - -LABEL maintainer="Olaoluwa Osuntokun " - -# Grab and install the latest version of roasbeef's fork of ltcd and all -# related dependencies. -WORKDIR $GOPATH/src/github.com/ltcsuite/ltcd -RUN apk add --no-cache --update alpine-sdk git -RUN git clone https://github.com/ltcsuite/ltcd ./ -RUN go install -v . ./cmd/... -RUN go install . ./cmd/ltcctl ./cmd/gencerts - -# Start a new image -FROM alpine as final - -# Expose mainnet ports (server, rpc) -EXPOSE 9333 9334 - -# Expose testnet ports (server, rpc) -EXPOSE 19334 19335 - -# Expose simnet ports (server, rpc) -EXPOSE 18555 18556 - -# Copy the compiled binaries from the builder image. -COPY --from=builder /go/bin/ltcctl /bin/ -COPY --from=builder /go/bin/ltcd /bin/ -COPY --from=builder /go/bin/gencerts /bin/ - -COPY "start-ltcctl.sh" . -COPY "start-ltcd.sh" . - -RUN apk add --no-cache \ - bash \ - ca-certificates \ -&& chmod +x start-ltcctl.sh \ -&& chmod +x start-ltcd.sh \ -&& mkdir "/rpc" "/root/.ltcd" "/root/.ltcctl" \ -&& touch "/root/.ltcd/ltcd.conf" \ -# "ltcctl" and "lnd" to "ltcd" over docker links. -&& "/bin/gencerts" --host="*" --directory="/rpc" --force - -# Create a volume to house pregenerated RPC credentials. This will be -# shared with any lnd, btcctl containers so they can securely query ltcd's RPC -# server. -# You should NOT do this before certificate generation! -# Otherwise manually generated certificate will be overridden with shared -# mounted volume! For more info read dockerfile "VOLUME" documentation. -VOLUME ["/rpc"] diff --git a/docker/ltcd/start-ltcctl.sh b/docker/ltcd/start-ltcctl.sh deleted file mode 100755 index 2888ab9c0..000000000 --- a/docker/ltcd/start-ltcctl.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash - -# exit from script if error was raised. -set -e - -# error function is used within a bash function in order to send the error -# message directly to the stderr output and exit. -error() { - echo "$1" > /dev/stderr - exit 0 -} - -# return is used within bash function in order to return the value. -return() { - echo "$1" -} - -# set_default function gives the ability to move the setting of default -# env variable from docker file to the script thereby giving the ability to the -# user override it durin container start. -set_default() { - # docker initialized env variables with blank string and we can't just - # use -z flag as usually. - BLANK_STRING='""' - - VARIABLE="$1" - DEFAULT="$2" - - if [[ -z "$VARIABLE" || "$VARIABLE" == "$BLANK_STRING" ]]; then - - if [ -z "$DEFAULT" ]; then - error "You should specify default variable" - else - VARIABLE="$DEFAULT" - fi - fi - - return "$VARIABLE" -} - -# Set default variables if needed. -RPCUSER=$(set_default "$RPCUSER" "devuser") -RPCPASS=$(set_default "$RPCPASS" "devpass") -NETWORK=$(set_default "$NETWORK" "simnet") - -PARAMS="" -if [ "$NETWORK" != "mainnet" ]; then - PARAMS="--$NETWORK" -fi - -PARAMS=$(echo $PARAMS \ - "--rpccert=/rpc/rpc.cert" \ - "--rpcuser=$RPCUSER" \ - "--rpcpass=$RPCPASS" \ - "--rpcserver=localhost" \ -) - -PARAMS="$PARAMS $@" -exec ltcctl $PARAMS diff --git a/docker/ltcd/start-ltcd.sh b/docker/ltcd/start-ltcd.sh deleted file mode 100755 index b6c6d6990..000000000 --- a/docker/ltcd/start-ltcd.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env bash - -# exit from script if error was raised. -set -e - -# error function is used within a bash function in order to send the error -# message directly to the stderr output and exit. -error() { - echo "$1" > /dev/stderr - exit 0 -} - -# return is used within bash function in order to return the value. -return() { - echo "$1" -} - -# set_default function gives the ability to move the setting of default -# env variable from docker file to the script thereby giving the ability to the -# user override it durin container start. -set_default() { - # docker initialized env variables with blank string and we can't just - # use -z flag as usually. - BLANK_STRING='""' - - VARIABLE="$1" - DEFAULT="$2" - - if [[ -z "$VARIABLE" || "$VARIABLE" == "$BLANK_STRING" ]]; then - - if [ -z "$DEFAULT" ]; then - error "You should specify default variable" - else - VARIABLE="$DEFAULT" - fi - fi - - return "$VARIABLE" -} - -# Set default variables if needed. -RPCUSER=$(set_default "$RPCUSER" "devuser") -RPCPASS=$(set_default "$RPCPASS" "devpass") -DEBUG=$(set_default "$DEBUG" "info") -NETWORK=$(set_default "$NETWORK" "simnet") - -PARAMS="" -if [ "$NETWORK" != "mainnet" ]; then - PARAMS="--$NETWORK" -fi - -PARAMS=$(echo $PARAMS \ - "--debuglevel=$DEBUG" \ - "--rpcuser=$RPCUSER" \ - "--rpcpass=$RPCPASS" \ - "--datadir=/data" \ - "--logdir=/data" \ - "--rpccert=/rpc/rpc.cert" \ - "--rpckey=/rpc/rpc.key" \ - "--rpclisten=0.0.0.0" \ - "--txindex" -) - -# Set the mining flag only if address is non empty. -if [[ -n "$MINING_ADDRESS" ]]; then - PARAMS="$PARAMS --miningaddr=$MINING_ADDRESS" -fi - -# Add user parameters to command. -PARAMS="$PARAMS $@" - -# Print command and start bitcoin node. -echo "Command: ltcd $PARAMS" -exec ltcd $PARAMS