Skip to content

Commit

Permalink
Merge branch 'feature/cleanCodeInprove' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldsg20 committed Apr 6, 2021
2 parents 559317e + 0582b0b commit 620d102
Show file tree
Hide file tree
Showing 31 changed files with 14,970 additions and 283 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ typings/
data/*
# sessionDB local
SessionDB/data/redis-data
sonar-project.properties
.scannerwork
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
# 2wp-api

This application is generated using [LoopBack 4 CLI](https://loopback.io/doc/en/lb4/Command-line-interface.html) with the
[initial project layout](https://loopback.io/doc/en/lb4/Loopback-application-layout.html).

## Install dependencies

By default, dependencies were installed when this application was generated.
Whenever dependencies in `package.json` are changed, run the following command:
This is the API component for 2-Way-Peg solution.
## Development Mode
Include a .env file with the required environment variables:
```js
NETWORK='testnet' // or mainnet
FEDERATION_ADDRESS=<Address>
BTC_CONFIRMATIONS=100 // default
INPUT_SIZE=180 // default
FAST_MINING_BLOCK=1
AVERAGE_MINING_BLOCK=6
LOW_MINING_BLOCK=12
LEGACY_REGEX='^[mn][1-9A-HJ-NP-Za-km-z]{26,35}' // testnet
SEGWIT_REGEX='^[2][1-9A-HJ-NP-Za-km-z]{26,35}' // testnet
NATIVE_SEGWIT_REGEX='^[tb][0-9A-HJ-NP-Za-z]{26,41}' // testnet
SESSIONDB_HOST=<HOST>
SESSIONDB_PORT=<PORT>
SESSIONDB_PASSWORD=<PASSWORD>
SESSIONDB_INDEX=<INDEX> // default 1
BRIDGE_ADDRESS='0x0000000000000000000000000000000001000006' // default
RSK_NODE_HOST=<RSK_NODE_HOST:PORT>
```
### Install dependencies

```sh
npm install
Expand All @@ -17,30 +32,21 @@ To only install resolved dependencies in `package-lock.json`:
```sh
npm ci
```
### Session DB
Move to the `SessionDB` folder and run:

## Run the application
```sh
docker-compose up
```

## Run the application
```sh
npm start
```

You can also run `node .` to skip the build step.

Open http://127.0.0.1:3000 in your browser.

## Rebuild the project

To incrementally build the project:

```sh
npm run build
```

To force a full build by cleaning up cached artifacts:

```sh
npm run rebuild
```

## Fix code style and formatting issues

Expand All @@ -56,7 +62,6 @@ npm run lint:fix

## Other useful commands

- `npm run migrate`: Migrate database schemas for models
- `npm run openapi-spec`: Generate OpenAPI spec into a file
- `npm run docker:build`: Build a Docker image for this application
- `npm run docker:run`: Run this application inside a Docker container
Expand All @@ -67,9 +72,4 @@ npm run lint:fix
npm test
```

## What's next

Please check out [LoopBack 4 documentation](https://loopback.io/doc/en/lb4/) to
understand how you can continue to add features to this application.

[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)[email protected])](http://loopback.io/)
Loading

0 comments on commit 620d102

Please sign in to comment.