wallet-core/README

134 lines
3.3 KiB
Plaintext
Raw Normal View History

2020-11-16 16:51:09 +01:00
# GNU Taler Wallet
2016-04-08 15:20:05 +02:00
2020-08-10 13:32:08 +02:00
This repository contains the implementation of a wallet for GNU Taler written
in TypeScript.
2016-04-08 15:20:05 +02:00
2015-11-25 20:41:31 +01:00
2020-11-16 16:51:09 +01:00
## Dependencies
2020-11-04 14:16:28 +01:00
2020-11-25 16:30:31 +01:00
The following dependencies are required to build the wallet:
* python>=3.8
* nodejs>=12
* jq
* npm
* pnpm
* zip
2020-11-04 14:16:28 +01:00
2020-11-16 16:51:09 +01:00
## Installation
2016-03-18 15:47:17 +01:00
2020-11-16 16:51:09 +01:00
The CLI version of the wallet supports the normal GNU installation process.
2020-11-16 16:51:09 +01:00
```shell
./configure [ --prefix=$PREFIX ] && make install
```
### Compiling from Git
If you are compiling the code from git, you have to run `./bootstrap` before
running `./configure`.
2020-11-16 16:51:09 +01:00
### Building the WebExtension
2020-11-04 14:16:28 +01:00
The WebExtension can be built via the 'webextension' make target:
2020-11-16 16:51:09 +01:00
```shell
./configure && make webextension
```
2020-11-04 14:16:28 +01:00
2020-11-25 18:27:58 +01:00
This will create the zip file with the WebExtension in the directory
2020-11-04 14:16:28 +01:00
2020-11-16 16:51:09 +01:00
```
2020-11-25 18:27:58 +01:00
packages/taler-wallet-webextension/extension/
2020-11-16 16:51:09 +01:00
```
We also provide a `Dockerfile` for a container that can build the
WebExtension. After you install docker, make sure the user is in group
`docker` and (re-)start the docker daemon:
```shell
# Make sure there is a docker group.
$ grep docker: /etc/group
$ sudo groupadd docker
# Make sure USER is defined and is in the docker group.
$ echo $USER
$ sudo usermod -aG docker $USER
# Restart the docker daemon.
# (This command is OS-specific.)
# Obtain a new shell. Make sure it includes the `docker` group.
$ newgrp docker
$ id
```
Then, you can proceed with these instructions:
2020-11-25 16:30:31 +01:00
```shell
2020-11-25 18:27:58 +01:00
# Download wallet source code and unpack it
(host)$ tar -xf wallet-core-$version.tar.gz
2020-11-25 16:30:31 +01:00
# Build the image
2020-11-25 18:27:58 +01:00
(host)$ docker build --tag walletbuilder wallet-core-$version/contrib/wallet-docker
# Start the container
(host)$ docker run -dti --name walletcontainer walletbuilder /bin/bash
2020-11-25 16:30:31 +01:00
2020-11-25 18:27:58 +01:00
# Copy wallet source to container
(host)$ docker cp ./wallet-core-$version/ walletcontainer:/
# Attach to container
(host)$ docker attach walletcontainer
2020-11-25 16:30:31 +01:00
# Run build inside container
2020-11-25 18:27:58 +01:00
(container)$ cd wallet-core-$version
2020-11-25 16:30:31 +01:00
(container)$ ./configure && make webextension
2020-11-25 18:27:58 +01:00
(container)$ exit
# Copy build artefact(s) to host
(host)$ docker cp walletcontainer:/wallet-core-$version/packages/taler-wallet-webextension/extension extension
2020-11-25 16:30:31 +01:00
```
### Reviewing WebExtension UI examples
2020-11-25 16:30:31 +01:00
The WebExtension can be tested using Storybook. Using live server or building
static html files to deploy into nginx.
2020-11-04 14:16:28 +01:00
To run a live server use the 'dev-view' target
```shell
make dev-view
```
A server will start, usually at http://localhost:6006/.
On the left it will have a navigation panel with examples organized in a tree view.
Stories are defined with a *.stories.tsx file [1], you are free to create new or edit
some and commit them in order to create a more complete set of examples.
2020-11-04 14:16:28 +01:00
[1] look for them at packages/taler-wallet-webextension/src/**/*.stories.tsx
2020-11-16 16:51:09 +01:00
# Integration Tests
2016-04-08 15:20:05 +02:00
2020-08-10 13:32:08 +02:00
This repository comes with integration tests for GNU Taler. To run them,
install the wallet first. Then use the test runner from the
taler-integrationtests package:
2016-03-18 15:47:17 +01:00
2020-11-16 16:51:09 +01:00
```shell
cd packages/taler-integrationtests/
./testrunner '*'
```
2016-03-18 15:47:17 +01:00
2020-08-10 13:32:08 +02:00
The test runner accepts a bash glob pattern as parameter. Individual tests can
be run by specifying their name.
2020-09-04 10:43:56 +02:00
To check coverage, use nyc from the root of the repository and make sure that the taler-wallet-cli
from the source tree is executed, and not the globally installed one:
2020-11-16 16:51:09 +01:00
```
PATH="$PWD/packages/taler-wallet-cli/bin:$PATH" \
nyc ./packages/taler-integrationtests/testrunner '*'
```