summaryrefslogtreecommitdiff
path: root/bin/taler-deployment-top-reserve
blob: c20d3e32d47c774488f794e2dda5d6ef82fea82d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash

set -eu

if test -z $TALER_ENV_NAME || test -z $TALER_CONFIG_CURRENCY; then
  echo "Please source ~/activate"
  exit 1
fi

# %N is current nanoseconds.
UUID=$(date +"uuid-%N")

instance=default

reserve_priv_filename=$(taler-config -s "instance-$instance" -o tip_reserve_priv_filename -f)

echo "Reading tipping reserve private key from $reserve_priv_filename"

RESERVE=$(gnunet-ecc -p "$reserve_priv_filename")

failed=0
taler-bank-transfer \
  --amount="$TALER_CONFIG_CURRENCY:100.00" \
  --bank="https://bank.$TALER_ENV_NAME.taler.net/" \
  --credit=2 \
  --debit=8 \
  --log="INFO" \
  --pass="x" \
  --subject=$RESERVE \
  --user="Survey" || failed=1

if [[ $failed = 1 ]]; then
  echo Wire transfer failed!
  exit 1
fi