diem / reference-wallet

A reference wallet.
Apache License 2.0
15 stars 13 forks source link

Note to readers: On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. All projects will remain available for use here until the migration to the new GitHub Organization is complete.

Reference Wallet

Diem Reference Wallet is an open-source project aimed at helping developers kickstart wallet building in the Diem ecosystem. We tried to incorporate both technical and design aspects to show not only how the different technical pieces fit together but also demonstrate thoughtful design, content, and best experience practices.

Note to Developers

Getting Started

Setup instructions and system requirements can be found here: backend

Project Organization

The project is separated into the following components:

The backend system comprises of a Python server that consumes the python sdk client and the pub-sub-proxy. python sdk client is used for submitting and requesting transactions from the network. pub-sub-proxy is used for subscribing to events.

The project uses docker for organizing and easily spinning up. The production configuration of this system varies slightly to allow for handling a large number of inbound requests.

The gateway is an nginx server that routes requests to either the front end or backend.

The front end runs on port 3000. The backend runs on port 5000.

A mock liquidity provider is provided to allow testing simple liquidity functionality. This piece should be replaced by a service that provides your organization with needed liquidity functionality.

The web frontend is a React based web application.

The mobile application is a React Native based mobile application for both iOS and Android.

Getting started

The project uses Docker containers to run its components. The containers are orchestrated using docker-compose.

System Requirements:

Run the following commands in the repository root to start a dev server:

make bootstrap
make dev

The wallet website will be available at http://localhost:8080

See docker/docker-compose.yaml for the setup details.

Development

Bootstrap environment, this is required for any other actions:

make bootstrap

Run all tests:

make alltest

Run all backend tests:

make test

Run single backend test: T=<test_name | test_file | test dir> make test

T=wallet make test

Run e2e test:

make e2e

E2E test also support T option for running subset tests

T=double make e2e

See Makefile for more details