This commit is contained in:
jash
2018-10-08 14:09:40 +02:00
committed by kexkey
parent 7479433f4a
commit ff23c419bc
14 changed files with 193 additions and 60 deletions

View File

@@ -1,25 +1,13 @@
. ./docker.sh
. ./cyphernodeconf.sh
configure() {
trace "Updating SatoshiPortal dockers"
#git submodule update --recursive --remote
#
## build SatoshiPortal images
#local arch=x86_64
#build_docker_image ../SatoshiPortal/dockers/$arch/bitcoin-core btcnode
#build_docker_image ../SatoshiPortal/dockers/$arch/LN/c-lightning clnimg
#
## build cyphernode images
#build_docker_image ../../cron_docker/ proxycronimg
build_docker_image ../../proxy_docker/ btcproxyimg
#build_docker_image ../../pycoin_docker/ pycoinimg
#
local current_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
## build setup docker image
build_docker_image ../ cyphernodeconf && clear && echo "Thinking..."
# configure features of cyphernode
cyphernodeconf_configure
docker run -v $current_path/../data:/data \
--log-driver=none\
--rm -it cyphernodeconf:latest
#docker image rm cyphernodeconf:latest
}

View File

@@ -1,12 +0,0 @@
# this will run configure.sh of the specified package inside a
# cyphernodeconf container. This way we ensure we have the right
# environment and do not pollute the host machine with utility
# commands not needed for runtime
cyphernodeconf_configure() {
local current_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
docker run -v $current_path/../data:/data \
--log-driver=none\
--rm -it cyphernodeconf:latest
}

View File

@@ -1,6 +1,6 @@
build_docker_image() {
trace "building docker image: $1 with tag $2:latest"
docker build $1 -t $2:latest
trace "building docker image: $2:latest"
docker build -q $1 -t $2:latest > /dev/null
}

View File

@@ -1,3 +1,13 @@
. ./install_docker.sh
. ./install_lunanode.sh
install() {
echo "Installation phase not implemented yet"
. ../data/installer/config.sh
if [[ ''$INSTALLER_MODE == 'none' ]]; then
echo "Skipping installation phase"
elif [[ ''$INSTALLER_MODE == 'docker' ]]; then
install_docker
elif [[ ''$INSTALLER_MODE == 'lunanode' ]]; then
install_lunanode
fi
}

View File

@@ -0,0 +1,34 @@
install_docker() {
echo
if [[ $BITCOIN_INTERAL == true || $FEATURE_LIGHTNING == true ]]; then
trace "Updating SatoshiPortal repos"
git submodule update --recursive --remote
fi
# build SatoshiPortal images
local arch=$(uname -m) #x86_64
if [[ $BITCOIN_INTERNAL == true ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/bitcoin-core cyphernode/bitcoin
fi
if [[ $FEATURE_LIGHTNING == true ]]; then
build_docker_image ../SatoshiPortal/dockers/$arch/LN/c-lightning cyphernode/clightning
fi
if [[ $FEATURE_OPENTIMESTAMPS == true ]]; then
trace "Opentimestamps support not implemented"
fi
# build cyphernode images
trace "Creating cyphernode dockers"
build_docker_image ../../proxy_docker/ cyphernode/proxy
build_docker_image ../../cron_docker/ cyphernode/proxycron
build_docker_image ../../pycoin_docker/ cyphernode/pycoin
trace "Creating cyphernode network"
docker network create cyphernodenet > /dev/null 2>&1
}

View File

@@ -0,0 +1,3 @@
install_lunanode() {
trace "Lunanode installation not implemented"
}

View File

@@ -3,9 +3,31 @@
. ./trace.sh
. ./configure.sh
. ./install.sh
. ./docker.sh
echo "Starting configuration phase"
configure
CONFIGURE=0
INSTALL=0
echo "Starting installation phase"
install
while getopts ":ci" opt; do
case $opt in
c)
CONFIGURE=1
;;
i)
INSTALL=1
;;
\?)
echo "Invalid option: -$OPTARG. Use -c to configure and -i to install" >&2
;;
esac
done
if [[ $CONFIGURE == 1 ]]; then
echo "Starting configuration phase"
configure
fi
if [[ $INSTALL == 1 ]]; then
echo "Starting installation phase"
install
fi