summaryrefslogtreecommitdiff
path: root/src/auditor/generate-auditor-basedb.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-14 18:27:16 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-14 18:27:16 +0100
commit4a519078e803c8ff042833a2200c5b6a0297fbe7 (patch)
treee25c5ef53af137b949acaa6411f0d2917f0a3418 /src/auditor/generate-auditor-basedb.sh
parent45926ec067d82a1e4c2b28b5680baddc1e8dae0b (diff)
downloadexchange-4a519078e803c8ff042833a2200c5b6a0297fbe7.tar.gz
exchange-4a519078e803c8ff042833a2200c5b6a0297fbe7.tar.bz2
exchange-4a519078e803c8ff042833a2200c5b6a0297fbe7.zip
update generator scripts to use new -offline tools (WiP)
Diffstat (limited to 'src/auditor/generate-auditor-basedb.sh')
-rwxr-xr-xsrc/auditor/generate-auditor-basedb.sh66
1 files changed, 52 insertions, 14 deletions
diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh
index c41d4a982..b934785f5 100755
--- a/src/auditor/generate-auditor-basedb.sh
+++ b/src/auditor/generate-auditor-basedb.sh
@@ -98,27 +98,18 @@ taler-config -c $CONF -s bank -o database -V postgres:///$TARGET_DB
# setup exchange
echo "Setting up exchange"
taler-exchange-dbinit -c $CONF
-taler-exchange-wire -c $CONF 2> taler-exchange-wire.log
-taler-exchange-keyup -L INFO -c $CONF -o e2a.dat 2> taler-exchange-keyup.log
# setup auditor
echo "Setting up auditor"
taler-auditor-dbinit -c $CONF
taler-auditor-exchange -c $CONF -m $MASTER_PUB -u $EXCHANGE_URL
-taler-auditor-sign -c $CONF -u $AUDITOR_URL -r e2a.dat -o a2e.dat -m $MASTER_PUB
-rm -f e2a.dat
-
-# provide auditor's signature to exchange
-ABD=`taler-config -c $CONF -s EXCHANGEDB -o AUDITOR_BASE_DIR -f`
-mkdir -p $ABD
-mv a2e.dat $ABD
# Launch services
echo "Launching services"
-taler-bank-manage-testing $CONF postgres:///$TARGET_DB serve &
+taler-bank-manage-testing $CONF postgres:///$TARGET_DB serve &> taler-bank.log &
TFN=`which taler-exchange-httpd`
TBINPFX=`dirname $TFN`
-TLIBEXEC=${BINPFX}/../lib/libexec/taler/
+TLIBEXEC=${TBINPFX}/../lib/taler/libexec/
$TLIBEXEC/taler-helper-crypto-eddsa -c $CONF 2> taler-helper-crypto-eddsa.log &
$TLIBEXEC/taler-helper-crypto-rsa -c $CONF 2> taler-helper-crypto-rsa.log &
taler-exchange-httpd -c $CONF 2> taler-exchange-httpd.log &
@@ -126,6 +117,23 @@ taler-merchant-httpd -c $CONF -L INFO 2> taler-merchant-httpd.log &
taler-exchange-wirewatch -c $CONF 2> taler-exchange-wirewatch.log &
taler-auditor-httpd -c $CONF 2> taler-auditor-httpd.log &
+# Wait for all bank to be available (usually the slowest)
+for n in `seq 1 50`
+do
+ echo -n "."
+ sleep 0.2
+ OK=0
+ # bank
+ wget http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null || continue
+ OK=1
+ break
+done
+
+if [ 1 != $OK ]
+then
+ exit_skip "Failed to launch services"
+fi
+
# Wait for all services to be available
for n in `seq 1 50`
do
@@ -133,11 +141,9 @@ do
sleep 0.1
OK=0
# exchange
- wget http://localhost:8081/ -o /dev/null -O /dev/null >/dev/null || continue
+ wget http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue
# merchant
wget http://localhost:9966/ -o /dev/null -O /dev/null >/dev/null || continue
- # bank
- wget http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null || continue
# Auditor
wget http://localhost:8083/ -o /dev/null -O /dev/null >/dev/null || continue
OK=1
@@ -148,9 +154,41 @@ if [ 1 != $OK ]
then
exit_skip "Failed to launch services"
fi
+echo " DONE"
+
+echo -n "Setting up keys"
+taler-exchange-offline -c $CONF \
+ download sign \
+ enable-account payto://x-taler-bank/localhost/2 \
+ wire-fee now x-taler-bank TESTKUDOS:0.01 TESTKUDOS:0.01 \
+ upload &> taler-exchange-offline.log
+
+echo -n "."
+
+for n in `seq 1 2`
+do
+ echo -n "."
+ OK=0
+ # bank
+ wget --timeout=1 http://localhost:8081/keys -o /dev/null -O /dev/null >/dev/null || continue
+ OK=1
+ break
+done
+
+if [ 1 != $OK ]
+then
+ exit_skip "Failed to setup keys"
+fi
+
+taler-auditor-offline -c $CONF \
+ download sign upload &> taler-auditor-offline.log
+
+echo " DONE"
# Setup merchant
+echo -n "Setting up merchant"
+
curl -H "Content-Type: application/json" -X POST -d '{"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 3600000},"default_pay_delay":{"d_ms": 3600000}}' http://localhost:9966/private/instances