cashless2ecash

cashless2ecash: pay with cards for digital cash (experimental)
Log | Files | Refs | README

installation_notes.md (3090B)


      1 # Installation of C2EC and surrounding components
      2 
      3 how to install exchange and C2EC
      4 
      5 ## Prerequisites
      6 
      7 - Debian
      8 - git
      9 - postgres >= 15.6
     10 - go ([installing Go](https://go.dev/doc/install))
     11 - it's a good idea to read [Exchange Operator Manual](https://docs.taler.net/taler-exchange-manual.html) first
     12 
     13 ## Required Exchange binaries
     14 
     15 To allow the withdrawal of Taler, I will need following binaries:
     16 
     17 - taler-exchange-httpd
     18 - taler-exchange-secmod-rsa
     19 - taler-exchange-secmod-cs
     20 - taler-exchange-secmod-eddsa
     21 - taler-exchange-closer
     22 - taler-exchange-wirewatch
     23 
     24 ## Setup Commands
     25 
     26 ```bash
     27 # Add taler repo and install
     28 sudo echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian bookworm main" > /etc/apt/sources.list.d/taler.list`
     29 sudo wget -O /etc/apt/keyrings/taler-systems.gpg https://taler.net/taler-systems.gpg
     30 sudo apt update
     31 sudo apt install taler-exchange
     32 
     33 # install git
     34 sudo apt install git
     35 
     36 # download Go and install
     37 export GO_TAR=go1.22.2.linux-amd64.tar.gz
     38 sudo wget -O $GO_TAR https://go.dev/dl/$GO_TAR
     39 sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf $GO_TAR
     40 echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.profile
     41 source $HOME/.profile
     42 go version
     43 ```
     44 
     45 ## Configure
     46 
     47 ### Getting the source
     48 
     49 `git clone https://git.taler.net/cashless2ecash.git`
     50 
     51 ### Preparing the database
     52 
     53 ```bash
     54 sudo passwd postgres  # change default password of postgres user
     55 su postgres
     56 psql
     57 ```
     58 
     59 ```sql
     60 CREATE DATABASE c2ec;
     61 CREATE USER c2ec_admin WITH ENCRYPTED PASSWORD [..]; -- keepass
     62 GRANT ALL PRIVILEGES ON DATABASE c2ec TO c2ec_admin;
     63 --For CLI (managing terminals and providers):
     64 CREATE USER c2ec_operator WITH ENCRYPTED PASSWORD [..]; -- keepass
     65 --For the API (handling withdrawals):
     66 CREATE USER c2ec_api WITH ENCRYPTED PASSWORD [..]; -- keepass
     67 ```
     68 
     69 exit psql, change back to normal user (type 2x 'exit')
     70 
     71 ### Setting up c2ec schmema
     72 find src directory of cashless2ecash, find c2ec/install/setup_db.sh
     73 
     74 ```bash
     75 export PGHOST=localhost`
     76 export PGPORT=5432
     77 ./setup_db.sh c2ec_admin [PASSWORD OBFUSCATED] c2ec ./..
     78 su postgres
     79 psql -d c2ec
     80 ```
     81 
     82 Grant rights on tables, triggers and functions to the users `c2ec_api` and `c2ec_operator`
     83 
     84 ```sql
     85 GRANT USAGE ON SCHEMA c2ec TO c2ec_api;
     86 GRANT USAGE ON SCHEMA c2ec TO c2ec_operator;
     87 GRANT ALL PRIVILEGES ON c2ec.withdrawal TO c2ec_api;
     88 GRANT SELECT ON c2ec.terminal TO c2ec_api;
     89 GRANT SELECT ON c2ec.provider TO c2ec_api;
     90 GRANT EXECUTE ON FUNCTION c2ec.emit_withdrawal_status TO c2ec_api;
     91 GRANT EXECUTE ON FUNCTION c2ec.emit_payment_notification TO c2ec_api;
     92 GRANT EXECUTE ON FUNCTION c2ec.emit_retry_notification TO c2ec_api;
     93 GRANT EXECUTE ON FUNCTION c2ec.emit_transfer_notification TO c2ec_api;
     94 GRANT ALL PRIVILEGES ON c2ec.terminal TO c2ec_operator;
     95 GRANT ALL PRIVILEGES ON c2ec.provider TO c2ec_operator;
     96 ```
     97 
     98 ### Building and Running the app
     99 
    100 Building the cli (used to manage terminals and providers)
    101 
    102 ```bash
    103 ./build_cli.sh ./../cli $HOME
    104 .$HOME/cli
    105 ```
    106 
    107 Building c2ec
    108 
    109 ```bash
    110 ./build_app.sh ./../c2ec $HOME
    111 cp $HOME/cashless2ecash/c2ec/c2ec-config.yaml $HOME
    112 # configure correctly
    113 .$HOME/c2ec
    114 ```