Skip to content

Commit

Permalink
Merge pull request #8 from SatoshiPortal/releases/v0.5.0
Browse files Browse the repository at this point in the history
Releases/v0.5.0
  • Loading branch information
Kexkey authored Oct 16, 2020
2 parents f3007c9 + 0e70ad7 commit c344567
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 1 deletion.
18 changes: 18 additions & 0 deletions batcher/data/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"LOG": "DEBUG",
"BASE_DIR": "/batcher",
"DATA_DIR": "data",
"DB_NAME": "batcher.sqlite",
"URL_SERVER": "http://batcher",
"URL_PORT": 8000,
"URL_CTX_WEBHOOKS": "webhooks",
"SESSION_TIMEOUT": 600,
"CN_URL": "https://gatekeeper:2009/v0",
"CN_API_ID": "003",
"CN_API_KEY": "39b83c35972aeb81a242bfe189dc0a22da5ac6cbb64072b492f2d46519a97618",
"DEFAULT_BATCHER_ID": 1,
"BATCH_TIMEOUT_MINUTES": 60,
"CHECK_THRESHOLD_MINUTES": 10,
"BATCH_THRESHOLD_AMOUNT": 0.5,
"BATCH_CONF_TARGET": 6
}
26 changes: 26 additions & 0 deletions batcher/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3"

services:
batcher:
environment:
- "TRACING=1"
- "CYPHERNODE_URL=https://gatekeeper:${GATEKEEPER_PORT}"
image: cyphernode/batcher:v0.1.0
entrypoint: ["npm", "run", "start:dev"]
volumes:
- "$APP_SCRIPT_PATH/data:/batcher/data"
- "$GATEKEEPER_DATAPATH/certs/cert.pem:/batcher/cert.pem:ro"
- "$LOGS_DATAPATH:/batcher/logs"
networks:
- cyphernodeappsnet
restart: always
labels:
- "traefik.docker.network=cyphernodeappsnet"
- "traefik.frontend.rule=PathPrefixStrip:/batcher"
- "traefik.frontend.passHostHeader=true"
- "traefik.enable=true"
- "traefik.port=8000"
- "traefik.frontend.auth.basic.users=<username:bcrypt>"
networks:
cyphernodeappsnet:
external: true
Empty file added batcher/isCoreApp
Empty file.
40 changes: 40 additions & 0 deletions batcher/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

timeout_feature() {
local interval=10
local totaltime=60
local testwhat=${1}
local returncode
local endtime=$(($(date +%s) + ${totaltime}))

while :
do
eval ${testwhat}
returncode=$?

# If no error or 2 minutes passed, we get out of this loop
([ "${returncode}" -eq "0" ] || [ $(date +%s) -gt ${endtime} ]) && break

printf "\e[1;31mMaybe it's too early, I'll retry every ${interval} seconds for $((${totaltime} / 60)) minutes ($((${endtime} - $(date +%s))) seconds left).\e[1;0m\r\n"

sleep ${interval}
done

return ${returncode}
}

do_test() {
local rc
rc=$(curl -k -s -o /dev/null -w "%{http_code}" https://127.0.0.1:${TRAEFIK_HTTPS_PORT}/batcher)
[ "${rc}" -ne "401" ] && return 400
return 0
}

export TRAEFIK_HTTPS_PORT

timeout_feature do_test
returncode=$?

# return 0: tests cool
# return 1: tests failed
return $returncode
2 changes: 1 addition & 1 deletion sparkwallet/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
services:
cyphernode_sparkwallet:
command: --no-tls ${TOR_PARAMS}
image: cyphernode/sparkwallet:v0.2.12
image: cyphernode/sparkwallet:v0.2.16
environment:
- "NETWORK=${NETWORK}"
volumes:
Expand Down

0 comments on commit c344567

Please sign in to comment.