2wp-app
This is the front end application for 2-Way-Peg solution. The solution will be a web interface (this app), which integrates with a Rest API, which in turn communicates with internal services such as the blockchain node and databases. In addition, a daemon/worker will be created that will be responsible for obtaining data from the blockchain and changing the status of the transaction.
Project setup
npm install
Environment variables
Create a .env.local
file in order to store locally the required variables for the app with the following fields:
All environment variables are listed in this here.
Development mode
The 2wp-app application will run on 8080 port.
Using npm
npm run serve
Check npm and node versions
npm -version
6.14.16
node -v
v14.19.1
Deployment
docker-compose up
Testing
To execute unit tests, run:
npm run test:unit
It should execute 6 test suites with 28 tests in total.
Like this example:
PASS tests/unit/PowPegAddressUtils.spec.ts
PASS tests/unit/SatoshiBig.spec.ts
PASS tests/unit/utils.spec.ts
PASS tests/unit/OpReturnUtils.spec.ts
PASS tests/unit/txSummary.spec.ts
PASS tests/unit/ApiService.spec.ts
Test Suites: 6 passed, 6 total
Tests: 28 passed, 28 total
Snapshots: 0 total
Time: 2.809s
Running Lint
npm run lint
Production mode
To create a production build, run:
npm run build
Report Security Vulnerabilities
To report a vulnerability, please use the vulnerability reporting guideline for details on how to do it.