diff --git a/README.md b/README.md index e5bab41bb4d18b87e97c04b5ce666f118cbd8c8a..737159de70c08b93e1c3c03e09072c2a3c757cf0 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,20 @@ Go Gitlab **Settings** -> **CI/CD** -> **Variables** FAIRCOIN_CONF # faircoin.conf file FAIRCOIN_PORT # faircoind -port ~~~ + +## Development <small>( manual usage )</small> + +If you want create an instance manual then follow the instructions. + +1. clone this project +2. change configuration in ./env +3. run services by ./control.sh + +~~~ +chmod +x ./control.sh +./control.sh build +./control.sh start +./control.sh stop +./control.sh uninstall +./control.sh remove +~~~ diff --git a/control.sh b/control.sh new file mode 100644 index 0000000000000000000000000000000000000000..1efba97ce97d109e2bae2eae97e50d25ae37110e --- /dev/null +++ b/control.sh @@ -0,0 +1,34 @@ +#!/bin/bash +export RUNNER_UID=`id -u` +export RUNNER_GID=`id -g` +export `cat ./env/*` + +case $1 in + "build") + mkdir -p ~/.faircoin2 + chmod +x ./script/blocknotify.sh + docker-compose stop + docker-compose down + docker-compose build + ;; + "start") + chmod +x ./script/blocknotify.sh + docker-compose stop + docker-compose down + source ${FAIRCOIN_CONF} + if [ ! -f "~/.faircoin2/faircoin.conf" ]; then echo -e "rpcconnect=${rpcconnect}\nrpcport=${rpcport}\nrpcuser=${rpcuser}\nrpcpassword=${rpcpassword}\ntxindex=1" > ~/.faircoin2/faircoin.conf; fi + docker-compose up -d + ;; + "stop") + docker-compose stop + ;; + "uninstall") + docker-compose stop + docker-compose down + ;; + "remove") + docker-compose stop + docker-compose down +# rm -R ~/.faircoin2 #### dont use this command if you have some wallet.dat in your ~/.faircoin2 folder !!! In this case remove the block databases manually. + ;; +esac diff --git a/docker-compose.yml b/docker-compose.yml index 8f77371d46b47c8c8e7096140ee4bbe25388c7e8..bacf9264bf39b2576e31e57d962ce4b72aa44b82 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: RUNNER_GID: "${RUNNER_GID}" FAIRCOIN_PORT: ${FAIRCOIN_PORT} env_file: - - ../faircoind.tmp/FAIRCOIN_CONF + - ${FAIRCOIN_CONF} container_name: FairCoin.Co-faircoind restart: always command: '-disablewallet -port=${FAIRCOIN_PORT} -blocknotify=/home/faircoin/script/blocknotify.sh' diff --git a/env/FAIRCOIN_CONF b/env/FAIRCOIN_CONF new file mode 100644 index 0000000000000000000000000000000000000000..6d9dea664f37883ff42885a1284435149bc1b204 --- /dev/null +++ b/env/FAIRCOIN_CONF @@ -0,0 +1 @@ +FAIRCOIN_CONF=./env_file/FAIRCOIN_CONF diff --git a/env/FAIRCOIN_PORT b/env/FAIRCOIN_PORT new file mode 100644 index 0000000000000000000000000000000000000000..6f8e1a68e8810087d6db3fbafd1336fe036527f7 --- /dev/null +++ b/env/FAIRCOIN_PORT @@ -0,0 +1 @@ +FAIRCOIN_PORT=40404 diff --git a/env_file/FAIRCOIN_CONF b/env_file/FAIRCOIN_CONF new file mode 100644 index 0000000000000000000000000000000000000000..2a6468527a81d86e5cb034a45d536969635a79eb --- /dev/null +++ b/env_file/FAIRCOIN_CONF @@ -0,0 +1,5 @@ +rpcconnect=0.0.0.0 +rpcport=8332 +rpcuser=faircoin +rpcpassword=password +txindex=1